
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
Continuing from #23 and encapsulating in a function #26, I now show a struct that works on both MT4 and MT5. (For post-build 600, I've changed the invalid dots (#29) in variable names, and approprate ints to standard enumerations.)
Hi William & Co.
If you call iCustom multiple times for a given indicator with the same symbol & timeframe, is the full indicator code executed repeatedly or does MQL4 does something smart behind the scenes to cache the resulting buffers? Hopefully it's the latter especially for more heavier indicators... My understanding is that MQL5 improves this situation by using handles, treating indicators similar to that of opening/closing files.
Furthermore, when programming EAs I am interested in using the CIndicator derived classes from the Standard Library which probably offers greater control (and extensibility) when compared with the built-in functions (iCustom, iMACD, iBands, etc), not to mention that theoretically should offer similar programming semantics on both platforms, MT4 and MT5. However I have not yet tried it myself and still puzzled by the significant differences in the source code between MQL4 and MQL5 (Include/Indicators/*.mqh). Would be so kind to offer your insights on the pros and cons from your understanding of and experience with these functions/libraries?
Thanks a lot for the quick response, William -- it is interesting approach indeed... Are such invisibly created indicators automatically destroyed when the EA is terminated? I would assume so, at least in MQL4; maybe in MQL5 perhaps one needs to explicitly call IndicatorRelease() for the indicator handles in use by the EA.
PS: Do you happen to have any experience with CIndicator classes in the Standard Library? I've been searching online for code samples and couldn't find much, other than the meagre reference material at http://www.mql5.com/en/docs/standardlibrary/technicalindicators/CIndicators/CIndicator (or built-in help system).
PPS: Is there a way to enable email notifications in this forum? I looked around in my account settings and was unable to find anything.