Two moving averages on Gold (XAUUSD), forex or any symbol: when the fast one crosses the slow one on a closed bar, the EA opens one position in the direction of the cross. Default is EMA 20 and EMA 50 on the close price, and method and price can be changed.
The trade has a stop loss and a take profit in points from the entry, and the opposite cross closes it if it is still open. An optional breakeven moves the stop to the entry plus a small offset once the trade is far enough in profit. The lot is fixed, or calculated so the stop costs a chosen percent of balance or equity.
A crossover system gives many small losses in a range and a few longer runs in a trend. That is how it works, not a defect. Test it on your broker with real ticks before any live money.
Strategy
Lot settings
Close / Exit
Risk protection
Filters
Expert settings
Run your own backtest on XAUUSD, EURUSD, GBPUSD, US30 and NAS100 on M15, H1 and H4, and compare EMA 20/50 against 9/21 or 50/200. Turn on the time filter for the London and New York hours on gold, or add a news filter. The signal function is a few lines and can be replaced with any rule you want, for example a Smart Money Concepts break of structure or a support and resistance level, and the lot, margin check, breakeven and position count functions can be copied into another EA as they are. To manage the stop of any position, see my Trailing Stop Breakeven Manager.
Open source. Use it as it is, adapt it, build your own version on top of it.
New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander
Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01
More tools on my profile: https://www.mql5.com/en/users/09151993a
Provided as is, use at your own risk.
Auto Fibonacci Retracement Swing Levels
Auto Fibonacci retracement for Gold (XAUUSD), forex and any symbol: draws the levels on the last completed swing leg by itself, with the 61.8 in its own colour, prices on each level and an optional alert. Open source code.
Forex Session Boxes London New York Asia
Forex session boxes for Gold (XAUUSD), forex and any symbol: draws the Asian, London and New York sessions with their high and low extended to the right and the range in points, in your broker server time. Open source code.
Accelerator Oscillator (AC)
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.
MACD Signals
Indicator edition for new platform.