Why OHLC doesn't match in different timeframes after SetScaleCompressed?
Author: ays
Creation Date: 2/7/2011 8:51 AM
profile picture

ays

#1
As I understand, after call to SetScaleCompressed I'll get new (scaled) Bars object, equivalent to upper time-frame data for the same period.
Where am I wrong? In result of execution of code below, I got different OHLC values, for example, for 30-minute timeframe and compressed 15-minute timeframe for the same stock for the same period.
CODE:
Please log in to see this code.
profile picture

Eugene

#2
When posting code, please use the CODE tags: paste a code snippet and wrap it with a pair of CODE tags by selecting it and clicking the CODE button (Bold, Italic, ... CODE, IMG).

Using the code below, I get absolutely identical charts, one produced by SetScaleCompressed (Google 5-min data) and then imported as an ASCII DataSet, and another by compressing the original intraday data using Wealth-Lab's native scaling.
CODE:
Please log in to see this code.
profile picture

ays

#3
Yes, SetScaleCompressed and Wealth-Lab scaling produces the same results.
The question is why its did not produce expected results. Look at this quotes, please:
15-minute:
QUOTE:

<TICKER>,<PER>,<DATE>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
SBER,15,20110111,103000,104.99000,105.30000,104.24000,104.29000,7231317
SBER,15,20110111,104500,104.29000,104.38000,103.60000,103.70000,9984720

30-minute (manually compressed from 15-minute):
QUOTE:

<TICKER>,<PER>,<DATE>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
SBER,30,20110111,103000,104.99000,105.30000,103.60000,103.70000,17216037

And produced by the code from the previous message (with TargetInterval = 30):
QUOTE:

<Date>,<Open>,<High>,<Low>,<Close>,<Volume>
11.01.2011 10:30:00,104,99,105,3,104,24,104,29,7231317
11.01.2011 11:00:00,104,29,104,38,103,6,103,7,9984720

Why we got addition bar at 11:00?
profile picture

ays

#4
I found the answer: WLD uses bar close time.
So, the question is: How to switch to using bar open time in SetScaleCompressed?
profile picture

Eugene

#5
It's not designed to be changed.
profile picture

novaege

#6
When i run code below in wealthlab developer i got "Cannot convert daily bars to 10 daily bars"
But i want to change it 15 min scale.
CODE:
Please log in to see this code.
profile picture

Eugene

#7
SetScaleCompressed() works on intraday scales only. You can't use it to convert to "10-daily bars". Switch the chart to an intraday DataSet.
profile picture

novaege

#8
Hi,

I defined a new dataset with importing metastock data file.
But how can i do switch to intraday dataset? When i try to change it always prompts "Cannot convert Daily Bars...."
I build the strategy library dll and copied wealthlab folder.
I started wealthlab and got "Cannot convert Daily Bars to 15 Minute Bars"

My code is
CODE:
Please log in to see this code.
profile picture

Eugene

#9
I don't know how this code was derived as we never advised something like this before, but it just puts the cart (Synchronize) before the horse (RestoreScale). Check out the Programming Guide for an in-depth talk on synchronization plus the QuickRef for an example.
profile picture

sourkraut

#10
QUOTE:
SetScaleCompressed() works on intraday scales only. You can't use it to convert to "10-daily bars".


Seems to me to be a desirable feature. Why not provide the same kind of features for daily/weekly/monthly charts as you have for 1min/5min/15min/etc ?

profile picture

Eugene

#11
Because overloading a software with less used features isn't desired, I guess. Plus, less or no bang for the buck.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).