I am desperately looking for a simple piece of code that works just for moving average crossover.
All the mql4 code I find on the internet is crappy and not working.
“Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless. How To Ask Questions The Smart Way. 2004 When asking about code
Look for a cross.
double aPrev = …, aCurr = …,
bPrev = …, bCurr = …;
bool wasUp = aPrev > bPrev,
isUp = aCurr > bCurr,
isCross = isUp != wasUp;
Thanks for your message.
I had a solution here Indicator not displaying new alerts - Trend Indicators - MQL4 and MetaTrader 4 - MQL4 programming forum (mql5.com)
Please enable the necessary setting in your browser, otherwise you will not be able to log in.