Background:
A) Primary instrument is a highly liquid ETF and the strategy runs on 10 Minute bars. All other instruments are indexes used in calculations
B) There are no errors or any anomalies in the logs or trace.
C) My strategy stores values to file while running and I have narrowed it down to the simple issue below.
D) Calculations and strategy runs flawlessly in Strategy Analyzer and Market Replay.
E) Running in US Equities RTH
F) PROBLEM: A calculation in the strategy fails because in the Live strategy the value of Closes[3][0] is always incorrect at 9:40AM. Here is an example of my raw output. The value "Prior Ind" is equal to Closes[3][0] in all 3 cases – it is the exact same function that is outputting this data.
2/7/2014 9:40:00 AM Prior Vol = 19.29 Prior Ind = 3455.65
2/7/2014 9:50:00 AM Prior Vol = 19.29 Prior Ind = 3497.01
2/7/2014 10:00:00 AM Prior Vol = 19.29 Prior Ind = 3497.01
2/10/2014 9:40:00 AM Prior Vol = 16.55 Prior Ind = 3497.01
2/10/2014 9:50:00 AM Prior Vol = 16.55 Prior Ind = 3560.36
2/10/2014 10:00:00 AM Prior Vol = 16.55 Prior Ind = 3560.36
G) The value of Closes[3][0] at 9:50AM and 10:00AM are correct. It is clear that the value at 9:40AM is from a prior bar/day.
My Guess as to the Problem:
There is a boundary condition that is being caused since Closes[3][0] is taken at the first 10 Minute bar of the trading session at 9:40 AM. In the Live strategy, NT does treat the first bar as closed yet and so gives the value from the previous bar which is the last bar of the prior day. This is a total guess and I would love to be wrong or told what I am doing wrong which is creating this situation.
Further info regarding setup:
Initialize:
Add(Instrument.FullName, PeriodType.Minute, 10);
Add(triggerName, PeriodType.Minute, 390);
Add(IndexName, PeriodType.Minute, 390);
TraceOrders = true;
CalculateOnBarClose = true;
Comment