I need to get the opened indicators values (a bunch of this) from a current chart of MetaTrader 4 (by using mql4), and export this values on python (by using ZeroMQ library), in order to create a dictionary of this values and using it for other purpose. I just do that for candlestick data, but that's quite simple. I know there's ChartIndicatorTotal to know number of total indicators on the chart, and ChartIndicatorName to know the names of the indicators on the chart, but I don't know how I should use this functions in order to get the values I want.
Asked
Active
Viewed 637 times
1
-
2I don't think this is possible without resorting to the use of DLL imports. Of course, you could hope that by reading ChartIndicatorName on each indicator, you would get its short name containing all of its input parameter and then load those indicators using iCustom or other iXXX calls, but that's a lot to hope for. Not all custom indicator developers add all input parameters to the indicator's short name. – Enivid Jan 08 '21 at 19:08
-
This is a good question and I have the same problem. I don't think there is a good answer to this one---I thought maybe you'd have to parse the value returned by ChartIndicatorName to recover the name of the indicator and the parameters in order to call iCustom. That only works when the indicator has a properly formed short name and has an EX4 file found in the root indicator directory. And iCustom can't be used to find the labels, either. I've been looking and the data from a chart subwindow appears to be inaccessible from a script. Somebody else can prove me wrong by posting an answer. – user56983 Jul 26 '21 at 18:12
-
The other caveat is that if the indicator has an enumerated type used for a parameter that you might run into trouble detecting what that value is unless you have it hard coded into your script. – user56983 Jul 27 '21 at 02:00
-
If these indicators draw something on the chart and not use buffers, their values can be read. This is the only scenario where I would suggest using drawing tools on chart for indicators, instead of using the recommended buffers method. – Investing TS Nov 04 '21 at 13:57