What a flash crash actually does to your EA
A flash crash isn't a 1% dip. It's a 5-15% price collapse in seconds, followed by a sharp recovery. Your broker's stop loss doesn't execute. Your EA keeps trading like nothing happened. By the time price recovers, your account is liquidated.
This happened to thousands of retail traders during the 2023 crypto volatility. According to CFTC reports, retail losses during flash events spike 300% higher than normal market days.
Most retail EAs have zero protection against this. They're built to trade "normal" markets. When liquidity disappears, they die.
Why your EA survives normal markets but dies in real ones
Your EA was probably backtested on daily or 4-hour data. The model never saw a flash crash because historical data smooths over liquidity events. Price goes from 100 to 95 in the backtest. In reality, it goes 100 → 85 → 100 in 200 milliseconds.
The disconnect:
- Backtest assumes your order fills at the stop loss price. Reality: during a crash, the broker's servers are flooded and your stop doesn't execute at all.
- Backtest assumes price moves smoothly. Reality: flash crashes have gaps you can't trade through.
- Backtest assumes your EA can check account balance and position size. Reality: during extreme volatility, the broker API itself lags or times out.
Your "safe" 2% stop loss means nothing when price gaps past it in 50 milliseconds.
How institutions protect against market dislocations
Bank trading desks and prop firms are required by SEC regulations to have safeguards retail traders often lack:
- Circuit breakers — halt trading automatically if price moves X% in Y seconds.
- Liquidity checks — verify bid-ask spread is normal before placing orders. If spread widens past a threshold, stop.
- Position limits — EA can't hold more than a maximum notional value during volatile hours.
- Risk monitoring — real-time calc of max drawdown and margin ratio. If either breaches a threshold, flatten all positions.
- Broker diversity — never all-in on one broker. If one's API chokes, the other executes the safety trade.
Retail traders think these are "optional." Institutions know they're the difference between profit and ruin.
The exact EA settings that cause liquidations
Most retail EAs have these dangerous defaults:
- Aggressive lot sizing (1-5% of account per trade)
- No maximum daily loss limit
- No maximum open positions
- Stop losses set by points, not percentage of account
- No API timeout handling
- No liquidity checks before orders
A single flash crash hits. Your EA is holding 5 open positions at full lot size. It tries to place 3 more orders in the same direction (because it doesn't know a crash is happening). Broker slips all orders by 2-3%. Margin call triggers. Liquidation. Account gone.
This happens in 2-3 seconds. Before you wake up.
How to build an EA that doesn't vanish
Real protection has three layers:
Layer 1: Prevent the crash from happening
Build logic that detects unusual volatility BEFORE your EA starts trading:
- Check ATR or standard deviation vs. 20-day average. If current vol is 3x normal, halt new trades.
- Monitor bid-ask spread. If wider than normal, halt.
- Check broker server latency. If lag spikes, halt.
Layer 2: Survive if the crash happens anyway
- Set position size as % of account, not fixed lots. Never risk more than 1% per trade.
- Set a hard daily max loss. If you hit -2% before noon, EA stops trading for 24 hours.
- Set a max open positions. Cap at 3, not 10.
- Trailing stop instead of hard stop. Gives orders time to execute without gapping past.
Layer 3: Recover if you get slipped
- Monitor slippage in real-time. If average slippage exceeds 10 pips, dial lot size down 50%.
- Margin ratio monitoring. If margin ratio falls below 50%, flatten all open positions immediately.
- API timeout handling. If order confirmation doesn't return in 2 seconds, cancel and retry.
These three layers aren't "nice to have." They're the difference between a bot that survives and one that vanishes.
The math: how fast you lose without safeguards
Scenario: Your EA has a $10,000 account. Lot size is set to 0.5 at 1:100 leverage (standard retail).
Normal day: Price moves 100 pips against you. Your stop loss hits. You lose $50. You're fine.
Flash crash: Price gaps 500 pips in 200ms. Your stop doesn't execute. Your EA, unaware of the gap, places 3 more orders in the same direction (because the logic says "price is low, buy more"). By the time your broker's API responds, you're 5 positions deep, each gapped 500 pips underwater. Margin call at position 4. Liquidation cascade. Account liquidated in 1.8 seconds.
Total loss: $10,000.
With safeguards (position limit = 2, max daily loss = -1%):
Flash crash: Price gaps 500 pips. Your first position gets slipped 300 pips (ouch, but survivable). Your second position doesn't execute because position limit = 2 and you already have 1 open. Daily loss hits -$100 (-1%). EA halts trading for the rest of the day. You're down $100. You live to trade tomorrow.
Difference: $9,900.
This is the line between casual automation and production-grade automation.
Why building these safeguards is harder than it looks
Every broker has different API behaviors during crashes. Some brokers:
- Reject orders entirely (return error code 130 or 1)
- Accept orders but don't execute them (they sit in queue)
- Execute but don't confirm (you don't know if it filled until you check 5 seconds later)
- Reject some orders and execute others randomly
A generic EA built on one broker's API breaks on another's. The safeguards have to be broker-specific. That's custom work.
That's why Alorny builds custom EAs with your specific broker, asset, and risk profile in mind. The safeguards aren't generic. They're engineered to the exact conditions you trade.
Your next step
You have two choices: build an EA today without safeguards and lose it the next time the market hiccups, or build it right the first time.
Tell us your strategy and your broker. Message us on WhatsApp and we'll show you the exact safeguards we'd build in. Or visit alorny.cloud to see our past work. Custom MT5 EAs start at $300. Flash crashes cost way more.
Key Takeaways:
- Flash crashes liquidate unmanaged retail EAs in seconds because stops don't execute and the bot keeps trading.
- Institutions have circuit breakers, liquidity checks, position limits, and real-time risk monitoring. Retail bots have none.
- Aggressive lot sizing (1-5% per trade, no position limits, no daily loss cap) is how accounts blow up.
- Real protection needs three layers: prevent crashes from happening, survive if they do, recover if you get slipped.
- Building this is broker-specific work. Generic EAs don't cut it.