Trend Friend Gold is a fully automated channel breakout Expert Advisor for MetaTrader 5, non-martingale strategy designed to take the emotion out of trading by following a disciplined. Trend-following breakout strategy specifically for Gold (XAUUSD). At the open of every new candle it measures the recent price channel, waits for a valid confirmed breakout in either direction, and enters a trade with precision — managing it automatically from entry through to exit with a configurable trailing stop, break-even protection, and daily risk limits.
Every feature was built with live execution in mind. The EA respects broker stop levels and dynamic spreads automatically, checks available margin before placing any order.
HOW IT WORKS
At the open of each new candle, the EA reads the highest high and lowest low of the previous bars to define the current price channel. If price closes above the channel high by a configurable confirmation buffer, a Buy order is placed. If price closes below the channel low by the same buffer, a Sell order is placed. Only one position per EA instance is allowed at any time. Once a trade is open, it is managed through a configurable Stop Loss, Take Profit, break-even move, and — if enabled — a step-by-step trailing stop that advances the SL as price continues in your favour. The EA also enforces daily profit and loss limits, automatically pausing new entries for the rest of the day once either threshold is reached.
KEY FEATURES
Channel Breakout Entry — identifies the high/low channel and enters only on a confirmed breakout with a configurable point buffer, filtering out noise and false moves. Break-Even Protection — once the trade reaches a set profit distance, the stop loss is automatically moved to the entry price, eliminating open risk. Smart Trailing Stop — advances the Stop Loss step-by-step as price moves in profit. Configurable activation distance and step size. Daily Risk Limits — configurable daily Stop Loss and Take Profit in dollars. The EA pauses all new entries for the rest of the day the moment either limit is hit, then resets automatically on the next trading day. Spread Filter — blocks new entries when live spread exceeds a configurable maximum. Existing positions continue to be managed regardless. Broker-Safe Execution — respects STOPS_LEVEL on every order modification. Trailing stop and break-even logic always include a safety margin above the broker minimum. Margin Check — verifies free margin before placing any order. Skips the trade if margin is insufficient rather than failing at execution. Session Time Filter — restricts new entries to a configurable hourly window. Open positions continue to be managed outside trading hours. One Trade at a Time — a position gate prevents multiple entries from stacking on the same symbol and magic number. Live On-Chart Dashboard — compact panel showing Daily P&L, Balance, Equity, live Spread, Total Trades, Win Rate, Session status, and EA state — all colour-coded for instant reading. Multi-EA Isolation — configurable magic number so multiple instances can run on different symbols or timeframes simultaneously.
RECOMMENDED SETUP Timeframe: H1 or Higher Pair: XAUUSD (Gold) Recommended brokers: VT MARKETS or a broker with ECN/RAW/LOW spread type 2 decimal price quota for GOLD
Account type: Hedging Minimum balance: $500 (recommended $1,000+) VPS: strongly recommended for 24/5 uptime
INPUT PARAMETERS --- RISK & EXECUTION --- InpMagicNumber — Unique magic number to identify this EA's orders. Change this when running multiple instances. Default: 888. InpLotSize — Fixed lot size per trade. Default: 0.1. InpMaxSpread — Maximum allowed spread in points. New entries are blocked above this level. Default: 30. InpTakeProfit — Take Profit distance in points from the entry price. Default: 500 (5 to 1 RR). InpStopLoss — Stop Loss distance in points from the entry price. Automatically raised to the broker minimum if the input is too tight. Default: 100 (5 to 1 RR).
--- TRAILING & PROTECTION --- InpUseTrailing — Enable or disable the trailing stop feature. Default: true. InpTrailingStart — Minimum profit in points before the trailing stop activates. Default: 50. InpTrailingStep — Minimum price improvement in points required before the SL is advanced. Prevents excessive modification calls to the broker. Default: 30. InpBreakEven — Profit distance in points at which the stop loss is moved to the entry price, removing all open risk from the trade. Default: 40.
--- DAILY RISK LIMITS --- InpDailyTakeProfit — Stops new entries once cumulative daily profit reaches this dollar amount. Set to 0 to disable. Default: 0.0 (unlimited). InpDailyStopLoss — Pauses the EA for the rest of the day once cumulative daily loss reaches this dollar amount. Set to 0 to disable. Default: 50.0.
--- SESSION TIME FILTER --- InpUseTimeFilter — Enable or disable the trading session window. Position management remains active outside the window. Default: true. InpStartHour — Broker server hour (0–23) when the EA begins placing new orders. Default: 2. InpEndHour — Broker server hour (0–23) when the EA stops placing new orders. Default: 22.
--- DASHBOARD --- InpShowDashboard — Show or hide the on-chart information panel. Default: true.
Note:
- Always test on a demo account first to understand the EA's behaviour before going live.
- This EA does not need any file set to run, just make sure it runs on 2 digit broker.
- Get user manual settings guide inside our Telegram group.