Re: 🔺 MT5 XARD - Simple Trend Following Trading System

2206
Original indicator and EA are from the "Rijay's System of Moving Averages" thread".


Title: [COMPLETE] XU-MA v3 MOD_EN + EA

Indicator XU-MA v3 MOD_EN:

4 Colors: Represents 4 market states. The color tells you the current trend strength.

Thinner lines: Trend & Signal lines are thinner for better visibility.

Alerts: Disabled by default.

Reading the indicator: The color of the candle defines the state. Strong colors (green/red) indicate a strong trend, light colors indicate a retracement.

Note: On some pairs with low prices (e.g., EURUSD, AUDUSD), the indicator may draw vertical lines at trend changes. This is a known visual artifact and does not affect the EA – it reads only the color buffer.


EA XU-MA v3 MOD_EN EA:

Logic fix: Symmetric closing. EA closes the opposite position before opening a new one (no hedging).

Exit logic: EA closes positions on a weak candle (retracement – color 3 for BUY, color 4 for SELL). It also closes on a strong opposite signal.

Error handling: Eliminated [close order already exists] error (ignoring code 4756).

Last Resort Management: Full package – SL, TP, Trailing Stop, Breakeven, Money Management (3 modes), Trading Session, Close All Control.

Behavior: EA reacts to the current state of the closed candle. If it's a Strong Bull (color 0) or Strong Bear (color 2) at startup, it will open a position immediately.


How to run:

Place indicator in Indicators and EA in Experts.

Drag both onto the chart.

In EA settings, ensure InpIndicatorName is set to: XU-MA v3 MOD_EN.

EA uses magic 8888 (original used 777777 – they don't conflict).


stond