I have let Chelsea know about your interest in a ready to test strategy that can demonstrate this behavior in addition to using another Calculate mode. The changes involved to this strategy would be minimal as long as it is understood how an intrabar strategy operates.
To have the example above calculate intrabar, you can set Calculate to OnEachTick or OnPriceChange. Any logic that you would want to have process on bar closes would then be placed within a check for if (IsFirstTickOfBar) and BarsAgo 1 references would be used. I.E. Close[1] in IsFirstTickOfBar would represent the bar that had just closed. A BarsAgo value of 0 would represent the developing bar's value.
IsFirstTickOfBar - https://ninjatrader.com/support/help...ttickofbar.htm
Calculate - https://ninjatrader.com/support/help.../calculate.htm
If you change the strategy to Calculate.OnEachTick or OnPriceChange, line 53 if (Bars.IsFirstBarOfSession) will be true for each tick of that bar. I would suggest adding an IsFirstTickOfBar check with that condition to ensure it only happens once on that bar.
Please let us know if you have any questions.
Comment