I'm currently working to transition a strategy from historical testing to live trading. A snag that I've hit is the difference in the way historical day bars are treated in backtesting vs. real-time trading.
The strategy uses a couple of Daily EMAs as indicators. In back testing, a daily EMA only updates once the bar has closed. However, when running the strategy in real-time, the EMA will start calling on the current day's non-completed bar per... https://ninjatrader.com/support/help...?calculate.htm
Calculate.OnBarClose creates consistency between the historical test and real-time but I have one concern with doing this... The strategy uses simulated stops which I adjust... I'm fine with the stops only adjusting at the end of each bar but my concern is that if during a minute bar the market spikes materially higher, the stop order will not trigger until the completion of the minute bar.
I'm currently playing around with forcing the daily EMA to update on bar close within the indicator itself but it seems like this "is not recommended" per:
It seems like the most elegant solution is to have the indicator only update once a new day bar closes, but in the forum and help guide I haven't found an example of how to handle this.
Best,
RandanAL
Comment