It has added one additional M1 dataseries with Add(PeriodType.Minute, 1);
Now the problem - I get 2 different backtest results when running on the same
M1 dataseries. (First M1 dataseries is set from GUI, the second is added manually.
When running backtest, I am filtering the default one, or the second added. In both cases, the backtest result are different).
- when I run it on default M1 series (set in GUI) - filtered with
if (BarsInProgress [B][COLOR=Red]== 1[/COLOR][/B]){ return; }
if (BarsInProgress [B][COLOR=Red]== 0[/COLOR][/B]){ return; }
How it is possible, that the backtest results are in both cases different?
To reproduce it, just try to run this trivial demo strategy on M1 timeframe:
(File also in attachment)
protected override void Initialize()
{
Add(PeriodType.Minute, 1);
SetProfitTarget("", CalculationMode.Ticks, 1);
SetStopLoss("", CalculationMode.Ticks, 10, false);
CalculateOnBarClose = false;
}
protected override void OnBarUpdate()
{
[SIZE=2][COLOR=Red][I]//HERE JUST REPLACE 0/1 for switchi[SIZE=2]ng between CHART [SIZE=2][SIZE=2]vs ADDED [/SIZE][/SIZE][/SIZE]data series. [SIZE=2]
[/SIZE][/I][/COLOR][/SIZE][SIZE=2][COLOR=Red][I][SIZE=2] //Both are M1, so the result should be the same.[/SIZE][/I][/COLOR][/SIZE]
if (BarsInProgress != [B][COLOR=Red]0[/COLOR][/B]){ return; }
//just some demo trade
if (Close[0] > Close[1])
{
EnterShortLimit(Close[0]);
}
}

Comment