this indicator is not auto refreshing alongwith the chart progress, thanks in advance
int counted_bars=IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit-=1+8; if(limit<NumBars) return(-1); ⋮ for(int i=NumBars; i>=0; i--)
-
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 programming forum (2022)
-
Because that is not how you do your lookbacks. After the first run, limit will be negative and you do nothing.
How to do your lookbacks correctly #9 — #14 & #19 (2016)See How to do your lookbacks correctly #9 — #14 & #19. (2016)
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016)
Your topic has been moved to the section: MQL4 e MetaTrader 4 — In the future, please consider which section is most appropriate for your query.

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