Quote:
Originally Posted by wolfe
I've figured out that the indicator is working fine until a new bar is formed, then the indicator is stopping. Can someone look at the code in the first post and see if they can fix this? It doesn't seem to be continuing when a new bar is formed.
Thank you to anyone that can help!
|
Check the logic for "limit"...
As it currently stands: apart from at the first start() call, the counted_bars value will always be in the vicinity of Bars, while All_Bars by the looks of it remains 10, and therefore limit becomes a large negative number.
Maybe you wanted
PHP Code:
limit = MathMin( All_Bars, Bars - counted_bars);
or something similar?