How to Test an EA Against Prop-Firm Drawdown Rules Before You Start a Challenge

A prop-firm evaluation doesn't ask whether your Expert Advisor (EA) is profitable over ten years. It asks a narrower and harsher question: does the account ever cross a loss limit, measured the firm's way, at any moment during the evaluation? One breach ends the attempt, however good the long-run numbers look.

A standard backtest report doesn't answer that question. Its maximum drawdown is usually measured differently from the rules, over a different period, with a different reference point. This guide shows how to turn the written rules into a check you can replay against your EA's history, then stress it with Monte Carlo.

One point up front: these checks are specific to prop-firm accounts, where the loss rules are fixed in advance. A personal account or a managed account has different constraints. And testing against the rules reduces the chance of a surprise. It does not reduce the risk of loss or predict any evaluation result.

Why your backtest's drawdown figure is the wrong number

Four differences usually separate a backtest's maximum drawdown from what the rules measure.

  1. Equity vs closed trades. Many backtest reports measure drawdown on closed-trade balance. Many prop-firm rules measure equity, including floating losses on open positions. A trade that dips deep before recovering can breach an equity rule and never show in a closed-trade figure.
  2. The reference point. A backtest measures drawdown from the highest peak. A static maximum loss rule measures from the starting balance. A trailing rule measures from a high-water mark that may stop trailing at some level. A daily rule measures from a reference set at the daily reset.
  3. The time window. A daily loss limit resets every trading day at a specific server time. A drawdown that builds slowly over a week may never trip it; a bad afternoon can.
  4. The sample. A backtest covers years. An evaluation covers a short window, and the question is the worst stretch the EA could hit inside that window.

Illustrative teaching example. In our sample stress-test report, "System A-14", an anonymized, composite daily-bar trend system, showed a maximum drawdown of 18.6% on closed-trade equity in its backtest. Monte Carlo resampling put the median at 21.3% and the 95th percentile at 33.8%. (Illustrative example only. Historical simulation, not predictive of future or live results.) If your account's maximum loss limit is tighter than these figures, the tested sizing is far too large before you even consider equity-based measurement or daily limits. The headline 18.6% is not the number to compare with a rule.

Step 1: Write the rules down exactly

Rules differ between firms and between account types at the same firm. Before testing, write down each rule as a precise definition. Questions to answer from your own firm's terms:

  • Daily loss limit: is it a percentage of starting balance, of the balance at the daily reset, or of the higher of balance and equity at the reset?
  • Daily reset: at what time, and in which time zone? Is that your broker's server time?
  • Maximum loss: static from the starting balance, or trailing? If trailing, does it trail balance or equity, and does it stop trailing once it reaches a set level?
  • Floating losses: do open positions count in real time?
  • Other rules: consistency rules (for example, a cap on the share of profit from one day), news-trading restrictions, weekend holding, minimum trading days, maximum position size.

If any definition is unclear, ask the firm before you test. A wrong assumption here makes every later step meaningless.

Step 2: Get equity-level data, not just a trade list

To test equity-based rules you need equity over time, not only closed trades.

  • In MT5, the Strategy Tester's graph shows both balance and equity. For a usable series, have the EA write equity to a file on each bar or tick during the test, or reconstruct it by marking open positions to market from bar data.
  • Use a timeframe fine enough for the rule. Daily bars hide intraday swings. If your EA holds positions intraday, record equity at least on M1 or M5 bars, and treat the result as an estimate: intrabar extremes can still be missed.
  • Include costs and swap. Spread, commission and overnight swap all move equity.
  • Check the data itself. Gaps and spikes in price history distort equity swings; see MT5 backtest data quality.

Step 3: Replay the rules in code

With an equity series and the written rules, a short function can walk through history and report the first breach. The version below covers a daily loss limit and a static or trailing maximum loss. Adjust the reference logic to match your firm's definitions exactly.

import pandas as pd

def first_breach(equity, start_balance, daily_limit, max_loss,
                 trailing=False, reset_hour=0):
    """equity: pd.Series of account equity indexed by server timestamp.
    daily_limit, max_loss: limits as fractions of start_balance.
    Returns (timestamp, rule) for the first breach, or None."""
    current_day, day_floor = None, None
    high_water = start_balance
    for ts, eq in equity.items():
        day = (ts - pd.Timedelta(hours=reset_hour)).date()
        if day != current_day:  # daily reset
            current_day = day
            day_floor = eq - start_balance * daily_limit  # adjust to your rule
        if trailing:
            high_water = max(high_water, eq)
        overall_floor = high_water - start_balance * max_loss
        if eq <= day_floor:
            return ts, "daily loss limit"
        if eq <= overall_floor:
            return ts, "maximum loss limit"
    return None

If you rebuild the equity series in Python rather than recording it from MT5, reconcile the two first; see Python vs MT5 backtesting.

Run it over every possible start date, not just the start of your data. An evaluation could begin on any day, so slide a window the length of the evaluation across the whole history and record how many windows contain a breach. That gives you a historical breach rate for the rules as written, which is far more informative than one backtest's maximum drawdown.

Step 4: Stress it with Monte Carlo

History contains one sequence of days. To see how much the breach rate depends on that sequence, resample it.

  • Resample days, not trades. Daily loss limits depend on how losses cluster within a day, so resample whole trading days of equity changes. This keeps each day's intraday shape intact.
  • Use blocks of days if losses cluster. A block bootstrap that resamples runs of consecutive days keeps some of the clustering that single-day resampling destroys.
  • Model the evaluation as a race between two barriers. Each simulated path ends when it either crosses a loss limit or reaches the evaluation's profit target. Record which barrier was hit first and how often.

The general method, including the difference between reshuffling and resampling, is covered in Monte Carlo testing a trading strategy.

Step 5: Size for the worst day, not the average one

Most rule breaches come from sizing, not from the strategy logic. Work out the sizing from the rule backwards.

  1. Find the worst day. From the backtest and the simulations, find the worst daily loss in units of risk: for example, the number of full stop-losses that could plausibly hit in one day, including correlated positions on related instruments.
  2. Add a buffer for execution. Stops can fill worse than planned on gaps and fast markets. Allow for slippage beyond the stop. Why an EA trades worse live than in its backtest covers how to estimate it.
  3. Compare with the limit. Risk per trade multiplied by that worst-day count, plus the buffer, should sit comfortably inside the daily loss limit, not exactly on it.
  4. Repeat for the maximum loss. Use the tail of the simulated drawdown distribution, not the backtest figure, and compare it with the maximum loss limit.
  5. Re-run the replay at the new size. Percentage drawdowns scale roughly with risk per trade, but compounding and position limits make it inexact. Check rather than assume.

If the sizing that fits the rules is so small that the strategy can't plausibly reach the target within the evaluation period, that's an important finding. It means the strategy and the account structure may be a poor match, and it's far cheaper to learn that from a spreadsheet than from a failed evaluation.

Step 6: Check the rules that aren't about drawdown

Drawdown limits get most of the attention, but other rules end evaluations too.

  • Consistency rules: compute the largest single day's share of total profit across your windows. Trend systems often make most of their money on a few days, which can conflict with these rules.
  • News restrictions: flag every trade opened or held through scheduled high-impact news, and check how results change if those trades are removed.
  • Weekend and overnight holding: count positions held over weekends and check the rule. For daily-bar systems this is often the deciding factor.
  • Position limits: check the largest total exposure the EA ever opened against the account's maximum.

Make sure the EA itself is worth testing

Rule replay only tells you how a set of results interacts with the rules. If the results themselves are overfit, the replay is precise about the wrong thing. Before this step, check the strategy with out-of-sample testing, a walk-forward analysis and the overfitting warning signs. Run the rule replay on out-of-sample periods where you can.

Prop-firm rule testing checklist

  • Every rule written as a precise definition, with unclear points confirmed with the firm
  • Daily reset time and time zone matched to the broker's server time
  • Equity series recorded at a timeframe fine enough for intraday swings
  • Costs, slippage and swap included
  • Rules replayed over every possible evaluation start date
  • Day-level Monte Carlo run, with loss limit and profit target treated as competing barriers
  • Risk per trade derived backwards from the worst plausible day
  • Consistency, news, weekend and position rules checked separately
  • Strategy validated out-of-sample before any of the above

Frequently asked questions

How do I backtest an EA against a prop firm's daily loss limit?

Record equity over time during the backtest, then replay the history with the daily loss limit applied exactly as the firm defines it, including the reset time and the reference point. Check every possible start date, not just one.

What is the difference between static and trailing drawdown?

A static maximum loss is measured from a fixed level, usually the starting balance. A trailing maximum loss moves up as the account reaches new highs, so gains raise the floor. Some trailing rules stop moving once they reach a set level. Check your firm's exact definition.

Why does my EA breach the drawdown rule when the backtest drawdown was lower?

Usually because the backtest measured closed-trade drawdown from the highest peak, while the rule measures equity, including open losses, from a different reference point, sometimes within a single day. The two numbers answer different questions.

Can testing guarantee that my EA won't breach the rules?

No. Testing shows how the EA's historical and simulated results interact with the rules. Future conditions, execution and gaps can differ. It reduces the chance of an avoidable surprise; it doesn't remove the risk of loss.

Do these checks apply to a personal trading account?

Not in this form. They are designed for prop-firm accounts with fixed loss rules. A personal account has different constraints, such as your own risk tolerance and your broker's margin rules.

Want a second pair of eyes?

Start with our free Sample Stress-Test Report. It walks one anonymized, illustrative strategy through a full stress test, start to finish, so you can see what rigorous validation looks like before you test your own.

Read the Sample Stress-Test Report

Want your own backtest checked? The Strategy Audit + 60-minute call is a paid service at a launch price of £100, credited in full against our build and portfolio offers. You send an MT4/MT5 Strategy Tester report or trade-list CSV; what we can check depends on the files you supply, and walk-forward and parameter sweeps are not included because they need the strategy itself. It is analysis of strategy testing, not investment advice, and does not promise any trading or evaluation outcome. See the Strategy Audit

Disclaimers

CollosoTrading provides educational content and analytical services for retail and professional algorithmic traders. We do not provide regulated investment advice, financial advice, or personal recommendations. Trading derivatives, leveraged products, and CFDs carries a high level of risk and may result in losses exceeding deposits. Past performance, including any verified or unverified historical results referenced on this site, is not indicative of future results. Consult an independent regulated financial adviser before making investment decisions.

All figures are backtests or simulations unless marked LIVE. Hypothetical or backtested performance results have inherent limitations and may not reflect actual trading. No representation is made that any account will or is likely to achieve profits or losses similar to those shown. Individual results vary. All figures in this article come from an anonymized, illustrative teaching example. We do not guarantee the outcome of any prop firm challenge.