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ı

Close All Positions and Orders (Filtered) - MetaTrader 5 için komut dosyası

Görüntülemeler:
62
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

Close All (Filtered) is a script that closes open positions and deletes pending orders in one run. Filters let you close only what you mean to: for example only the losing sells of one EA, or only the profitable trades on the current chart.

Before doing anything, the script counts the positions and orders that match the filters and asks for confirmation. Positions that fail to close (requote, busy server) are retried, and the return code of every failure is printed in the Experts log. At the end a summary shows how many items were closed or deleted out of how many matched.

Confirmation before closing

Confirmation box before closing

Input parameters

  • Current chart symbol only - true: only the chart symbol, false: all symbols.
  • Magic number - -1 = any, 0 = manual trades only, any other value = that EA only.
  • Side - buys and sells, buys only, or sells only.
  • Which positions - all, only in profit, or only in loss (profit plus swap).
  • Close positions - enable or disable closing positions.
  • Delete pending orders - deletes matching pending orders; applied only when "Which positions" = All.
  • Ask for confirmation first - shows a Yes/No box with the number of items.
  • Retries - number of passes for positions that fail to close.
  • Max deviation - allowed slippage in points.

Input parameters

Input parameters

The script uses the standard CTrade class and works on both netting and hedging accounts. Algo Trading must be enabled in the terminal.

Range Compression Zones Breakout Range Compression Zones Breakout

Range Compression Zones Breakout draws range compression zones and marks breakouts that pass a higher-timeframe high/low filter and a volume filter. Inspired by the range compression idea in Domenico D'Errico's Accumulation/Distribution study (TASC, August 2018). Independent implementation, not a literal port of the published study.

Tick-Based Spread Distribution Profiler reads historical Bid/Ask ticks via CopyTicksRange Tick-Based Spread Distribution Profiler reads historical Bid/Ask ticks via CopyTicksRange

Tick-Based Spread Distribution Profiler reads historical Bid/Ask ticks via CopyTicksRange() and plots 24h spread percentiles (P50, P90, P99) in a separate subwindow. Key Features: - True Tick Percentiles: Plots Median (P50 histogram), P90 (orange line), and P99 (red dotted line) in points for every server hour (00-23h). - Unbiased Reservoir Sampling: Samples multi-week history within InpMaxSamplesPerHour without biasing early days. - Closed-Bar Friction Ratio: Uses closed-bar iATR (shift=1) to show Spread_P50 / ATR (%) and spot low-friction hours. - Clean Subwindow HUD: Displays global/current-hour stats and best/worst hours, with zero log spam and full OnDeinit() cleanup. - Optional CSV Export: Exports 24h Min/P50/P90/P99/Max stats to MQL5\Files\SpreadProfile_<Symbol>.csv. Inputs: InpLookbackDays (14), InpMaxSamplesPerHour (50000), InpAtrTimeframe (M15), InpAtrPeriod (14), InpRefreshMinutes (60), InpShowSummaryHUD, InpExportCSV.

Candle Timer and Spread Candle Timer and Spread

Shows the time left until the current candle closes and the live spread in any chart corner. Keeps counting every second, even when no ticks arrive.

Lot Size Calculator - Risk Percent to Lots Lot Size Calculator - Risk Percent to Lots

Calculates the correct lot size from your risk (% of balance, % of equity or a fixed amount) and stop-loss distance. Shows actual risk and margin. Never places trades.