Trade manager · MT5

Gold Basket Guard

by umberlla19733

Gold Basket Guard is an open-source position manager for MetaTrader 5, designed primarily for trading gold (XAUUSD).

GitHub stars1
Forks0
Last update10 days ago29 Oct 2026
LicenceNone stated

Overview

Gold Basket Guard monitors open positions across specified symbol filters and magic numbers, automatically applying and synchronizing group take profit and stop loss levels. The EA provides break-even functionality based on group pips, monetary targets, or equity percentage, moving stop losses to lock in gains or closing partial positions. It also includes multi-mode trailing stop functionality, news filtering options, and an emergency account risk protection system that can close all positions. It does not open new trades independently.

Details

Author

umberlla19733 on GitHub

Markets

Gold

Timeframes

Any timeframe

Risk Profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Input Parameters

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

NameTypeDefaultDescription
InpMagicFilterlong0Magic filter (0 = all magics of this symbol)
InpOnlyThisChartSymbolbooltrueOnly positions of the chart symbol
InpSymbolsFilterstringExtra symbol whitelist, comma separated (empty = off)
InpCommentFilterstringPosition comment contains (empty = off)
InpIncludeBuybooltrueInclude BUY positions
InpIncludeSellbooltrueInclude SELL positions
InpOnlyAfterAttachboolfalseManage only positions opened after EA attach
InpIgnoreManualTicketsboolfalseIgnore tickets with empty comment (manual trades)
InpApplyModeENUM_APPLY_MODEAPPLY_SAME_LEVELHow TP/SL is distributed over tickets
InpSLPipsdouble300.0Group SL distance, pips (0 = do not set)
InpTPPipsdouble500.0Group TP distance, pips (0 = do not set)
InpOverwriteExistingbooltrueOverwrite SL/TP already present on a ticket
Show all 40 inputs
NameTypeDefaultDescription
InpAutoApplyToNewbooltrueAuto-apply to every newly opened position
InpAutoApplyOnStartbooltrueApply group TP/SL to existing positions at startup
InpReapplyEveryCyclebooltrueKeep the levels glued every cycle: nothing to press by hand
InpAbsSLPricedouble0.0Absolute group SL price (0 = use pips)
InpAbsTPPricedouble0.0Absolute group TP price (0 = use pips)
InpMirrorSLbooltrueIf I edit SL on one ticket -> apply to all
InpMirrorTPbooltrueIf I edit TP on one ticket -> apply to all
InpMirrorModeENUM_APPLY_MODEAPPLY_SAME_LEVELMirror as: same price / same distance
InpMirrorGuardMsint250Max ms to wait for the echo of our own modify
InpBeModeENUM_BE_MODEBE_BASKET_PIPSRisk-free trigger
InpBeTriggerPipsdouble200.0Trigger: pips in profit (ticket/basket modes)
InpBeTriggerMoneydouble300.0Trigger: group profit in money (account ccy)
InpBeTriggerPctEquitydouble2.0Trigger: group profit % of equity
InpBeLockPipsdouble10.0Lock: how many pips beyond entry (can be 0)
InpBeLevelENUM_BE_LEVELBELVL_OWN_ENTRYWhere to put the SL
InpBeOnlyIfProfitablebooltrueSkip tickets that are still losing
InpBeOneShotbooltrueDo it once per ticket (never touch SL again)
InpBeClosePartialboolfalseAlso close part of the group at trigger
InpBeClosePartialPctdouble30.0% of group volume to close
InpBeUseHardTpInsteadboolfalseMove TP to lock instead of SL (no SL change)
InpTrailModeENUM_TRAIL_MODETRAIL_STEPTrailing mode
InpTrailStartPipsdouble250.0Start trailing after N pips in profit
InpTrailStepPipsdouble30.0Step: lock N pips each time (STEP mode)
InpTrailDistPipsdouble120.0Fixed distance behind price (FIXED mode)
InpTrailMinPipsdouble40.0Min distance to price (LINEAR mode)
InpTrailCoefPctdouble25.0Shrink coef % of extra profit (LINEAR)
InpTrailMaxPipsdouble200.0Max distance cap (LINEAR mode)
InpTrailFollowGroupbooltrueTrigger trailing on group avg, not per ticket

How to Install It

  1. 1Download the sourceUse "Download source (.zip)" above, or clone umberlla19733/my-new-trading-system 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

70 stars

This MetaTrader expert advisor functions as a trade manager that automates stop loss adjustments for existing positions. It specifically waits until a trade reaches a user-defined profit threshold in points before initiating a trailing stop. The tool includes flexible filtering options to manage specific symbols, magic

MT4MT5 Trade manager
Updated 5 months ago Apache-2.0 GitHub repository of Trailing Stop On Profit

Trader Pad

by erlonfs
20 stars

Trader Pad is a trade management utility for MetaTrader 5 designed to automate position exits and risk control after an entry is initiated. The software handles stop-loss and take-profit placement in ticks, providing advanced trailing stop logic and break-even functionality. It allows users to scale out of positions th

MT5 Trade manager
Updated 4 years ago MIT GitHub repository of Trader Pad

ATR Trailing Stop

by EarnForex
19 stars

This trade manager for MetaTrader 4 and 5 automatically adjusts the stop-loss levels of open positions using the Average True Range indicator. It allows users to define the trailing distance through a configurable ATR period and multiplier. The expert advisor includes filtering logic to apply the trailing stop only to

MT4MT5 Trade manager
Updated 7 months ago Apache-2.0 GitHub repository of ATR Trailing Stop

Smart Money Manager

by Royatvand
19 stars

Smart Money Manager is a trade-management panel for MetaTrader 5. It assists traders by calculating risk-based position sizing from balance, stop-loss distance, and tick value. Users place market and pending orders via a compact on-chart panel with drag-and-drop entry, SL, and TP lines that display lot size and money r

MT5 Trade manager

PSAR Trailing Stop

by EarnForex
16 stars

PSAR Trailing Stop is a management utility for MetaTrader 4 and 5 that automates the adjustment of stop-loss levels for open positions. Instead of manual movement, it follows the Parabolic SAR indicator values to lock in profits or minimize losses as a trend progresses. The software includes filtering options to target

MT4MT5 Trade manager
Updated 2 years ago Apache-2.0 GitHub repository of PSAR Trailing Stop

Fractals Trailing Stop

by EarnForex
15 stars

This expert advisor is a utility for MetaTrader 4 and MetaTrader 5 designed to manage stop-loss levels for existing trades. It utilizes Bill Williams' Fractals indicator to dynamically adjust the stop loss as new fractal points form on the chart. Users can configure the number of bars to scan and specify which fractal

MT4MT5 Trade manager
Updated 2 years ago Apache-2.0 GitHub repository of Fractals Trailing Stop

More trade managers

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