Compare Momentum to MACD

 

Hello Community :)

This is my first Topic here so i come for help .. I know there are some guys here who are very advanced .

The problem i face is i couldn't compare if Macd main/signal line is above/below Momentum .

1st 

 

I can't write .. "if(iMomentum>iMACD) " Because as you know each indicator has its own calculations .. As we see in the above picture we can know if Momentum is bigger/lower than MACD , But in MQL4 how ?? 

 
No body answers .. come on guys give it a try :p
 

  • Show the code you wrote.
  • Read documentation on iMacd() and iMomentum(). You will find examples there. 

 
drazen64:

  • Show the code you wrote.
  • Read documentation on iMacd() and iMomentum(). You will find examples there. 

I know how to code an EA using Indicators .. That's not the problem 

The problem here is how to compare MACD values to Momentum values 

You can't say for example if (macdsignal>momentumsignal) . Simply because Momentum has its own calculation which is completely different than MACD calculations :) . 

 

Try to make a BUY order open when Momentum crosses Signal line of MACD . 

Note : Momentum and MACD are applied to Close Price . none of them is applied to x Indicator's Data .

As we are programmers .. We shouldn't stop at any problem we face during coding , Because we may face the same problem many times again and then we never grow up our skills .

We should find a solution for this and take it as a challenge . 

ps

 
Hey mate, so, did you find the solution for this? 😅
 
Sad this seems unanswered. 
 
Retin Obi #: Sad this seems unanswered. 

The reason it was not answered is because the question is nonsensical and it is even admitted by the OP, and I quote ...

"You can't say for example if (macdsignal>momentumsignal) . Simply because Momentum has its own calculation which is completely different than MACD calculations :)"

The two indicators are simply not compatible. They have completely different scales. They cannot be compared and you cannot detect crosses between the two. Doing so is nonsensical and a "fool's errand".