Download MetaTrader 5
To add comments, please log in or register
Publish your application in the Market - 7 million potential clients will see it
mpp
10
mpp 2011.05.17 14:52 

Hi everyone,

I'm doing an Expert Advisor to trade in EUR/USD but I'm facing some dificulties. I don't understand very much how can I read values from indicator buffers (I read the explanation in the mql5 documentation but it is not clear for me). For example, how can I access the values from macd indicator, the main line and the signal line?

Here is what I have:

int macd = 0;

(...)

macd = iMACD("EURUSD", PERIOD_M30, 12, 26, 9,PRICE_CLOSE);

(...)

ArraySetAsSeries(_macd, true);

(...)

if (CopyBuffer(macd,0,0,20,_macd) < 0){Print("CopyBufferMA1 error =",GetLastError());}

(...)

Now how can I acess the value from the main line and the signal line of macd indicator from the current bar?

Thanks.

Best regards,

Rui

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Indicators Lines
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Indicators Lines - Documentation on MQL5
Rashid Umarov
Admin
11710
Rashid Umarov 2011.05.17 16:34  
Have you seen the article How to call indicators in MQL5?

mpp
10
mpp 2011.05.17 17:49  
Rosh:
Have you seen the article How to call indicators in MQL5?

Hello,

Thanks for your answer.

Yes I had seen that article but it doesn´t show how can I access the value from an indicator like macd that has 2 values.

Rashid Umarov
Admin
11710
Rashid Umarov 2011.05.18 08:05  

Well, we have many articles. This is 20 Trade Signals in MQL5 where you can find several samples.
/
To add comments, please log in or register