- Show the code you wrote.
- Read documentation on iMacd() and iMomentum(). You will find examples there.
- 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 .
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".
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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 .
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 ??