I have noticed that there is a difference in behavior of the "CurrentBar" in NT8 as opposed to NT7.
CurrentBar in NT7 always represented the lastbarpainted. This was very handy as it meant that I could simulate how my indicator would perform in a live market bar by bar by just scrolling back, hitting F5 and then clicking the keyboard right arrow one by one. Provdided that the condition was set to only run my logic when lastBarPainted = Currentbar this is a great way to see an indicators behavior and backtest in a quick and easy way for a process hungry indicator.
Now NT8 appears to cycle through every CurrentBar upon indicator loading until it meets the Count of the chart irrespective of where the chart is scrolled to when the indicator is initiated.
In reading the NT8 ninjascript documentation i have noticed that there is a feature to read the last painted bar which is "ChartBars.ToIndex" which is solution to force the indicator to only run on the current scrolled bar by using the following statement
if (CurrentBar != ChartBars.ToIndex)return;
The issue with this is that in scrolling further through the chart from this point the indicator will no longer run on each subsequent bar as the CurrentBar is already at the end of the chart. All my logic is written to work backwards from currentbar so I am really hoping to be able to replicate the NT7 behaviour as described above.
Any suggestions?
Cheers.
Marty
Comment