nClose Orders - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources


One feature in MetaTrader 5 performs 14 trade management tasks.
Close positions and delete pending orders by filtering by type, profitability and magic number.
All positions/only profitable positions/only losing positions
Only buy/only sell
Buying is profitable/Buying is unprofitable
Selling profit/selling loss
All pending orders/Buy Stop only/Buy Limit only
Sell Stop Only/Sell Limit Only
// Example of calls: Close order ( "position" , "all" , 0 ); // All position close order ( "position" , "Buy take profit" , 123 ); // Use magick 123 for profitable buy close order ( "command" , "Buy stop" , 0 ); // All buy stop orders
p_o : " position" or "command" .
type_po: filter type (see options above)
magicNumber : magic (0=all)
Simple - one call instead of 14 functions
Flexibility - granular filtering of transactions
Safety - handle loops correctly
Versatility - suitable for Expert Advisors, scripts, indicators
Bias = 5 - optimal price tolerance
Iterate from the end - safe removal
Local variables - query isolation
Draw colored range boxes for Asia, London and New York sessions on any chart. Includes a statistics panel showing the average trading session range in pips and optional breakout alerts when price exits a trading session.
Overbought and oversold indicators are designed to identify where a price reversal may occur.
The FMO indicator is a technical analysis tool that uses fractal cycles to measure the "age of trend". Its purpose is to help traders determine whether a trend is still young (safe to follow) or too old (high risk). Conceptual Synthesis in Psychology, Sociology, and the Life Cycle This work provides an in-depth analysis of human life through a numerical matrix (3, 7, 39, 49) and uses it as a conceptual lens for understanding psychology, sociology, and the developmental cycle. It is not a traditional scientific framework. Rather, it is a comprehensive model—integrating esoteric, psychological, and sociological perspectives into a unified circular structure. The goal is to organize and explain human development through hierarchical, interacting cycles.
MetaTrader 5 trend-based grid Expert Advisor uses EMA and RSI indicators. Dynamic lot size is calculated based on the account balance with minimum and maximum lot protection. Initial trading begins when price confirms the trend direction relative to the EMA and RSI levels. Add grid order at fixed point distances using a controlled multiplier. All trades are managed as baskets and end with a stated profit target or maximum loss level. Includes optional news time pause and market close filters. No DLL or external services required.
Attachment download
📎 Close_Orders.mq5 (26.82 KB)
📎 Close_Orders.mqh (25.1 KB)
Source: MQL5 #68469
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •