Ulcer Performance Index aka Martin Ratio - problems on refresh
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)
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 agree to website policy and terms of use
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?