I bumped into a problem using NT8 for backtesting historical data, for comparison I also include code and results for NT7 since NT7 results are as expected.
Using this simple strategy in NT8:
protected override void OnBarUpdate()
{
EnterLongStopMarket(Close[0] + 1);
EnterShortStopMarket(Close[0] - 1);
}
Using the above NT8 system for a backtest, trades are generates as shown in the attached file NT8_trades. We are always in the market, and the following should always be true:
Exit price of trade N == Entry price of trade N+1
However, this is not always the case, see trade 5 and 6 in file NT8_trades (also 13-14, etc).
On trade 6, instead of using the opening price of 350.60, the price 350.75 is used (350.75 is Close[0] - 1), I think this might be a bug in NT8.
For comparison the same system in NT7:
protected override void OnBarUpdate()
{
EnterLongStop(Close[0] + 1);
EnterShortStop(Close[0] - 1);
}
Using the above NT7 system for a backtest, trades are generates as shown in the attached file NT7_trades, all trades are as expected.
Backtest settings can be viewed when opening NT8_trades.
If you want I can provide the historical data used, to reproduce this problem.
Thanks, Steven
Comment