Hi,
I am trying to make an VPT indicator
https://en.wikipedia.org/wiki/Volume%E2%80%93price_trend. My code works when I start the indicator, but when new ticks come in the value is wrong.
I have a variable "value" I keep adding to. If I keep adding once at every new bar, there would be no problem (That is why when Indi starts it is correct). How do I do this?
The value only may add when a new bar is formed (I need the value of the indicator at the "old" bar. But the indicator calculates at every tick so the value gets too big.