Supertrend Rotation Pro is a simple, disciplined trend-following Expert Advisor for Gold (XAUUSD) on MetaTrader 5. It reads the Supertrend indicator and always follows its direction. When the Supertrend turns green, it closes any sell and opens a BUY. When it turns red, it closes any buy and opens a SELL. It works in trending and sideways markets alike, and it has no extra filters to tune.
On top of this rotation logic it adds strict profit protection (breakeven plus a tight trailing stop), your own trading hours, daily risk limits, and an advanced animated control panel with full chart marking.
HOW THE STRATEGY WORKS
The EA calculates the Supertrend (ATR-based, Wilder smoothing) on the timeframe you choose.
By default it uses closed candles only, so a signal does not appear and vanish while a candle is still forming. A forming-candle mode is available.
On a colour flip it closes the opposite position first, then opens the new one.
One direction is held at a time, so there is no grid, no martingale and no averaging.
You can also turn on Heikin-Ashi candles, which smooths the Supertrend further.
STRICT PROFIT PROTECTION
The EA aims to avoid giving back profit once a trade is working:
Breakeven: once the trade is in profit by the "breakeven trigger", the stop-loss moves to entry plus a small locked profit (the lock covers the spread).
Tight trailing: once profit reaches the "trail start", the stop-loss follows price at a very small distance behind it.
The stop-loss only ever moves in your favour and is never placed on the losing side of entry.
The stop-loss is set on the broker's server, so it stays active even if your terminal or internet disconnects.
Default values (USD price distance): breakeven trigger 0.40, lock 0.10, trail start 0.60, trail distance 0.25, step 0.05. All of them can be changed.
Optional re-entry: after a profitable trailing exit, the EA can re-enter at once in the same direction if the trend has not flipped. By default it waits for the next Supertrend flip.
Note: protection reduces the chance of a profitable trade turning into a loss, but it cannot guarantee it. Fast markets, spread widening and slippage can still cause small losses.
TRADING TIME CONTROL
Set your own start time, a "no new trade after" time, and a square-off time (all positions closed).
Choose which clock the times use: IST, broker server time, or your PC clock.
The time window can be switched off for 24-hour trading.
Defaults: start 09:00, last entry 23:00, square-off 23:30.
RISK CONTROLS
Fixed lot size, or risk-percent lot (needs a stop-loss distance), with a maximum lot cap.
Optional stop-loss and target, set as a USD price distance (0 turns them off).
Maximum trades per day.
Daily loss limit: the bot closes everything and stops for the day.
Daily profit target: the bot closes everything and stops for the day.
Maximum spread filter for new entries.
Slippage control.
After a stop-loss or target exit, the EA waits for the next Supertrend flip before trading again.
A margin check trims the lot size automatically if free margin is low.
ADVANCED ANIMATED CONTROL PANEL
The panel has four tabs and can be minimized:
DASHBOARD: trend banner with an animated arrow, bid price, spread, Supertrend level and gap meter, next-candle countdown, live position card (entry, price, SL, target, P&L), today's results with target and loss-limit progress bars, session progress bar, and a live event log.
PROTECTION: stage indicators (Armed, Breakeven, Trailing), a profit ladder showing where protection starts, live profit and locked-profit figures, and text boxes for all trailing values.
SETTINGS: text boxes for lot, stop-loss, target, max trades, daily loss, daily target, and all three times. The time window has an ON/OFF toggle. APPLY & SAVE keeps your values after a restart, and RESET TO INPUTS returns to the EA inputs.
LICENSE: enter your mobile number and license key, press ACTIVATE, and see the status and days left.
Always visible: live clock, account number with REAL/DEMO label, and PAUSE/RESUME and SQUARE OFF buttons.
CHART MARKING
Supertrend line in green or red, with BUY/SELL flip arrows.
Live Supertrend level.
Entry line and arrow, with a green or red profit/loss zone.
Stop-loss line, which flashes when it trails and shows the profit locked.
Target line, and the levels where breakeven and trailing begin.
Start, last-entry and square-off lines for today.
Today's closed trades drawn as dotted lines with their P&L.
A large status display at the top right of the chart.
Optional dark chart theme. Your original chart colours are restored when the EA is removed.
LICENSE
The EA is license-protected. Enter your mobile number and key in the License tab (or in the EA inputs). The license is verified online, rechecked every hour, and has a 6-hour offline grace period. If the license becomes invalid, open positions are closed and trading stops.
INSTALLATION AND SETUP
Copy the EA file to MQL5/Experts, then compile it or restart MT5.
In MT5, go to Tools > Options > Expert Advisors. Tick "Allow algorithmic trading", tick "Allow WebRequest for listed URL", and add: https://docs.google.com
Attach the EA to any chart. The "Symbol" input must match your broker's Gold symbol exactly (for example XAUUSD, XAUUSDm or GOLD).
Enter your license in the License tab and press ACTIVATE.
On a cent account, money inputs (daily loss, daily target, risk) are in cents.
RECOMMENDED USE
Test on a demo account first.
Default settings: M2 timeframe, ATR 10, multiplier 2.0, lot 0.01.
Run it on a VPS for continuous operation.
Choose a broker with low Gold spreads.
Use a lot size that suits your balance.
INPUT SUMMARY
Symbol, magic number, order comment
Supertrend: timeframe, ATR period, multiplier, Heikin-Ashi, signal on forming candle, enter at start
Lot: mode (fixed or risk percent), fixed lot, risk percent, maximum lot
SL / target in USD (0 = off)
Profit protection: on/off, breakeven trigger, lock, trail start, trail distance, step, re-entry after trail
Time control: window on/off, clock, start, last entry, square-off
Risk limits: max trades/day, daily loss, daily target, max spread, slippage
License: mobile number, key
Display: panel on/off, line on/off, bars drawn, chart marks, dark theme, panel position
IMPORTANT NOTES
By default no stop-loss is set, so a position stays open until the Supertrend flips, the stop-loss from trailing is hit, or a limit or square-off time triggers. You can set a stop-loss and target in the inputs if you want a fixed risk per trade.
Trend-following systems can suffer several small losses in choppy, sideways markets. Heikin-Ashi and a higher timeframe can reduce signal noise but also delay entries.
Results depend on your broker, spread, execution speed and settings. Backtest results may differ from live trading.
DISCLAIMER
Trading Gold and other leveraged instruments involves a high risk of loss and is not suitable for everyone. Past performance does not guarantee future results. This EA does not guarantee profit. Only trade with money you can afford to lose, and always test on a demo account first.
Supertrend Rotation Pro – XAUUSD Gold EA with Breakeven + Tight Trailing — Demo Video