MACD EA Levels

 

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

 
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);
}
 
nicholi shen:

I will give it a try thanx buddy..

Reason: