New free code from MQL5: indicators, EAs, and scripts for traders.
TradeCloserLib is a professional MQL5 library designed for automated trading systems, providing reliable functions to close open positions across single symbols, all symbols, or by magic number.
Key Features
ClosePositions(symbol): Closes all open positions for a specified symbol (or current chart symbol if none provided).
CloseAllPositions(): Closes positions across all symbols with open trades, collecting unique symbols first to avoid duplication.
CloseByMagic(magic): Targets positions by specific magic number, supporting multi-EA environments.

Protect profits effectively with the smart Trailing Stop Expert Advisor. Advanced trailing options for MT4/MT5. See it in action.
Level up your trading with professional RobotFX expert advisors and indicators. Visit www.robotfx.org for proven MT4/MT5 tools.
70966