Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Basket Close Manager - close a group of trades at a money or percent target, loss limit, trailing lock or set time - sistema esperto per MetaTrader 5

Parinya Aonpradit
Parinya Aonpradit
Hi, I'm Parinya, a solo MQL5 developer specializing in MetaTrader 5 Expert Advisors, custom indicators and utility scripts.
Visualizzazioni:
46
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

Many traders and EAs open several positions at once: grids, multi-symbol baskets, manual scaling in. What counts is the result of the whole group, not of each trade. Basket Close Manager is a small utility EA that closes the group as one.Basket Close Manager panel on the chart

How it works

Attach it to any one chart. It sums profit + swap of every matching position on every tick and once per second, and closes all of them when an exit is hit.

  • Basket: whole account or the chart symbol only, any magic number, manual trades only (magic 0) or one magic.
  • Optional commission per lot, so the targets are measured after costs.
  • Pending orders of the basket can be deleted at the same time.

Exits (each can be switched off)

  • Take profit in account currency and/or % of balance.
  • Loss limit in account currency and/or % of balance.
  • Trailing lock: after the basket reaches InpTrailStart, close it if it gives back InpTrailGive from its peak.
  • Close every day at HHMM and/or on Friday at HHMM (server time).

After a close

Keep watching new trades, pause until the next server day (any new matching trade is closed at once), or remove the EA from the chart.

Safe closing

  • If a basket symbol is in a closed session, the close waits until the market reopens instead of sending orders that fail.
  • Each position gets several close attempts; the panel shows "CLOSING" until the basket is flat.
  • The basket peak is kept in a terminal global variable, so restarting the terminal or VPS does not reset the trailing lock.
  • A push notification can be sent to the MT5 mobile app on every close.

Limits: the check runs on ticks and every second, so a fast move or a gap can pass a target before the close is filled. Keep that in mind when setting tight levels.

Inputs

Input Default Meaning
InpScope Whole account Whole account or chart symbol only
InpMagic -1 -1 = any, 0 = manual trades only, other = that magic
InpCommPerLot 0 Round-turn commission per lot added to the P/L
InpDelPending false Also delete matching pending orders on a close
InpTPMoney / InpTPPct 0 Take profit in money / % of balance (0 = off)
InpSLMoney / InpSLPct 0 Loss limit in money / % of balance, positive numbers (0 = off)
InpTrailStart / InpTrailGive 0 Trailing lock: start level and give-back, money (0 = off)
InpDailyHM / InpFridayHM 0 Time exits, server HHMM (0 = off)
InpAfter Keep watching Keep watching / pause until next day / remove EA
InpDeviation 50 Max slippage when closing (points)
InpRetries 3 Close attempts per position
InpPanel / InpPush true / false Chart panel / mobile push
InpDemoTrades false Strategy Tester only: random trades to watch the exits work

Try it in the Strategy Tester

Set InpDemoTrades = true, choose some exits (for example InpTPMoney = 30, InpSLMoney = 40, InpTrailStart = 15, InpTrailGive = 8) and run it in visual mode. The EA opens random trades so you can watch the basket being closed. In normal use it never opens a trade.

Tested in the MT5 Strategy Tester (XAUUSD H1, Sep–Oct 2026, demo trades): money and % targets, loss limits, trailing lock, daily and Friday time exits and the pause-until-next-day mode all closed the basket, with no failed close orders.

G7 Account Inspector Pro - Institutional Prop Firm Risk Auditor and Performance HUD G7 Account Inspector Pro - Institutional Prop Firm Risk Auditor and Performance HUD

Institutional on-chart account inspector, behavioral signature analyzer, EA vs manual breakdown, and prop firm drawdown auditor with 1-click HUD.

G7 FVG OB Confluence AutoTrader and Institutional SMC Dashboard G7 FVG OB Confluence AutoTrader and Institutional SMC Dashboard

G7 FVG OB Confluence AutoTrader is a professional Smart Money Concepts (SMC) Expert Advisor and on-chart analysis utility for MetaTrader 5. Engineered for Gold (XAUUSD), Forex, and Indices, it detects high-probability institutional setups where M15 Order Blocks (OB) and Fair Value Gaps (FVG) physically overlap. KEY CAPABILITIES: • Dual-Engine SMC Detection: Scans real-time 3-bar Fair Value Gaps and institutional impulse displacement Order Blocks. • Precision Confluence Matching: Filters out low-quality zones by requiring exact physical confluence between OB and FVG before triggering entries. • 6-Card AI Confidence Radar: Evaluates NY Zone Macro News, USD (DXY) correlation, liquidity sweeps, and confluence score (0-100%). • Interactive On-Chart Trader HUD: Adjust lot size, Stop Loss, and Take Profit directly on the chart without opening EA properties. • Prop Firm Guard: Built-in daily loss circuit breaker (-4.0%) and target lock to protect funded accounts.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.