Feature Request: IndicatorSetDouble counterpart - page 2

 

Thanks everyone, glad to see that at least I'm not the only one missing these functions. Fingers crossed that they can be added in a future release.

Instead of 3 different functions (IndicatorGetInteger, IndicatorGetDouble, IndicatorGetString), maybe it could even be just a single function "IndicatorProperties()", similar to the already existing "IndicatorParameters()" one.

 
Fernando Carreiro #:

The author of the MQL5 Book also expressed regret for the lack of this functionality ... MQL5 Book: Creating application programs / Creating custom indicators / Indicators in separate subwindows: sizes and levels

Yes, the situation is even worse, because the missing getter/setter functions are missing in more contexts, than you mentioned here. For example, in the book we were compelled to invent a special version of indicator (UnityPercentEvent.mq5) to broadcast its properites to the expert adviser (UnityMartingale.mq5):

MQL5 does not allow reading the names of third-party indicator buffers and in general, any line properties other than integer ones. There are three functions for setting properties: PlotIndexSetInteger, PlotIndexSetDouble, and PlotIndexSetString, but there is only one function for reading them: PlotIndexGetInteger.

In theory, when MQL programs compiled into a single trading complex are created by the same developer, this is not a big problem. In particular, we could separate a part of the indicator's source code into a header file and include it not only in the indicator but also in the Expert Advisor. Then in the Expert Advisor, it would be possible to repeat the analysis of the indicator's input parameters and restore the list of currencies, completely similar to that created by the indicator. Duplicating calculations is not very pretty, but it would work. However, a more universal solution is also required when the indicator has a different developer, and they do not want to disclose the algorithm or plan to change it in the future (then the compiled versions of the indicator and the Expert Advisor will become incompatible). Such a "docking" of other people's indicators with one's own, or an Expert Advisor ordered from a freelance service is a very common practice. Therefore, the indicator developer should make it as integration-friendly as possible.

Taken from here.

MQL5 Book: Trading automation / Testing and optimization of Expert Advisors / Big Expert Advisor example
MQL5 Book: Trading automation / Testing and optimization of Expert Advisors / Big Expert Advisor example
  • www.mql5.com
To generalize and consolidate knowledge about the capabilities of the tester, let's consider a large example of an Expert Advisor step by step. In...