A daily loss circuit breaker in the EA, written before I needed it
Posted: Thu Oct 08, 2026 12:27 pm
A daily loss circuit breaker in the EA, written before I needed it
I made a circuit breaker for my EA after reading about someone whose bot kept trading through a bad day. The idea is that if the day's loss reaches a set level, the EA stops opening new trades until the next day.
It checks the realized profit and loss for the current day, plus the floating loss on any open trades, and compares the total to a limit, expressed as a percentage of the balance at the start of the day. If it's reached, it closes everything, if I've set that option, and blocks new entries. At the start of the next trading day it resets.
The most complicated part was defining the day. Which time does the day start, and how does it treat the rollover? I used the same cut off as my prop firm's reset so the two match. I also made it write a clear message to the log and send me a notification when it triggers, so I know it's happened.
It's only triggered once so far, on a news day when the EA took a string of losses. It did what I wanted and I was glad it was there.
I made a circuit breaker for my EA after reading about someone whose bot kept trading through a bad day. The idea is that if the day's loss reaches a set level, the EA stops opening new trades until the next day.
It checks the realized profit and loss for the current day, plus the floating loss on any open trades, and compares the total to a limit, expressed as a percentage of the balance at the start of the day. If it's reached, it closes everything, if I've set that option, and blocks new entries. At the start of the next trading day it resets.
The most complicated part was defining the day. Which time does the day start, and how does it treat the rollover? I used the same cut off as my prop firm's reset so the two match. I also made it write a clear message to the log and send me a notification when it triggers, so I know it's happened.
It's only triggered once so far, on a news day when the EA took a string of losses. It did what I wanted and I was glad it was there.