Thank you for your reply.
It's important to keep in mind that in a backtest, fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.
Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick'.
Also, here is a link to the differences on real-time vs backtest (historical).
http://ninjatrader.com/support/helpG...ime_vs_bac.htm
So if you're running the strategy on each tick on live data, any positions calculated in a backtest or on historical data on a chart will actually be calculated as if you were running the strategy On Bar Close instead of On Each Tick. That may be the source of the strategy appearing to not calculate as you'd expect if you're not actually looking at what it's doing when running it on live data.
You can set up a crossover condition to check the previous bar and the one prior to it if you like, just set the bars ago for both the MACDs to 1:
Please let us know if we may be of further assistance to you.
Comment