Download MetaTrader 5

retrieving iMA information

To add comments, please log in or register
Add our Twitter channel to friends and follow the news!
chc58
18
chc58 2016.11.14 15:35 

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.

Marco vd Heijden
Moderator
4704
Marco vd Heijden 2016.11.14 15:52  
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
Alain Verleyen
Moderator
30739
Alain Verleyen 2016.11.14 15:52  
mql4 or mql5 ?
chc58
18
chc58 2016.11.14 22:01  
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.
chc58
18
chc58 2016.11.14 22:03  
On first glance, that is exactly what I was looking for but didn't know how to find.  Thank you
whroeder1
14514
whroeder1 2016.11.14 22:15  
chc58 ... sorry for the oversight.  It is for MT4,
Next time post in the MQ4 forum.
chc58
18
chc58 2016.11.14 22:52  
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.
chc58
18
chc58 2016.11.14 23:13  
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.
Alain Verleyen
Moderator
30739
Alain Verleyen 2016.11.15 08:20  
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.

To add comments, please log in or register