MACD EA Levels

To add comments, please log in or register
cavemann
19
cavemann  

Hi Guys,

How can i display the macd open and close level values on a chart. Could someone give me an example of code to enter into the ".mq4" to achieve this..


Rgards

nicholi shen
2176
nicholi shen  
cavemann:

Hi Guys,

How can i display the macd open and close level values on a chart. Could someone give me an example of code to enter into the ".mq4" to achieve this..


Rgards

#property strict

void OnTick()
{
   Comment(StringFormat(
      "MACD open = %.5f\nMACD close = %.5f",
      macd(PRICE_OPEN),
      macd(PRICE_CLOSE)
   ));
}

double macd(ENUM_APPLIED_PRICE mode, int index=0)
{
   return iMACD(_Symbol, PERIOD_CURRENT, 12, 26, 9, mode, 0, index);
}
cavemann
19
cavemann  
nicholi shen:

I will give it a try thanx buddy..

To add comments, please log in or register