Symbol's start/end time in Symbol Info Manager?
Author: brucev
Creation Date: 12/15/2010 4:40 PM
profile picture

brucev

#1
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
profile picture

Eugene

#2
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.
profile picture

brucev

#3
Thanks Eugene.
profile picture

Cone

#4
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. ;)
profile picture

Cone

#5
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.
profile picture

Eugene

#6
CODE:
Please log in to see this code.

And no need in:
CODE:
Please log in to see this code.

:)
profile picture

brucev

#7
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
profile picture

Eugene

#8
Bruce, try the other (overridden) call to GetExternalSymbol - specifying the ASCII DataSet with your synthetic Daily symbols. Check out the QuickRef.
profile picture

brucev

#9
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
profile picture

brucev

#10
Hi,
appears previous link to image didn't work... image is here: http://i1086.photobucket.com/albums/j448/brucev2/wlsync.jpg

Cheers,
Bruce
profile picture

Cone

#11
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?
profile picture

brucev

#12
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
profile picture

Cone

#13
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.
profile picture

Cone

#14
Here's the all-in-one solution. Give this a shot -

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

brucev

#15
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
profile picture

Cone

#16
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.
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).