Equity protection: a kill switch for automated trading
Posted: Tue Nov 03, 2026 10:46 am
An EA running unattended can lose more than planned if markets behave unusually or if a bug causes repeated trades. A kill switch that stops trading when equity falls below a threshold adds a safety layer.
A simple version: at each tick or bar, compare current equity with the starting equity of the day or week. If the drawdown exceeds a limit, close all positions with the EA's magic number and stop opening new ones until manually reset.
A worked example: an EA has a bug in its position counting after a server restart and opens a new trade every minute. A daily equity limit of 3 percent would stop it before the damage grows.
The kill switch should be independent of the trading logic, ideally in a separate EA or script, so that a bug in the strategy code does not disable it.
Testing the switch on demo, by forcing a drawdown, confirms it works.
Do you run any equity protection alongside your EAs?
A simple version: at each tick or bar, compare current equity with the starting equity of the day or week. If the drawdown exceeds a limit, close all positions with the EA's magic number and stop opening new ones until manually reset.
A worked example: an EA has a bug in its position counting after a server restart and opens a new trade every minute. A daily equity limit of 3 percent would stop it before the damage grows.
The kill switch should be independent of the trading logic, ideally in a separate EA or script, so that a bug in the strategy code does not disable it.
Testing the switch on demo, by forcing a drawdown, confirms it works.
Do you run any equity protection alongside your EAs?