Download MetaTrader 5

Chart.mqh lib

To add comments, please log in or register
Ocelot
24
Ocelot  

Hello everyone,

I recently discovered the Include libs in MT4 with such gems as Chart.mqh. I see that it gives MT4 access to the MT5 function, ChartIndicatorAdd(). Yay! So my question is, iCustom() in MT4 seems to work slightly differently than in MT5 and I'm having trouble figuring how to get the handle for a custom indicator to pass to ChartIndicatorAdd() so that my EA can automatically add it to my chart. Ideally I'd like to embed a custom indicator in my EA using the "resource" functionality and have the EA use the indicator settings set by the user after the indicator has been added to the chart. Is this possible, and can anyone point me to an example of this in use or have any general advice? Thank you all very much! 

whroeder1
15925
whroeder1  
ggladden: . I see that it gives MT4 access to the MT5 function, ChartIndicatorAdd().
  1. Not listed in List of MQL4 Functions - MQL4 Reference
  2. Only place even mentioned in MQL4 Reference in the example code in ChartSaveTemplate - Chart Operations - MQL4 Reference and that code is obviously not MQL4 code:
    h=iCustom(sym,tf,"Examples\\Zigzag"); Not MQL4 code
Ocelot
24
Ocelot  
whroeder1:
  1. Not listed in List of MQL4 Functions - MQL4 Reference
  2. Only place even mentioned in MQL4 Reference in the example code in ChartSaveTemplate - Chart Operations - MQL4 Reference and that code is obviously not MQL4 code:
    h=iCustom(sym,tf,"Examples\\Zigzag"); Not MQL4 code
Upon further inspection of the Chart.mqh lib I see that there is a check in there that does define ChartIndicatorAdd() for MT4, but it always returns false, looks like it was just a convenience wrapper so this lib wouldn't break in MT4. Back to the drawing board!
Alain Verleyen
Moderator
33339
Alain Verleyen  
ggladden:
Upon further inspection of the Chart.mqh lib I see that there is a check in there that does define ChartIndicatorAdd() for MT4, but it always returns false, looks like it was just a convenience wrapper so this lib wouldn't break in MT4. Back to the drawing board!
ChartIndicatorAdd() is not supported by mql4.
To add comments, please log in or register