Hi,
I have an intraday datasource in 1 min timeframe. I am wanting to compute a daily series from it.
At the moment, the setscaledaily and synchronize use midnight as the cutoff for each day. However, this is FX data, and the cutoff is 4:30 pm.
I seem to remember in an older WL, there was a way to specify the start/end of day in the Futures Symbol Manager. However, the current Symbol Info Manager doesn't have these fields.
So.. the question:
Is there a way to tell WL that the start and end of day is not midnight, so I can use the higher order timescales correctly?
Cheers,
Bruce
Size:
Color:
You can use the Bars.MarketInfo properties (OpenTimeNative/CloseTimeNative) to set the start/end of day in a Strategy.
However, you might also want to know that our upcoming Market Manager tool will make this configuration much easier. These days the extension is being finalized.
Size:
Color:
Thanks Eugene.
Size:
Color:
I'm afraid that SetScaleDaily() scales only w.r.t. calendar dates, and, I'm not sure that specifying MarketInfo in the Strategy will even change Bars.IntradayBarNumber. If you find otherwise, that would be good news!
If you need Daily data like this in your intraday Strategy, I'd recommend:
1. Creating an ASCII-export script that calculates the Daily bars per your specification.
2. When creating the ASCII data file, prefix (or suffix) the symbol with "D_" or something that would make the symbol unique from the intraday one.
3. In the trading script, then it's a simple matter to GetExternalSymbol("D_...", true).Close, create Daily indicators (if required), and then Synchronize it to the intraday time frame. At least in theory, it should work. ;)
Size:
Color:
Here's that script. Add the Reference specified in the Editor's toolbar "References...", and set the path and HHmm closing time in the script. It will export the "pseudo-Day" data to the path specified for the entire DataSet.
CODE:
Please log in to see this code.
Size:
Color:
CODE:
Please log in to see this code.
And no need in:
CODE:
Please log in to see this code.
:)
Size:
Color:
Hi Cone & Eugene,
thanks for this code. I have run it and created the ASCII files.
I then defined them as a Datasource to WL, and can see the symbols for EURUSD2010 (in 1min) and D_EURUSD2010 (in daily). A quick check in excel shows that the daily file looks good!
However, when I try and get the daily data I get a run-time error: Could not load data for symbol D_EURUSD2010
The error line is:
CODE:
Please log in to see this code.
I have also tried accessing it as
CODE:
Please log in to see this code.
with the same error result...
Data in the daily file looks fine (sample):
1/12/2010 1.3136 1.3247 1.3056 1.3205 0
2/12/2010 1.3204 1.3436 1.3191 1.3413 0
3/12/2010 1.3414 1.3437 1.3374 1.3377 0
5/12/2010 1.3377 1.3421 1.3242 1.3303 0
6/12/2010 1.3302 1.34 1.3255 1.3257 0
7/12/2010 1.3259 1.328 1.3177 1.3258 0
8/12/2010 1.3258 1.3322 1.3163 1.3236 0
9/12/2010 1.3236 1.3282 1.3177 1.3224 0
10/12/2010 1.3224 1.3236 1.3189 1.3197 0
12/12/2010 1.3197 1.3433 1.318 1.3392 0
13/12/2010 1.339 1.3498 1.336 1.3374 0
Any ideas?
Cheers,
Bruce
Size:
Color:
Bruce, try the other (overridden) call to GetExternalSymbol - specifying the ASCII DataSet with your synthetic Daily symbols. Check out the QuickRef.
Size:
Color:
Hi Eugene,
that works to load the data - thanks!
However, I still seem to have a problem... this time with the synchronization...
Here are two daily bars from the D_ file:
12/12/2010 1.3197 1.3433 1.318 1.3392 0
13/12/2010 1.339 1.3498 1.336 1.3374 0
Although the data is 1min scale, I have put this screen shot into 30mins so a whole day is visible.
The centre of this chart is the day of the 13th.
The end of day for this data is 10pm (marked above the bar on the 13th with a line).
However, this value on the end of day on the 13th is 1.3392, so I think it is out by 1 day, but can't see why in the intial script cone posted?
Also, the sync is off in the bars post-10pm and before midnight. Thinking about this makes me think the original solution may not work, as the synchronize still seems to sync with calendar days.
ie. up to 10pm on the 13th should be using the 10pm value on the 12th as its eod.
after 10pm on the 13th should be using the 10pm value on the 13th as its eod.
Cheers,
Bruce
Size:
Color:
Hi,
appears previous link to image didn't work... image is here: http://i1086.photobucket.com/albums/j448/brucev2/wlsync.jpg
Cheers,
Bruce
Size:
Color:
You're right, I was wrong about it being a simple matter. Wealth-Lab has never made "pseudo days" simple, unfortunately.
Not all is lost though since we can still use those Daily symbol data - you'll need to read and synch them yourself within in the script. We'll have to think of a versatile component that can do this work.
For your purpose, do you just need to synch the daily bars, or do you need to create daily-based indicators too?
Size:
Color:
Hi Cone,
I thought of trying to read them and sync them myself, but I was wanting to create Daily and Weekly indicators based on them.
Would I need to create those indicators with another script into seperate files and read and sync each one?
Cheers,
Bruce
Size:
Color:
That's one way to do it, but I've got an idea that would be easier - we can do this all in one script without even exporting the data. Give me a day or two.
Size:
Color:
Here's the all-in-one solution. Give this a shot -
CODE:
Please log in to see this code.
Size:
Color:
Hi Cone,
I am having a problem running this script.
I have selected my intraday datasource in 1 min timeframe, and get this message:
Runtime error: index was out of range. Must be non-negative and less than the size of the collection
I have gone through the code but can't see where the problem is.
Cheers,
Bruce
Size:
Color:
Sorry Bruce, I just remembered reading this a few days ago, but didn't have time to respond then. Please send me the symbol's data that you're having trouble with and the closing time to use in the script. Thanks.
Size:
Color: