This is a very simple question. When I code a strategy, for example, the OnBarUpdate() starts from the left most bar and does all the commands until the right most bar. I want to run commands only on the current/active bar, not on any of the historical bars. How can I do that?
In pseudo code, I imagine it should look something like this:
OnBarUpdate()
if (Current_Bar) {
do stuff
}
Thus, I want to "do stuff" only on the right most bar of the graph, which is the current active bar, not on any historical bars.
Thanks,
Matt

Comment