int i=(int)MathMax(prev_calculated-1,1); for(; i<rates_total && !_StopFlag; i++)
See How to do your lookbacks correctly #9 — #14 & #19. (2016)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I've written an indicator for the Ulcer Performance Index, also known as the Martin Ratio. It works, but on chart refresh, it often doesn't recalculate and update the display correctly. I used code from the Ulcer Index to try to prevent constantly recalculating the whole thing, but it still has issues on a chart refresh. What am I missing?