Here are my settings:
1. I am backtesting on CL ##-##, DoNotMerge
2. Test period 1/1/2013 - 3/12/2015
3. Test on Daily bar chart
In my Initialize(), I added these instruments:
Add("CL 12-14", BarsPeriod.Id, BarsPeriod.Value); Add("CL 01-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 02-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 03-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 04-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 05-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 06-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 07-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 08-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 09-15", BarsPeriod.Id, BarsPeriod.Value);
The expected behavior is, OnBarUpdate will run 10 times for each daily bar, but a simple test using Print("Hello world") shows that it is not happening at all.
If I change the added instrument to:
Add("CL 12-14", BarsPeriod.Id, BarsPeriod.Value); Add("CL 01-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 02-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 03-15", BarsPeriod.Id, BarsPeriod.Value); Add("CL 04-15", BarsPeriod.Id, BarsPeriod.Value); // Add("CL 05-15", BarsPeriod.Id, BarsPeriod.Value); // Add("CL 06-15", BarsPeriod.Id, BarsPeriod.Value); // Add("CL 07-15", BarsPeriod.Id, BarsPeriod.Value); // Add("CL 08-15", BarsPeriod.Id, BarsPeriod.Value); // Add("CL 09-15", BarsPeriod.Id, BarsPeriod.Value);
Is this a bug? Or a design?
Comment