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 box before closing
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 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() and plots 24h spread percentiles (P50, P90, P99) in a separate subwindow.
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
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.