I've tried everything - I just can't get this right!
Let's say there's a value A that I can only define with:
if (CurrentBar < Count - 2) return;
However, I need to use this value in a Plot which later in the code is defined over a range, say (Count - 20) to (Count - 10).
The problem seems to be the obvious one: as I've defined it with CurrentBar < Count - 2, the value doesn't seem to be recognized over the 'earlier' range.
Also, is it best to define this value as double A in Variables or in OnBarUpdate?
I hope I've made myself clear and thanks in advance for any help with this.

You can refer to historical bars, and you can change anything that is held in an indicator relative to said bars. Maybe if you explained in words what you are trying to do on those historical bars? I cannot make head or tail of the math that you have put down so far.
Comment