Copier & bridge · MT5

GuardRails

by jobmwitah

GuardRails is a MetaTrader 5 trade management and execution system that pairs an MQL5 EA bridge with a self-hosted Python FastAPI backend and Discord bot.

High risk

GitHub stars1
Forks0
Last update10 days ago14 Nov 2026
LicenceNone stated

Overview

GuardRails executes trades requested via Discord commands and runs built-in multi-strategy portfolio EAs. The system enforces strict risk controls, including hardcoded daily loss limits, maximum open position caps, fixed percentage risk per trade, and peak drawdown protection. It features automated position sizing, stop-loss and take-profit calculations, and live alerts for fills and risk breaches.

Details

Author

jobmwitah on GitHub

Strategy

Breakout, Trend following, Multi-strategy, Martingale

Markets

Forex, Gold, Crypto, Indices

Timeframes

M15-H1

Risk Profile

  • Uses martingale lot scaling: losses can grow fast

Input Parameters

Read from MetaEq.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
GlobalBaseMagicint100000Base magic number (S1 = +1000.., S2A = +2000.., S2B = +4000.., S3 = +3000..)
GlobalCommentstringMotherEAComment written on every trade
GlobalPreventOverlapbooltrueBlock the strategies from both going long on the same symbol
GlobalUseFixedBalanceboolfalseSize S2A/S2B risk on a fixed balance (non-compounding, for testing)
GlobalFixedBalancedouble100000.0Fixed balance used when the option above is on
GlobalRandomSeedint0RNG seed for the randomizers (0 = time-based, fixed value reproduces tests)
GlobalMaxDailyDDPercentdouble0.0Max daily drawdown % of day-start equity (0 = off)
GlobalMaxTotalDDPercentdouble0.0Max total drawdown % from peak equity (0 = off)
GlobalMaxOpenPositionsint0Max open positions across all strategies (0 = no limit)
S1_EnabledbooltrueS1: enabled
S1_SymbolsstringCURRENTS1: symbols (pipe separated, CURRENT = chart symbol)
S1_TimeframesstringM15S1: confirmation timeframe per symbol (pipe separated)
Show all 40 inputs
NameTypeDefaultDescription
S1_ATR_Periodint5S1: ATR period (Daily)
S1_ATR_Multiplierdouble0.25S1: ATR multiplier for breakout levels
S1_Stop_ATR_Multiplierdouble0.25S1: ATR multiplier for stop loss
S1_Use_Candle_ClosebooltrueS1: require candle close confirmation
S1_ATR_Short_Periodint1S1: short-term ATR period (Daily)
S1_ATR_Long_Periodint5S1: long-term ATR period (Daily)
S1_ATR_Regime_Factordouble1.0S1: regime factor
S1_Regime_Filter_ModeENUM_REGIME_MODEREGIME_LOW_VOLATILITYS1: regime filter mode
S1_Trade_DirectionENUM_TRADE_DIRECTIONTRADE_BOTHS1: allowed trade direction
S1_Reverse_ModeboolfalseS1: reverse mode (fade the breakout)
S1_Fixed_Risk_Amountdouble500.0S1: fixed risk amount (account currency)
S1_Entry_Timestring16:30S1: entry window start (HH:MM, server time)
S1_Max_Entry_Timestring18:05S1: latest entry time (HH:MM, server time)
S1_Exit_Timestring22:55S1: close all positions time (HH:MM, server time)
S1_EnableRandomizationboolfalseS1: randomizer master switch (OFF = exact original behavior)
S1_RandomDelayMaxSecdouble0.0S1: max random entry delay, seconds (0 = immediately)
S1_RandomVolumeJitterPctdouble0.0S1: volume jitter +/- percent (0 = off)
S1_RandomSlJitterPointsdouble0.0S1: SL distance jitter +/- points (0 = off)
S2A_EnabledbooltrueS2A: enabled
S2A_SymbolsstringBTCUSD|XAUUSD|USDJPYS2A: symbols (pipe separated, ALL or CURRENT)
S2A_TimeframesstringCURRENTS2A: timeframe per symbol (pipe separated, CURRENT = chart timeframe)
S2A_EMALengthint200S2A: EMA length
S2A_BreakoutBarsint3S2A: breakout bars
S2A_StopLossBarsint5S2A: stop loss lookback period
S2A_RiskPerTradedouble0.01S2A: risk per trade as a fraction of equity (0.01 = 1%)
S2A_AllowMultiplePositionsbooltrueS2A: enable pyramiding (multiple positions per symbol)
S2A_MaxPositionsint5S2A: maximum positions per symbol
S2A_EnableRandomizationboolfalseS2A: randomizer master switch (OFF = exact original behavior)

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone jobmwitah/GuardRails from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar Expert Advisors

47 stars

This repository contains a diverse collection of MetaTrader 5 expert advisors ranging from RSI-based scalping robots to multi-timeframe trend following systems. The EAs utilize various technical indicators including EMA crossovers, MACD momentum, and ATR for volatility-based exits. The core logic often incorporates mul

MT5 Collection ScalpingTrend followingBreakout High risk
Updated 4 months ago Custom licence GitHub repository of Frontline MT5 Strategy Collection

Nolo Trading Bot

by festomanolo
4 stars

This expert advisor for MetaTrader 5 is a multi-strategy system that utilizes market regime detection to switch between trend following, range trading, and breakout modes. It incorporates a wide array of technical indicators, including Moving Averages, RSI, MACD, Ichimoku, and SuperTrend. The bot manages risk through v

MT5 Trading robot Trend followingMean reversionBreakout High risk
Updated 8 months ago MIT GitHub repository of Nolo Trading Bot
2 stars

This collection for MetaTrader 5 provides several automated Expert Advisors designed for various symbols including forex, gold, and indices. The repository features Mecha Godzilla, a grid trading system using ATR-based spacing and bidirectional orders, alongside specialized bots for Asian session breakouts and H4 trend

MT5 Collection GridBreakoutTrend following High risk

Gold Adaptive Multi Regime EA

by cdimabusinessent-byte
1 stars

This MetaTrader 5 expert advisor is designed for gold trading using an adaptive, modular architecture. It features a regime detector that switches between trend-following, mean reversion, and breakout strategies based on market conditions. The system utilizes exponential moving averages, ADX for trend strength, and RSI

MT5 Trading robot Trend followingMean reversionBreakout High risk
Updated 6 months ago None stated GitHub repository of Gold Adaptive Multi Regime EA

Smart Trader 7CAS

by andersonclement
1 stars

Smart Trader 7CAS is an automated trading robot for MetaTrader 5 designed specifically for commodities including Gold, Silver, and Oil. It implements seven distinct trading modules or scenarios covering trend following, scalping, range trading, breakouts, Smart Money Concepts, reversals, and Fibonacci levels. The syste

MT5 Trading robot Multi-strategySMC / ICT / price actionTrend following High risk
Updated 3 months ago None stated GitHub repository of Smart Trader 7CAS

The Gold Reaper

by naming1086
1 stars

The Gold Reaper is a multi-strategy expert advisor for MetaTrader 4 and 5. It trades gold pairs using breakout and reversal entries based on fractals and ATR. Trades enter when spread and frequency conditions are met and exit via trailing stops or time-based rules. The EA includes NFP filters to pause during economic e

MT4MT5 Trading robot BreakoutTrend followingScalping High risk
Updated 2 months ago None stated GitHub repository of The Gold Reaper

More copiers and bridges

Related on ForexR

Need a Broker for MT5?

Compare regulated brokers that support MT5, with spreads, minimum deposits and leverage side by side.

Compare MT5 brokers