Hi guys, I've found this video about how to code moving average crossover. I want to know why it needs the previous candle crossover (lastSlowMovingAv erage and lastFastMovingAverage variable in the video) to make the code works?
MQL4 Tutorial - Simple Moving Average Crossover Expert Advisor
- www.youtube.com
https://mql4tutorial.com With MQL4 for Metatrader you can program a Simple Moving Average Crossover Expert Advisor for automated trading. With a few lines of...
- CrossOver SMA Expert how to edit?
- Identifying Moving Average Candle crossover.
- Backtesting MA crossovers
A cross is an X, four end points.
double aPrev = …, aCurr = …, bPrev = …, bCurr = …; bool wasUp = aPrev > bPrev, isUp = aCurr > bCurr, isCross = isUp != wasUp;How would you test for a cross with two? Slow<Fast is considered an uptrend (one or many bars.) It isn't cross.
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