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 suspect the problem to be related to how CIndicator handles missing data from its buffer. refer to the source code on Indicator.mqh for the next statements. the Refresh function does not return any value, and ignores the value returned by its buffer. when the buffer refreshes, it runs CopyBuffer. when the returned value is < 0, CIndicator does nothing with that information. supposing that is the failure, I cannot see how that would lead to the indicator deleting the data that already populated the custom indicator buffer, and not thrown any exception/error. I expected for previous buffer content to remain, thus leaving the indicator simply not updating, but still shown on screen.
That sounds an awful lot like the end product of iMA() or iCustom() (Commented out in my code template, above).
Theoretically, your fix should work.