Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23
Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm trying to replicate a graphic Price Channel indicator and I've decided to right away copy and paste its code in my EA. The problem is that the indicator shows a value of 4 decimals when you hover the mouse on it, and I have no idea what's it doing: it's not rounding and it's not trimming, sometimes it rounds up, sometimes it doesn't. I'd like to ask to someone who's familiar with indicators where, on its code, is the part that makes it show 4 decimals (and not 5, like the variables "lasthigh" and "lastlow" show on an alert). I attach the code of the indicator. Thanks a lot.