Advanced Close Logic EA
- Utilità
- SERGUEI PROKHOROV
- Versione: 1.0
- Attivazioni: 20
Description:
Advanced Close Logic EA monitors your open market orders per symbol, displays the counts directly on your chart, and automatically closes orders when configurable thresholds are met. It supports both global and per-symbol settings for direction, profit/loss filtering, and whether to close all matching orders or only those that passed your filters.
External Parameters:
1. GlobalMaxOpenOrders (int)
- Sets a single maximum number of open market orders for every symbol.
- 0 = use per-symbol settings; >0 = apply this threshold globally.
2. GlobalOrderDirection (enum: Buy / Sell / BuyAndSell)
- Filters trade direction. Only applies if GlobalMaxOpenOrders > 0.
3. ProfitLossAllOrders (enum: OnlyProfitPositions / OnlyLossPositions / ProfitAndLossPositions)
- Filters by current profit or loss. Only applies if GlobalMaxOpenOrders > 0.
4. ConcernedMode (enum: AllOrders / ConcernedOrders)
- AllOrders: close every order on the symbol.
- ConcernedOrders: close only those that met direction & P/L filters.
- Only applies if GlobalMaxOpenOrders > 0.
5. Ping (int)
- Scanning interval in seconds.
6. CustomizedSettings (string)
- Per-symbol overrides when GlobalMaxOpenOrders = 0.
- Format: SYMBOL,DIR,PL,CN,THR;...
• SYMBOL = instrument name (e.g. EURUSD)
• DIR = B (buy), S (sell), A (all)
• PL = P (profit), L (loss), X (profit & loss)
• CN = C (ConcernedOrders), A (AllOrders)
• THR = threshold integer
- Example: EURUSD,B,P,C,4;USDJPY,A,X,A,6
How It Works:
- If GlobalMaxOpenOrders > 0, the EA uses only global settings and ignores CustomizedSettings.
- If GlobalMaxOpenOrders = 0, the EA applies each entry in CustomizedSettings for that symbol.
