EA Risk Management: Position Sizing for Trading Robots
Your EA's risk management settings matter more than its strategy. A mediocre strategy with great risk management will outperform a great strategy with bad risk management. Every time. This isn't theory — it's math. Here's how to get it right.
Most traders spend 90% of their evaluation time looking at an EA's win rate and return percentage. They should be spending 90% of their time on risk management. A 70% win rate means nothing if the 30% of losing trades are sized to destroy your account. Conversely, a 40% win rate can be extremely profitable if position sizing ensures the winners pay multiples of what the losers cost.
This guide covers the technical side of risk management for automated trading systems. It's the kind of information that separates traders who survive long enough to compound their gains from those who blow their accounts in the first market dislocation.
Why Risk Management Is Everything
Here's a truth that's uncomfortable for anyone selling EAs: the strategy is secondary to survival. You can't compound gains from a blown account. You can't recover from zero. The first and absolute priority of any trading system is to keep you in the game.
Consider two traders running the same EA:
Trader A: 5% Risk Per Trade
- Account: $10,000
- After 5 consecutive losses: $7,738
- After 10 consecutive losses: $5,987
- Recovery needed: 67% gain to break even
- Emotional state: Panic. Likely to disable the EA.
Trader B: 1% Risk Per Trade
- Account: $10,000
- After 5 consecutive losses: $9,510
- After 10 consecutive losses: $9,044
- Recovery needed: 11% gain to break even
- Emotional state: Calm. Understands this is normal.
Same EA. Same market conditions. Same losing streak. Dramatically different outcomes. Trader A needs the EA to produce a 67% gain just to get back to where they started — and they're probably too shaken to let it run. Trader B needs an 11% recovery, which is routine for any decent strategy. The only difference is risk per trade.
Even the best EAs have losing streaks. Every strategy goes through drawdown periods. The question isn't whether your EA will have a bad stretch — it will. The question is whether your position sizing allows you to survive that stretch with enough capital to benefit from the recovery.
Position Sizing Methods
There are four main approaches to position sizing in automated trading. Each has trade-offs, and understanding them helps you configure your EA correctly.
Fixed Lot
The simplest approach: every trade uses the same lot size regardless of account balance, stop loss distance, or market conditions. If you set 0.1 lots, every trade is 0.1 lots.
Advantage: Easy to understand and implement. Predictable position sizes.
Problem: As your account grows, the risk percentage decreases (0.1 lots on a $50,000 account is proportionally much less risky than on a $5,000 account). As your account shrinks, the risk percentage increases — exactly the opposite of what you want. Fixed lots don't scale with your account, which means your risk management deteriorates precisely when it matters most: during drawdowns.
Percentage Risk Per Trade
The industry standard recommendation. You risk a fixed percentage of your current account balance on each trade. As your account grows, lot sizes increase proportionally. As your account shrinks, lot sizes decrease, protecting you from further damage during drawdowns.
The standard recommendation is 1-2% risk per trade. Conservative traders use 0.5-1%. Aggressive traders use 2-3%. Anything above 3% per trade is gambling, not trading. At 1% risk per trade, you would need approximately 70 consecutive losing trades to halve your account — an event so unlikely with any reasonable strategy that it effectively provides a safety floor.
This is the method we recommend for the vast majority of EA traders. It's mathematically sound, it scales automatically, and it protects your capital during the inevitable bad stretches.
ATR-Based Sizing
ATR (Average True Range) measures the average volatility of a currency pair over a set period. ATR-based position sizing adjusts your lot size based on current market volatility: smaller positions when the market is volatile (wider stops needed), larger positions when the market is calm (tighter stops possible).
Advantage: Accounts for changing market conditions. Your dollar risk stays constant even as volatility fluctuates.
Complexity: Requires the EA to calculate ATR dynamically and adjust lot sizes accordingly. Not all EAs support this. When an EA does support ATR-based sizing, it's usually a sign of thoughtful development.
Kelly Criterion
A mathematical formula that calculates the optimal bet size based on your win rate and average win/loss ratio: f* = (bp - q) / b, where b is the average win/loss ratio, p is the win probability, and q is the loss probability (1 - p).
In theory: Kelly sizing maximizes long-term growth rate. It's mathematically optimal for compounding returns over time.
In practice: Full Kelly is too aggressive for most traders and most EAs. The formula assumes you know your true win rate and win/loss ratio with precision — but EA performance fluctuates. Using full Kelly during a period where the EA underperforms its historical metrics can produce devastating drawdowns. Most practitioners use "half Kelly" or "quarter Kelly" to build in a safety margin. Even then, it requires accurate performance statistics that are difficult to estimate for a live trading system.
Calculating the Right Lot Size
If you're using percentage risk per trade (which you should be), here's the formula and a worked example.
Lot Size Formula
Lot Size = (Account Balance × Risk%) / (Stop Loss in Pips × Pip Value)
Worked Example
- Account Balance: $10,000
- Risk Per Trade: 1% = $100
- Stop Loss: 50 pips
- Pair: EURUSD
- Pip Value (per standard lot): $10
Lot Size = $100 / (50 pips × $10) = $100 / $500 = 0.20 lots
With a 50-pip stop loss, a 0.20 lot position risks exactly $100, or 1% of the $10,000 account.
This calculation changes with every trade because the stop loss distance varies based on market conditions and the EA's logic. A good EA performs this calculation automatically. If your EA only supports fixed lot sizing, you'll need to calculate the lot size manually based on the EA's typical stop loss distance and update it periodically as your account balance changes.
Some tools make this easier. For example, SteadyFlowFX includes built-in risk calculators that automatically size positions based on your specified risk percentage and the current stop loss distance, removing the need for manual calculation.
Maximum Drawdown Limits
Every EA should have a hard stop — a maximum drawdown level at which you stop trading and investigate what's happening. This is separate from the per-trade stop loss. It's an account-level circuit breaker.
Our recommendation: set a hard stop at 20-25% drawdown. If your EA draws down more than this from its peak equity, pause it. Investigate. Check whether market conditions have changed, whether a broker update has affected execution, or whether the EA is simply in a losing streak within its normal parameters.
Some EAs have built-in maximum drawdown settings. If yours does, use it. If not, you have two options:
- • Manual monitoring. Check your account at least daily. Calculate the drawdown from the peak equity. If it hits your threshold, remove the EA from the chart.
- • Email/push alerts. Set up alerts in MetaTrader or through your broker's app. MT4 and MT5 both support email notifications when equity drops below a specified level. Some VPS monitoring tools also offer this functionality.
Don't let your EA run unchecked. Even the most reliable EAs can behave unexpectedly during extreme market events. A flash crash, a surprise central bank decision, or a liquidity vacuum can cause an EA to open positions that wouldn't occur under normal conditions. Your drawdown limit is there for the scenarios you haven't planned for.
Portfolio Risk
If you're running multiple EAs simultaneously — and many traders do — your risk management needs to account for the total exposure across all of them, not just each one individually.
Consider this scenario: you run three EAs, each risking 2% per trade. That's a responsible 2% per EA. But if all three open trades simultaneously (which they will), your total exposure is 6%. If they're all trading the same pair in the same direction, your effective risk is 6% on a single market move. That's not diversification. That's concentration masquerading as diversification.
Correlation matters. Two gold EAs double your gold exposure. A EURUSD EA and a GBPUSD EA are correlated because both pairs move against the dollar — when the dollar strengthens, both positions are likely to lose simultaneously. True diversification requires EAs that trade uncorrelated instruments: a forex EA, a gold EA, and an index EA will diversify better than three forex EAs on major pairs.
Portfolio-level risk rules:
- • Total risk across all EAs should not exceed 5-6% at any given time
- • Maximum exposure to any single currency should not exceed 3-4%
- • If running multiple EAs on the same pair, reduce per-trade risk for each proportionally
- • Monitor total open position count — even small positions add up
The Martingale and Grid Problem
Martingale and grid strategies deserve special attention because they represent the most dangerous risk management approaches in automated trading — and they're also among the most commonly sold.
Martingale doubles position size after each losing trade. The logic: one winning trade will recover all previous losses plus a profit equal to the original trade. This works beautifully in backtests and during calm markets. The equity curve is smooth and steadily rising. Win rates are often 95%+. The marketing practically writes itself.
The problem is mathematical certainty. Martingale requires infinite capital and no position size limits to work indefinitely. Real trading accounts have finite capital and maximum lot sizes. After 7-8 consecutive losses with doubling lot sizes, the next position requires 128-256x the original lot size. On a $10,000 account starting with 0.01 lots, this becomes a 1.28-2.56 lot position — risking the entire account on a single trade. When (not if) a prolonged adverse move occurs, the account is destroyed.
Grid strategies place orders at fixed intervals above and below the current price. In a ranging market, price oscillates between grid levels and the EA profits from each swing. The risk emerges when the market trends strongly in one direction. The grid accumulates positions against the trend, each one losing money, with no clear exit point. Without a hard stop, a grid EA can hold 10, 20, or more losing positions simultaneously, all waiting for a reversal that may not come.
Some EAs incorporate grid elements within a broader strategy framework — SteadyFlowFX's portfolio approach, for example, uses grid-like position management but with defined risk boundaries. If you choose to run a grid-based EA, the position sizing must be conservative enough to survive extended trends. This typically means using 1/3 to 1/4 of the lot size you would use with a standard stop-loss-based EA.
If you choose to run a martingale or grid EA:
- • Use a starting lot size that is 1/4 to 1/5 of what the vendor recommends
- • Set a maximum number of grid levels or martingale steps (cap it at 5-6)
- • Set an absolute maximum drawdown limit and enforce it
- • Accept that the account will blow up eventually and only risk money you can afford to lose completely
- • Withdraw profits regularly — don't let them compound into a larger position that eventually gets wiped out
Account Size Recommendations
Under-capitalization is the number one account killer for EA traders. An account that's too small for the EA's minimum lot size and stop loss requirements forces you into disproportionate risk on every trade. Here are minimum account sizes by EA type:
- Scalping EAs
- Tight stops, frequent trades
- $500+
- Standard Trend/Swing EAs
- Medium stops, moderate frequency
- $1,000+
- Grid/Martingale EAs
- Multiple positions, high capital needs
- $2,000+
- Multi-Pair Portfolios
- Several EAs or pairs simultaneously
- $5,000+
- Gold/Commodity EAs
- High pip values, wide stops
- $1,500+
These are minimums, not recommendations. More capital means lower proportional risk per trade, which means more room to survive drawdowns. If you can afford $2,000 for a scalping EA instead of $500, the additional capital provides a significant safety buffer.
A common mistake: traders buy a $300 EA and deposit $200 into their trading account. The EA costs more than the trading capital behind it. If the EA requires 0.01 lots minimum and the stop loss is 50 pips on EURUSD, each trade risks $5, which is 2.5% of the $200 account. At 0.02 lots (a reasonable minimum for many EAs), you're risking 5% per trade. This is not a position sizing choice — it's being forced into excessive risk by inadequate capitalization.
Broker Selection for Risk Management
Your broker choice directly affects your risk management in ways that most EA traders don't consider.
Account Type Matters
ECN (Electronic Communication Network) and Raw Spread accounts provide tighter spreads with a separate commission. Standard accounts bundle the commission into the spread. For EA trading, ECN/Raw accounts are almost always better because the tighter spreads mean your stop losses are less likely to be triggered by spread widening rather than genuine adverse price movement.
Slippage Considerations
Slippage is the difference between the price you requested and the price you actually got. In normal conditions, slippage is minimal (1-2 pips). During high-volatility events, it can be significant — 5-20 pips or more. Your EA's stop loss at 30 pips might actually execute at 35-40 pips during a news event, increasing your loss beyond what you planned for.
Choosing a broker with good execution and low slippage reduces this risk. Look for brokers that publish their execution statistics. RoboForex is one option that provides ECN execution suitable for automated trading, though you should always test any broker's execution quality on a demo account with your specific EA before committing real capital.
Stop Level Distances
Some brokers impose minimum distances for stop loss and take profit orders (the "stop level"). If a broker has a 5-pip stop level on EURUSD, your EA cannot place stops closer than 5 pips from the current price. For scalping EAs that use very tight stops, this can invalidate the entire strategy. Check your broker's stop level for the pairs your EA trades before deploying.
Emergency Procedures
Every EA trader needs a plan for when things go wrong. Not "might go wrong" — "will eventually go wrong." Here's your checklist:
How to Kill All Trades Immediately
In MetaTrader, you can close all open positions through the Terminal window (Ctrl+T). Right-click on any open trade and select "Close All" or close them individually. Some EAs also have a "panic button" setting or a script that closes all positions when triggered. Know how to do this before you need to do it.
Alternatively, create a "Close All" script and keep it ready. In MT4, you can assign it to a hotkey. In an emergency, pressing that key closes every open position on the account instantly. Several free close-all scripts are available on the MQL5 codebase.
How to Disable the EA
Closing open trades doesn't stop the EA from opening new ones. To fully stop an EA: (1) Remove it from the chart by right-clicking and selecting "Expert Advisors → Remove." (2) Alternatively, click the "AutoTrading" button in the toolbar to disable all EAs on the platform. (3) If you're remote and can't access the VPS, contact your broker's support desk and request that they disable EA trading or close all positions on your account.
VPS Monitoring
If your EA runs on a VPS (which it should), ensure you can access the VPS remotely at any time. Keep the remote desktop credentials accessible on your phone — not just on the VPS itself. Set up email notifications in MetaTrader for large drawdowns. Some VPS providers offer monitoring dashboards that alert you if the VPS goes offline or if specific applications (like MetaTrader) crash.
The Emergency Plan
Write this down and keep it accessible. Don't rely on thinking clearly during a stressful situation.
When Your EA Goes Wrong: Step-by-Step
- 1. Disable AutoTrading (prevent new trades from opening).
- 2. Assess the current positions. How many are open? What is the total exposure?
- 3. Close positions that are beyond your risk tolerance immediately.
- 4. Remove the EA from all charts.
- 5. Document what happened — what were the market conditions, what trades did the EA open, was there a broker issue?
- 6. Do not redeploy the EA until you understand what went wrong and have adjusted settings to prevent a repeat.
- 7. If the problem is the EA itself (bug, bad logic), contact the vendor. If no response within 48 hours, consider the EA abandoned.
The worst thing you can do when an EA malfunctions is freeze. The second worst thing is panic-close everything and then immediately redeploy with the same settings. Have a plan. Follow the plan. Adjust the plan only after you've had time to think clearly.
Risk management isn't exciting. It doesn't produce YouTube-worthy equity curves or viral social media posts. But it's the difference between a trading account that survives for years and one that becomes a cautionary tale. Take the time to configure it properly, and your EA has a fighting chance.
For more on evaluating EAs before you buy, see our best forex EAs for 2026, our backtesting guide, and our scam red flag guide.