For sometime I develop a strategy based on my own imbalance indicator. The indicator compared to the paid indicators on the market is working as expected and there is no differences.
is stated that the purpose of TickReplay is exactly to reproduce tick-by-tick the historical market events.
Could somebody explain what is the difference between TickReplay and real-time market events because it seems like in the NinjaTrader documentation is not explained very well.
TickReplay uses 1 tick data to build the historical bars and uses the OnMarketData method to do so, which guarantees the data to be in the correct sequence. The OnMarketData method is not called on historical data, but it can be with TickReplay. NinjaTrader only calls the OnBarUpdate once per bar for historical data and does not call the OnMarketData method unless you use TickReplay. With TickReplay enabled, the historical data is replayed tick by tick.
If you continue to read that, you’ll see the option for Order fill resolution. Setting this to High will allow you bring in 1 tick data series for better intra-bar fills. What I usually do is have a 1 tick data series in the strategy and use it for entries. The strategy will be triggered based on the primary data series, but enter where the 1 tick data series is at the time. Even though it’s not going to be exactly the same as if it was live, this provides more accurate backtesting. When running a historical backtest even with the 1 tick data series, Ninja still doesn’t know if your stop or target was touched first in the same bar. For example, using a 1 minute bar, if you enter in at 100 and your target was at 105, but the stop was at 95 and the bar touched both… which came first? Ninja doesn’t know and guesses based on the three virtual bars.
To get the most accurate results, you want to use your strategy in replay mode because Ninja replays the historical data tick by tick in order as if it is happening live.
@ WaleeTheRobot Thank you for your detailed reply.
As you explained, this means that there is no way for having real back-test even with the 1-tick data series. The only way for doing so is market “Playback”. But having in mind that the Playback connection is real-time and the need to do 2-3 months of back-test seems to be unreachable.
Is speeding up the Playback connection giving real-time results? Or it is just skipping the time intervals?
Another option to achieve maximum accuracy in the filleds of the exit orders (takeprofit + stoploss) is to program a multi-timeframe strategy. The second Dataserie would be 1-tick to achieve maximum precision in the filleds. The main dataserie (eg 15min) would be used to detect the input triggers, and the orders (enter & exit) would be sent in the secondary dataserie (which, being in 1-tick they would not have delay).
Speeding up the playback will give you more realistic results. I usually just use around 8 to 10x the speed. You should consider using the replay after you have a profitable strategy from backtest. It’s time consuming, but you’ll start to identify the reasons why your strategy may fail in real-time.