Prop-Firm Drawdown Rules: Why Your EA Needs an Equity Lock, Not Just a Stop Loss

Prop-Firm Drawdown Rules: Why Your EA Needs an Equity Lock, Not Just a Stop Loss

21 November 2026, 10:03
Mauricio Vellasquez
0
12

Prop-Firm Drawdown Rules: Why Your EA Needs an Equity Lock, Not Just a Stop Loss

Most prop-firm challenges are not lost on a bad trade. They are lost on a bad day. One rule ends the account: the daily loss limit. A second rule ends it more slowly: the maximum drawdown. Both rules look simple on the firm's rules page. Both are easy to break with an Expert Advisor that only knows how to place a stop loss.

This article explains how these rules really work in MetaTrader 5. It shows where an EA breaks them without warning. It then describes a practical control, the equity lock, and how to test it before you risk a challenge fee.

Trading involves risk. Nothing here is a promise of profit. Test every idea on a demo account first.

1. The Two Rules That End Most Challenges

The daily loss limit

The daily loss limit caps how much the account may lose in one trading day. Firms usually define the day by a fixed server time. Many firms measure the loss against the balance or equity at the start of that day. The loss includes open positions. This detail matters. A floating loss counts, even if you never close the trade.

A stop loss does not protect you here. A stop loss limits one trade. The daily limit covers all trades together. Five trades with a small stop each can still add up to a breach.

The maximum drawdown

The maximum drawdown caps the total fall from a reference level. Some firms use a static level based on the starting balance. Others use a trailing level that rises with your equity peak. The trailing type is stricter. It moves up when you win and never moves down.

You must read the rule text of your firm. Two firms can use the same words and different math. Write the exact formula in your notes before you configure any EA.

A stop loss protects a trade. An equity lock protects the account. Prop-firm rules judge the account.

2. Where an EA Breaks These Rules Without Warning

Most EAs are written for a normal broker account. Their risk logic answers one question: how much do I lose if this trade fails? Prop-firm rules ask a different question: how much has the whole account lost today?

Floating loss across several positions

A grid or multi-entry system can open many positions in one direction. Each position has a modest risk. Together they build a large floating loss. The EA does not see a problem. The firm's monitor sees a breach.

Gaps, spikes, and slippage

Gold can move several dollars in seconds around a news release. A stop loss can fill far from its price. The loss is then larger than planned. If you sit near the limit, one spike ends the challenge.

Day rollover and floating profit

Some firms reset the daily reference at a fixed time. A position that is open at the rollover carries its floating result into the new day. An EA that does not know the rollover time cannot manage this.

Several EAs on one account

Each EA tracks its own risk. None of them tracks the sum. Three EAs that each risk 1% can all lose in the same hour. The account then loses 3%, and no single EA broke its own rule.

Each robot can obey its own risk rule and the account can still break the firm's rule. The sum is what counts.

3. The Equity Lock: A Simple Control With Three Parts

An equity lock is a rule that watches the account equity, not the trade. It acts before the firm's limit, not at it. It has three parts.

  1. A reference level. The equity at the start of the firm's trading day.
  2. A soft limit. A fraction of the firm's limit, for example 60%. At the soft limit, the EA stops opening new trades.
  3. A hard limit. A larger fraction, for example 80%. At the hard limit, the EA closes all positions and stays flat until the next day.

The buffer between your hard limit and the firm's limit absorbs slippage and gaps. Without a buffer, the lock fires too late.

Choosing the buffer

Size the buffer from the worst slip you have seen on your symbol. Measure it in your own demo or live logs. Do not copy a number from a forum post. Gold needs a wider buffer than a major currency pair.

ControlWhat it protectsActs whenWeak point
Stop lossOne tradePrice reaches the stopIgnores the sum of trades
Fixed lot sizeSize of each entryAt order placementIgnores the number of entries
Soft equity lockNew exposureDaily loss reaches the soft limitDoes not close open trades
Hard equity lockThe whole accountDaily loss reaches the hard limitNeeds a safe buffer for gaps

4. A Minimal MQL5 Equity Check

The snippet below shows the idea in plain MQL5. It reads the start-of-day equity and compares it with the current equity. It is an educational sketch. It is not a full trading system. Adapt the limits to your firm's rules and test it on a demo account.

// Educational sketch: daily equity lock
#include <Trade\Trade.mqh>
input double SoftLimitPct = 2.0;   // stop new trades at this daily loss, in percent
input double HardLimitPct = 3.0;   // close all positions at this daily loss, in percent

CTrade   g_trade;
double   g_dayStartEquity = 0.0;
datetime g_dayStamp       = 0;

void UpdateDayReference()
{
   MqlDateTime t;
   TimeToStruct(TimeCurrent(), t);
   t.hour = 0; t.min = 0; t.sec = 0;
   datetime today = StructToTime(t);
   if(today != g_dayStamp)
   {
      g_dayStamp       = today;
      g_dayStartEquity = AccountInfoDouble(ACCOUNT_EQUITY);
   }
}

// returns 0 = trade allowed, 1 = soft lock, 2 = hard lock
int EquityLockState()
{
   UpdateDayReference();
   double equity  = AccountInfoDouble(ACCOUNT_EQUITY);
   double lossPct = 100.0 * (g_dayStartEquity - equity) / g_dayStartEquity;
   if(lossPct >= HardLimitPct) return 2;
   if(lossPct >= SoftLimitPct) return 1;
   return 0;
}

void CloseAllPositions()
{
   for(int i = PositionsTotal() - 1; i >= 0; i--)
   {
      ulong ticket = PositionGetTicket(i);
      if(ticket > 0) g_trade.PositionClose(ticket);
   }
} 

Two points need care. First, the server day may not match the firm's day. Use the firm's reset time. Second, store the day reference outside the program, for example in a global variable of the terminal. Then a restart does not reset the reference in the middle of the day.

What to log

Log every state change with the time, the equity, and the loss percentage. After a week on demo, read the log. You will see how often the soft lock fires and how far equity moves after it fires. That data tells you if your limits are too tight or too loose.

5. Match the System to the Regime Before You Match the Limit

An equity lock limits damage. It does not fix a system that trades the wrong market. A trend-following EA in a range loses small amounts many times. A mean-reversion EA in a strong trend loses large amounts once. The lock will stop both, but you will hit the lock often and make no progress.

Three layers, three questions

A robust setup answers three questions in order.

  • Signal layer: Is there an entry setup right now?
  • Context layer: Does the current market regime suit this setup? Is it trending, ranging, or expanding? Is a major news event close?
  • Risk layer: Does the account have room for this trade under the daily and total limits?

Most retail EAs only implement the first layer well. The context layer is often a single moving-average filter. The risk layer is often a fixed lot size. Prop-firm rules punish that design.

Stop asking which robot is best. Ask which market the robot was built for, and whether that market is on your chart today.

A simple regime measure

You can start with the Average True Range compared with its own longer average. When the short ATR runs well above the long ATR, volatility is expanding. Breakout systems prefer this state. When the short ATR falls below the long ATR, volatility is compressing. Range systems prefer this state. The next example reads both values in MQL5.

// Educational sketch: volatility ratio from ATR
int hShort = iATR(_Symbol, PERIOD_H1, 14);
int hLong  = iATR(_Symbol, PERIOD_H1, 100);

double VolRatio()
{
   double a[], b[];
   if(CopyBuffer(hShort, 0, 1, 1, a) != 1) return 0.0;
   if(CopyBuffer(hLong,  0, 1, 1, b) != 1) return 0.0;
   if(b[0] <= 0.0) return 0.0;
   return a[0] / b[0];   // above 1.2: expansion, below 0.8: compression
} 

The thresholds in the comment are starting points for your own tests. They are not recommendations. Test them on your symbol and timeframe, with real tick data.

6. Testing Before You Pay for a Challenge

Use real ticks and the firm's rules

Backtests on bar data hide intrabar swings. An intrabar swing can breach a daily limit that a bar-based test never sees. Use real ticks where your broker offers them. Model the spread and a slippage allowance.

Test the lock, not only the profit

Run the same test twice. Run it once without the lock, and once with it. Compare three numbers: the worst daily loss, the maximum drawdown, and the number of days the lock fired. A lock that fires on 40% of days signals a system and market mismatch.

Test questionWhat to measureRed flag
Does the system breach the daily limit?Worst single-day equity lossClose to or above the firm's limit
Does the lock work as designed?Equity path after soft and hard lockEquity keeps falling after the hard lock
Is the system suited to the regime?Lock days against volatility ratioMost lock days share one regime
Does a restart break the reference?Day reference after a forced restartReference resets in mid-day

Run a forward test on demo

A backtest tells you what would have happened. A forward test tells you what happens with your broker feed today. Run at least two weeks on a demo account. Include one major news day. Read the log, not only the balance.

Where the Ratio X Trader's Toolbox fits

The three-layer idea is the design principle behind the Ratio X Trader's Toolbox. It is a MetaTrader 5 bundle of 17 specialist Expert Advisors and one market-regime indicator, Ratio X Trend Watcher. The goal is to match the tool to the regime instead of searching for one robot that fits every market.

Some systems in the bundle, such as Ratio X MLAI 2.0, are built with daily and total drawdown guards for prop-firm style discipline. Start on a demo account and see which regime each tool prefers.

7. See the Toolbox in Action

The short video below explains the Toolbox approach in plain steps. It shows how the regime indicator and the specialist systems work together.

Watch the sales video: open the Ratio X Trader's Toolbox video. You can also visit the official page.

A good test shows you where a system fails. Run it on a demo account until you know that answer.

8. A Short Checklist Before You Start

  1. Write the firm's daily and maximum drawdown formulas in your own words.
  2. Find the firm's daily reset time and set the EA to use it.
  3. Set a soft limit near 60% and a hard limit near 80% of the firm's limit, then adjust from your logs.
  4. Check the sum of risk across all EAs on the same account.
  5. Pair each EA with the regime it was built for.
  6. Test with real ticks, then forward test on demo for two weeks.
  7. Review the lock log every week.

This list takes one afternoon. A failed challenge costs a fee and weeks of effort. The comparison is not close.

9. Common Mistakes With Drawdown Controls

Setting the hard limit equal to the firm's limit

This is the most common error. The lock needs room to work. A close order needs time to fill. In a fast market, the fill price can differ from the trigger price. If the hard limit equals the firm's limit, the breach happens during the close.

Resetting the reference at the wrong time

Your broker server time may differ from the firm's reset time. Check both. Compare the first tick of the new day on your chart with the firm's dashboard. Fix any offset in the code, not by hand.

Trusting the balance instead of the equity

Balance changes only when a trade closes. Equity changes with every tick. A lock that reads balance reacts too late. Always read equity for a daily limit.

Ignoring the weekend and the news calendar

Positions held over a weekend can gap on Monday. High-impact news can widen spreads for minutes. Many traders flatten before these events. The equity lock does not replace this habit. It adds a second line of defense.

The best drawdown control is the one that you tested on a bad day, before the bad day arrived.

Risk Disclosure

Trading leveraged products carries a high risk of loss. Past or backtested results do not guarantee future results. This article is educational. It is not financial advice. The 7-day guarantee below covers the software purchase. It does not cover trading results. Always test on a MetaTrader 5 demo account first.

Try the Ratio X Trader's Toolbox

If the three-layer approach matches how you want to trade, you can look at the full Toolbox. It is a lifetime license with no subscription.

  • Checkout: https://hotm.art/ratioxtrade
  • 7-day money-back guarantee: the guarantee covers the software purchase. It does not cover trading results.
  • MQL5 reader coupon: use code MQLFRIEND20 for 20% off.

Test first on a demo account. Choose the tool that fits the regime you see on your chart.