I'm not sure if it is a bug in the system or I misinterpreted it. I have the following point and figure strategy and I backtested it on strategy analyzer. I ran them for 3 different dates: a) Dec 9, b) Dec 8, c) Dec 5. The only parameters I changed were the date obviously, and set Min-Bars-Required to 0. And the following are the results for the 3 different dates.
a) Test Date: 12/9/12 - 12/9/12
Day 1st Bar: 20111208
Time 1st Bar: 182001
Day Last Bar: 20111209
Time Last Bar: 165535
b) Test Date: 12/8/12 - 12/8/12
Day 1st Bar: 20111207
Time 1st Bar: 185724
Day Last Bar: 20111209
Time Last Bar: 165535
c) Test Date: 12/5/12 - 12/5/12
Day 1st Bar: 20111205
Time 1st Bar: 20022
Day Last Bar: 20111206
Time Last Bar: 154836
FX session opens from 1 day 5pm to next day 5pm. So for the test result for a) Dec 9 seems right.
However for b) Dec 8 and c) Dec 5 the results don't seem right.
For b) Dec 8 - it seems to process data of 2 trading sessions: Dec 7 - Dec 9.
For c) Dec 5 - since it is a Monday, FX market opens on Sunday. So the 1st bar's day should really starts from Dec 4 and last bar ends Dec 5. Instead, the system processed data from the 5th to the 6th.
Please advise.
Code:
protected override void Initialize()
{
AddPointAndFigure("$EURUSD", PeriodType.Tick, 1, 5, 3, PointAndFigurePriceType.HighsAndLows, MarketDataType.Last);
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
Print(High[0]);
Print(Low[0]);
Print("The Day is:");
Print(ToDay(Time[0]));
Print("The Time is:");
Print(ToTime(Time[0]));
Print("");
}
}
Comment