Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Facebook üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Komut dosyaları

One-Click Close All Positions with Slippage Guard - MetaTrader 5 için komut dosyası

Gerardo Lopez Martinez
Gerardo Lopez Martinez
  • Algorithmic Trading & Prop Firm Risk Systems at  Institutional MQL5 Developer
  • Meksika
  • 614
Profesyonel MQL5 & C# Algoritmik Ticaret Geliştiricisi | Kurumsal Yürütme ve Risk Sistemleri
Görüntülemeler:
104
Derecelendirme:
(1)
Yayınlandı:
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

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.