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

One-Click Close All Positions with Slippage Guard - script per MetaTrader 5

Gerardo Lopez Martinez
Gerardo Lopez Martinez
  • Algorithmic Trading & Prop Firm Risk Systems al  Institutional MQL5 Developer
  • Messico
  • 631
Sviluppatore Professionale MQL5 & C# per il Trading Algoritmico | Esecuzione Istituzionale & Gestione del Rischio
Visualizzazioni:
144
Valutazioni:
(1)
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

One-Click Close All Positions with Slippage Guard is a fast execution utility script for MetaTrader 5 that closes open positions safely while protecting against abnormal spreads and excessive slippage.

How it works:

  • Iterates backwards through open positions and filters by scope, optional Magic Number, and live spread before sending close orders via CTrade .
  • Automatically retries transient broker errors (REQUOTE , PRICE_CHANGED , PRICE_OFF , TIMEOUT , CONNECTION ) and prints a complete execution summary in the Experts log and an Alert popup.

Input Parameters:

  • InpCloseScope (default: CLOSE_ALL_SYMBOLS) — Filter mode: All Symbols, Current Symbol Only, Profitable Positions Only, or Losing Positions Only.
  • InpMagicFilter (default: -1) — Optional Magic Number filter (-1 closes positions from any Magic Number).
  • InpClosePending (default: false) — If true , also deletes matching pending orders.
  • InpMaxSlippagePts (default: 30) — Maximum allowed slippage deviation in points passed to CTrade .
  • InpMaxSpreadPts (default: 0) — Maximum spread in points allowed to close a position (0 disables spread filtering).
  • InpMaxRetries (default: 3) — Maximum retry attempts on transient requotes or price changes.
  • InpRetryDelayMs (default: 100) — Delay in milliseconds between retry attempts.


One-Click Close All Positions with Slippage Guard


Tick Volume Delta Histogram (Buy/Sell Pressure Estimate) Tick Volume Delta Histogram (Buy/Sell Pressure Estimate)

Estimates buy/sell pressure by splitting the tick volume of every bar into a buy part and a sell part. The difference (delta) is shown as a four-color histogram with an optional EMA line.

Session VWAP with Standard Deviation Bands Session VWAP with Standard Deviation Bands

Session-anchored VWAP with volume-weighted standard deviation bands. It restarts at every daily, weekly or monthly session open and shows how far price has stretched from the average price paid during the session.

Spread and Tick Velocity Monitor Spread and Tick Velocity Monitor

Lightweight real-time HUD for MetaTrader 5 that monitors live spread (points and pips), session Min/Avg/Max spread, and tick arrival velocity (ticks/sec and ticks/min) with automatic market regime classification.

Giano Session Range Breakout EA Giano Session Range Breakout EA

Night session range breakout for XAUUSD: one decision per day, a hash-chained journal written before every order, and safe recovery after restarts.