Advertisement IC Markets

My EA's kill switch: the three conditions that stop it for the day

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS London Scalper
Posts: 806
Joined: Sun Oct 18, 2026 12:25 pm

My EA's kill switch: the three conditions that stop it for the day

Post by FXS London Scalper »

Every EA I run live has a kill switch that stops new entries for the rest of the day. After some trial and error, I've settled on three conditions.
  • Daily loss of 2R or more, counted from closed trades plus floating loss on open ones. Once reached, open trades are left to their stops but nothing new opens.
  • Three consecutive errors from the trade server, such as off quotes or trade context busy. That usually means something is wrong with the connection or the broker, not the market.
  • Spread above three times its median for more than five minutes during the session. That's usually a sign of a liquidity problem or news I didn't filter.
When the switch triggers, the EA writes the reason to the log and sends a push notification to my phone through the terminal.

The second and third conditions caught problems I wouldn't have noticed: once a broker server issue, once an unscheduled news event.

The important part is that the switch can't be reset by the EA itself. I have to change an input manually, which forces me to look at what happened.

What conditions do you use for stopping an EA? Do you include anything besides loss limits?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Post Reply