The cross happens when the histogram (Osma) goes above zero or below zero.
https://forum.mql4.com/47496
WHRoeder:
You didn't try very hard. Get the two current buffer values and the previous bar buffer values via iMACD and look if they've crossed.
You didn't try very hard. Get the two current buffer values and the previous bar buffer values via iMACD and look if they've crossed.
Hello WHRoeder
Thank you for reply but I am not sure if I got your idea.
iMACD syntax is:
iMACD( | string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift) |
but mode only gives the options:
Constant | Value | Description |
---|---|---|
MODE_MAIN | 0 | Base indicator line. |
MODE_SIGNAL | 1 | Signal line. |
where I though "Signal Line" was the line drawn and "Base Indicator Line" was the histogram.
Now I see that none of them are the histogram but the two lines on my example picture.
Thank you, your comment helped me understand better

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello
I am amaterur on Forex and on MQL4 programing and I will apreciate all help I can get.
I am writing EA code for a strategy that uses MACD/OsMA (FEMA: 12, SEMA: 34, MACD SMA: 9 at Close) as a TakeProfit indicator on the event that the two lines that MACD/OsMA draws cross (red and green on attached picture).
I was looking for any function on MT4 (similar to iMA, iMACD, etc) that can tell me when this crossing event happen but I can not find it.
Looking for an alternative, I am trying to understand what each of those two lines represent (red and green on attached picture) hoping it might be a simple math calculation (a similar description as for MACD that says "The MACD calculation subtracts the 26-period from the 12-period to create a single line. This is known as the main line.", or something similar) so I can make my EA to calculate this crossing event.
Hope anyone can help.
Thank you