I wanted to find out if anyone else has any luck using this method to get more accurate results backtesting with Ninja. The problem I have seen and is well known with Ninja that for example if you use 15 minute candlesticks to backtest your Autostrategy with you end up with non historical results because you will always be entering on the next candle and could be 5 legs up or down from your intended entry point. I know you can test the system in Market replay in which you get much more realistic results and thats like waiting for paint to dry.
Here below is the method I found somewhere on how to get more accurate backtest results,personally I am still not having any luck getting it to work but if anyone else has some workaround ticks to help I would appreciate hearing what they are.
Thank Quantismo
Accurate NinjaTrader backtest
Yesterday, I wrote a bit about how the backtester simulates ticks. When NinjaTrader encounters a bar where the stop and take profit fall within the bars range, it always assumes that the stop was hit first.
I had this issue come up for a client that wanted to sell his strategy to an institutional client. The institution wanted the ability to backtest in order to understand how the strategy performs in broader market conditions. The live results only covered 9 months, which made it difficult for the investor to make an informed decision. A reliable, accurate backtest would allow my client to facilitate the sale.
When we first programmed the strategy, it looked like an abysmal failure. The results showed a 45 degree equity plunge from every trade. He placed his stops at 1/3 of ATR, so naturally, NinjaTrader assumed that they were hit all the time.
The solution that we developed for him used the high time frame chart that the strategy actually used, but we then modified the code to do include what NinjaTrader calls intrabar granularity. Basically, we add tick charts on the backend to force the strategy to update on a tick by tick basis.
Its actually pretty simple to program. In the Initialize function, you need to add bid and ask tick charts.
The backtest results came within $5 of the actual trading results over a period of 9 months! Although backtesting frequently leads to inaccurate results, we were thrilled to reproduce the result with such a minor error.
The major disadvantage to this method is that you must manually type in the instrument name inside of the source code, then compile it, every time that you want to run a backtest on a new instrument. Its not a great solution, but NT7 unfortunately does not support programmatically calling the InstrumentName from within Initialize().