TradeOrchestrator
- Utilitários
- Lucas Engels
- Versão: 1.2
- Atualizado: 16 abril 2026
- Ativações: 20
TradeOrchestrator — Multi-EA Risk Coordinator
No indicators. No complex logic. Pure protection.Overview
TradeOrchestrator is a lightweight supervisor that runs alongside your other Expert Advisors. It provides two independent protection modules that can be used together or separately:
- GridDefense — watches a designated EA's floating drawdown and blocks a second EA from placing new pending orders when a threshold is breached.
- ScalpOrchestrator — resolves pending order conflicts between multiple EAs by cancelling the lower-priority duplicate whenever two pending orders of the same type and symbol are placed within a configurable price margin of each other.
GridDefense — How It Works
- Monitor — TradeOrchestrator scans all open positions belonging to your primary EA (identified by magic number) and calculates their combined floating P&L as a percentage of account balance.
- Arm — The moment that drawdown percentage crosses your threshold, the guard arms itself and begins acting.
- Block — While armed, every pending order matching the cancel target is deleted on each tick. Set Cancel Magic to one or more comma-separated magic numbers to target specific EAs, or use * to cancel all pending orders except those placed by the monitored EA itself.
- Disarm — Once the monitored EA has fully closed all its positions, the guard disarms automatically and normal operation resumes.
ScalpOrchestrator — How It Works
- Priority list — Configure a comma-separated list of magic numbers in order of priority. The first entry is highest priority, the last is lowest. EAs not in the list are treated as lowest priority.
- Conflict detection — On every check cycle, ScalpOrchestrator scans all pending orders. When two orders of the same type and symbol are found within Price Margin of each other, the lower-priority order is cancelled.
- Immediate reaction — In addition to the periodic check, ScalpOrchestrator fires instantly via OnTradeTransaction whenever any listed EA places a new order.
Key Features
- Two modules, one EA — GridDefense and ScalpOrchestrator run independently; enable both or just one
- Magic-number based — Works with any EA without touching its source code
- Cross-symbol monitoring — GridDefense tracks all positions across all symbols for the monitored magic
- Wildcard cancel — GridDefense's Cancel Magic accepts * to block all outside EAs when armed
- Configurable priority — ScalpOrchestrator supports any number of EAs in the priority list; unlisted EAs are always outranked
- Automatic reset — GridDefense self-disarms cleanly when the drawdown situation resolves
- Zero interference when idle — Adds no overhead to normal trading conditions
Inputs
GridDefense
| Parameter | Default | Description |
|---|---|---|
| Enable GridDefense | true | Enables the GridDefense drawdown protection module |
| Monitor Magic | 77002 | Magic number of the EA to watch for drawdown |
| Arm Threshold % | 20.0 | Floating drawdown % that triggers the guard (0 = disabled) |
| Cancel Magic | 77003 | Comma-separated list of magic numbers whose pending orders are cancelled while armed (e.g. 77003,77004). Use * to cancel all pending orders except those of the monitored EA |
ScalpOrchestrator
| Parameter | Default | Description |
|---|---|---|
| Enable ScalpOrchestrator | false | Enables the conflict resolution module |
| Priority List | 77002 | Comma-separated magic numbers in priority order (first = highest). EAs not listed are treated as lowest priority |
| Price Margin | 0.1 | Two pending orders of the same type and symbol are considered conflicting when their prices are within this distance |
| Interval Seconds | 30 | Minimum seconds between periodic conflict scans. Set to 0 to check on every tick |
Behaviour
| Parameter | Default | Description |
|---|---|---|
| Log Cancelled Orders | true | Prints a journal entry for every cancelled order. Applies to both GridDefense and ScalpOrchestrator |
Typical Use Cases
GridDefense: You run two EAs simultaneously — one aggressive grid or martingale system and one trend-following EA. When the grid enters a deep drawdown, you don't want the trend EA adding pending positions that can compound exposure. Attach TradeOrchestrator to any chart, point it at both magic numbers, and it handles the coordination automatically.
ScalpOrchestrator: You run multiple scalping EAs on the same symbol and notice they occasionally stack duplicate pending orders at nearly the same price. Enable ScalpOrchestrator, set the priority list to define which EA's orders take precedence, and conflicting duplicates are pruned automatically.
Changelog
| Version | Changes |
|---|---|
| 1.2 |
|
| 1.1 |
|
| 1.0 | Initial release — GridDefense drawdown guard with configurable monitor magic, arm threshold, and cancel magic |
Notes
- Attach to any chart — symbol does not matter
- Compatible with any broker and account type
- Requires no special permissions beyond standard trade access
- Tested on MetaTrader 5 build 4000+
- This EA only cancels pending orders, it will never close any open position
