Hello, good afternoon. I’m designing a strategy but I can’t get it to work the way I want. The strategy seems very simple, but… I want to compare the opening prices of two candles, let’s say the 10:30 and 10:35 candles. If the 10:35 candle opens higher than the 10:30 candle opens higher, I want to go long at that moment.
When I run the backtest, it places the order at the 10:36 candle opening, so that doesn’t work for me.
I’ve tried using OneEachTick, but I get the same result.
And I’ve also tried setting Order Fill Resolution to High, but I get the same result.
Thank you very much for your help.
Seems like your historical data is not tick data. Also, you need to enable tick replay.
But then I can’t do a backtest with Strategy Analyzer; I’d have to use Market Replay to see how my system is behaving.
I don’t know if there’s a way to configure what you’re suggesting in Strategy Analyzer, because I ran a backtest with volume charts and the system didn’t execute correctly.
What do you mean you can’t do backtest in strategy analyzer based on me assuming your historical data is not tick data and you didn’t enable tick replay? Market replay uses a different data and not the same ones used by the strategy analyzer. You need to ensure that the historical data you download is tick. https://support.ninjatrader.com/s/article/Developer-Guide-Improving-backtest-order-fill-accuracy-with-intrabar-granularity?language=en_US
I design a strategy, and the expected condition is met—let’s say at 3:40 PM—and I want to enter at the opening of the 3:41 PM candle. In Strategy Analyzer, I have it configured as DATA SERIES, Instrument, Price based on LAST, Type MINUTE, and Value 1. This way, it executes the order at the opening of the 3:42 PM candle (a test I’ve done shows it executes 28 trades for that time period). If I configure it as DATA SERIES, Instrument, Price based on LAST, Type TICK, and Value 150, using the same time period as before, it tells me it executes 8 trades.
despite putting Calculate = Calculate.OnEachTick; in the script
Thanks, I’ll look at the article that I think might help me.
If you don’t have the historical tick data then it doesn’t matter if you select calculate on each tick. If you want intrabar entries then you need to download tick data. If you don’t care about intrabar then just open the position on first tick of new bar.