retrieving iMA information

 

I have hunted hi and lo, but I cannot find anywhere that can guide me in how to programatically pull off a chart the MA value of a manually added MA.  I can easily get it if I know what the period etc is just using the iMA function, but how can you search a chart for MAs and then check their current values?

 Most grateful if anyone can point in the direction of where to find the answer.

 
Documentation on MQL5: Chart Operations / ChartIndicatorName
Documentation on MQL5: Chart Operations / ChartIndicatorName
  • www.mql5.com
Chart Operations / ChartIndicatorName - Reference on algorithmic/automated trading language for MetaTrader 5
 
mql4 or mql5 ?
 
Alain Verleyen:
mql4 or mql5 ?
Good Q ... sorry for the oversight.  It is for MT4, but I believe that is now using MQL5 too.  Will go and check the links now though.  Much appreciated.
 
On first glance, that is exactly what I was looking for but didn't know how to find.  Thank you
 
chc58 ... sorry for the oversight.  It is for MT4,
Next time post in the MQ4 forum.
 
MT4 (Ver 4.00 Build 1010) doesn't seem to like the handle=ChartIndicatorGet(0,w,name) call in the example.  Is this an MT5 only function or is there an error in the example?  It also doesn't like the IndicatorRelease(handle) call.  I am assuming they are related issues (especially as they get and then use 'handle').  I can see the periods of the MA in the name, but cannot get the other parameters (Exponential/Smoothed etc, OHLC price used etc), or should I be using the iCustom function to grab the data off the indicator using the returned name?  Much appreciate your help.  I really like MQL, but it is taking some learning ... Thank you for your patience.
 
whroeder1:
Next time post in the MQ4 forum.
I have just realised that the two are different.  I was (obviously mistaken) that the MQL codes had merged and the MQL4 forum shifted to a unified one.  Sorry, but thank you for your help anyway.
 
chc58:
MT4 (Ver 4.00 Build 1010) doesn't seem to like the handle=ChartIndicatorGet(0,w,name) call in the example.  Is this an MT5 only function or is there an error in the example?  It also doesn't like the IndicatorRelease(handle) call.  I am assuming they are related issues (especially as they get and then use 'handle').  I can see the periods of the MA in the name, but cannot get the other parameters (Exponential/Smoothed etc, OHLC price used etc), or should I be using the iCustom function to grab the data off the indicator using the returned name?  Much appreciate your help.  I really like MQL, but it is taking some learning ... Thank you for your patience.

These functions are working with mql5 only.

There is no simple way to do what you want with mql4, you will need to find some workarounds.