View Full Version : Weekend data not triggering on secondary time series
08-09-2007, 09:01 PM
I am trying to write a multipe time series strategy. Unfortunately, the secondary time series does not seem to trigger OnBarUpdate after midnight between Friday and Saturday until midnight between Sunday and Monday.
The primary bar series does not have this problem.
Setting the strategy's ExcludeWeekend property to false has no effect.
Is this expected behavior? Am I missing a setting or property?
08-09-2007, 11:48 PM
We will look into that and let you know
08-10-2007, 03:05 AM
- this is a realtime issue and not a backtest issue?
- you are on latest NT6R4?
08-10-2007, 03:52 AM
I have not tested it in realtime yet.
So far I have only observed it on the historical data when I put it on the chart.
The strategy I am developing relies on indicator values calculated on a secondary time series. However, since indicator values are not being calculated for any data after midnight Friday night, the indicator values are completely off for a large part of the following Monday.
And no, it is not related to the indicator in question. Any code (such as drawing methods) executed on bar updates for that particular bar series does not execute after midnight.
Essentially it looks like the ExcludeWeekend property for some reason is being set to true for that bar series.
FYI, I am using version 6.0.1000.4.
08-10-2007, 05:39 AM
I just implemented attached sample strategy which did not exhibit any problem. (primary=$EURUSD, secondary=$EURJPY, both currencies are traded on sunday).
- please make sure you really have data for the secondary series over on weekend
- to be save I suggest running further tests on latest custom build which you can download here:
(note: you need to uninstall NT6 before)
- I suggest taking my sample strategy, adding/changing code step by step and see where your logic breaks
08-10-2007, 06:04 AM
Thanks, Dierk. I will give it a look Monday morning.
BTW, my strategy is running on two time series on the same instrument, not multiple instruments if that makes a difference.
08-10-2007, 09:12 AM
Tried primary=$EURUSD, secondary=$EURUSD. Same positive result.
08-12-2007, 08:10 PM
Just downloaded and installed the custom build of NT and ran your sample.
I changed the code so that the second time series is from the same instrument and the bar size is 5 minutes:
//Add("$EURJPY", PeriodType.Minute, 1);
I put it on $EURUSD, 1 minute bars, 10 days back.
I only get the 12:00 AM bar updates in the output window:
Got it: BarsInProgress=1 at 8/4/2007 12:00:00 AM
Got it: BarsInProgress=1 at 8/11/2007 12:00:00 AM
If I change the code to ouput on the primary bar series instead, I get all the output messages I would expect. So the issue is only affecting the secondary bar series.
If I open a chart with what should be in the secondary series (that is 5 minute bars), I see everything I should see. So the data in question can be loaded.
As I said before, it looks exactly like what you would expect to see if the secondary series was loaded with ExcludeWeekend=true.
Circumstances that I can think of that may or may not influence what I am experiencing:
Time zone: I am in East Asia (GMT +8:00).
Data supplier: ESignal.
08-13-2007, 01:45 AM
Sorry I can not reproduce. I tried this:
- set my PC to GMT+8 hours
- amended strategy as per your suggestion
- got a fresh DB
- connected to eSignal and pulled 30 days of 1 minute data for $EURUSD
- disconnected from eSignal
- opened strategy analyzer and output window
- run test strategy on $EURUSD with ExcludeWeekend=False
and got this:
Got it: BarsInProgress=1 at 04.08.2007 05:30:00
Got it: BarsInProgress=1 at 04.08.2007 05:35:00
Got it: BarsInProgress=1 at 04.08.2007 05:40:00
Got it: BarsInProgress=1 at 04.08.2007 05:45:00
Got it: BarsInProgress=1 at 04.08.2007 05:50:00
Got it: BarsInProgress=1 at 11.08.2007 00:00:00
Got it: BarsInProgress=1 at 11.08.2007 00:05:00
Got it: BarsInProgress=1 at 11.08.2007 00:10:00
Got it: BarsInProgress=1 at 11.08.2007 00:15:00
Got it: BarsInProgress=1 at 11.08.2007 00:20:00
Please double check that you have installed latest custom build as per below. It is reported as 6.0.1000.4 as the regular so just go through that procedure:
- uninstall NT6
- clear your browser cache (important!)
- download from here: www.ninjatrader-support.com/ninjatrader/nt6.custom/NinjaTrader.Install.msi
Not sure it that would make a difference, but just in case...
08-15-2007, 08:34 PM
OK, now we are getting somewhere.
Until now I had not tried it with the Strategy Analyzer. If I do that it prints out all the weekend values without any problems.
However, if I put it on a realtime chart it does not print out the values for the historical data on the chart. That was my point.
When I said that I had not tried it with realtime data, I meant that I had not run it over the weekend to test if OnBarUpdate would be called on non historical data.
08-15-2007, 10:58 PM
We'll look into and let you know.
08-16-2007, 02:37 AM
Thanks for your follow up. This is a bug which will be fixed with next release.
08-28-2007, 08:12 PM
If anyone is developing strategies along similar principles and is affected by the same problem, I think I have come across a simple work-around until the good people at NT get their next release out ;)
Simply adding the following property to your strategy and setting it to false in the Initialize method, seems to do the trick for me:
public bool ExcludeWeekend
base.ExcludeWeekend = value;
I have attached a modified version of Dierk's sample strategy to demonstrate the work-around.