EA Circuit Breaker
- Utilities
- Version: 1.0
- Activations: 10
Most risk tools work on the account as a whole: when the account hits its limit, everything stops, including the EAs that were doing nothing wrong.
EA Circuit Breaker works one EA at a time. When a single EA crosses the line you drew for it, that EA is dealt with and the rest of the account keeps running.
It does not open trades of its own, it does not give advice, and it does not send signals.
BUILT FOR HEDGING ACCOUNTS
Telling one EA's trades from another's is only possible while the platform keeps them as separate positions, and that is what a hedging account does. On a netting account MetaTrader merges everything into a single position per symbol and the magic number stops identifying anything, so nothing can separate them there. This tool reads the account type when it starts, and on a netting account it limits itself to monitoring and says so on screen. Closed trades are still separated by magic number.
NOTHING TO SET UP
Start it and the table is already filled in. It reads your open positions and the last 30 days of history, collects the magic numbers it finds, and makes one row per EA. Rows are named after the EA's order comment, and you can rename them. A new EA appears the moment it trades.
WHAT EACH ROW SHOWS
- Today's result, open positions, total lots, running total
- Commission and swap included, not left out
- The limit you set and how much of it is used
- Yellow at 80 percent of the limit, red when it is reached
THE LIMITS YOU CAN SET, PER EA
- Daily loss limit, as a percent of balance or equity, or an amount
- Total loss limit, counted from a date you can reset
- Maximum open positions
- Maximum total lots
- Trading hours, written as Mon-Fri 08:00-17:00
Every EA starts with your default limits, so all of them are watched from the first minute. No set files, nothing to configure per broker.
WHAT HAPPENS WHEN AN EA CROSSES ITS LINE
You choose, per EA, between three answers.
1. TELL ME (default). The row turns red and the reason is spelled out. Optional alert, push notification and sound. Trading is not interfered with at all. This is what a new installation does until you change it.
2. CLOSE AND LOCK. That EA's positions are closed and its pending orders cancelled. While the lock is on, anything that EA opens again is closed as well. The EA does not know it has been stopped, so it keeps trying, and every attempt costs you the spread - the panel counts those attempts and shows the running cost. Nothing else on the account is touched.
3. CLOSE THE CHART. The chart that EA runs on is closed, which takes the EA off the terminal for real. A template is saved first so you can put it back.
Closing positions needs Algo Trading to be on. Closing a chart does not, so option 3 still works while Algo Trading is off.
Daily limits and trading hours release themselves at the reset hour you choose. A total loss limit stays locked until you clear it yourself, with a two-step confirmation.
WHAT IT CANNOT DO
- It cannot disable another EA. MQL5 has no way to do that and the Market does not allow DLLs. It can close what an EA opens and keep closing it, or close that EA's chart. Those are the two options.
- Option 2 costs you the spread each time the EA opens again, as described above.
- On a netting account the per-EA actions are not available, for the reason given above.
- Two EAs sharing one magic number appear as one row. MetaTrader gives no way to tell them apart.
- Manual trades are watched but never acted on.
- It occupies one chart, and refuses to start on a second one so two copies cannot fight over the same EA.
Names, limits, chosen answers, chart links, lock states and your total's start date are saved per account number. Change the timeframe or restart the terminal and it is all still there. Folded away, the panel still shows how many EAs are locked and how many are near their limit.
HOW TO TEST IT
The free demo runs in the strategy tester, which runs one EA on one chart - so the thing this tool exists for cannot happen there on its own. To make the demo mean something, in the tester only, the tool opens a few small practice trades under different magic numbers so the table has rows in it. It never places an order on a live account, it shows "Tester self-test" while it does this, and InpTesterDemo switches it off.
In the tester you can see the panel, the table, the numbers, the settings, and an EA going OK to WARN to LOCKED when you set a small limit. What you cannot see there is one EA being stopped while others keep trading. Try that on a demo account with two or three EAs running.
INPUTS
Detection: InpHistoryDays, InpIncludeManual
Default limits: InpLimitBase, InpLimitUnit, InpDefaultDailyLimit, InpDefaultTotalLimit, InpDefaultMaxPos, InpDefaultMaxLots, InpIncludeFloating, InpWarnPercent, InpDayResetHour
Action: InpDefaultAction, InpConfirmActions, InpSaveTemplate, InpMaxCloseRetries
Alerts: InpAlertPopup, InpAlertPush, InpAlertSound
Panel: InpPanelX, InpPanelY, InpPanelWidth, InpFont, InpFontSize, InpColorBg, InpColorHeader, InpColorText, InpColorOk, InpColorWarn, InpColorLock
Tester: InpTesterDemo, InpMagicSelf
REQUIREMENTS
MetaTrader 5 and a hedging account. One free chart. Algo Trading must be on for positions to be closed. No DLL, no external server, no internet connection, no additional files.
This tool does not predict prices, does not tell you what to trade, and makes no claim about your results. It applies the limits you set.
