Martin, is the max bars back you have specified for the study enough for code calculation?
Have you tried increasing the value and then re-adding the study to the chart?
Henry
Is there a way to detect how many bars did MC needed to do it's calculation. I did try with 100 bars, but still do the same. I don't think that I have anything related to historic bars in my code. No MA, Bollinger or anything like that. This has been written few years ago and code added to it.
I did look trough all functions used in the indicator and non the max historic data is 3 bars if I recall.
Could the function "LastBarOnChart" be implicated?
The fact that the code is run twice do bug me because I wanted to use a Global variable as a toggle switch and be check at the beginning. If "on" then off, If "Off" then "on. I will see how to overpass that.
Martin