On this page
Back to tutorials

MT5 Prop Firm EA Rules: Daily Loss, News, Lots (2026)

Build a prop-firm-ready MT5 Expert Advisor: daily and max loss guards, high-impact news filter, and risk-based lot caps. FTMO-style checklist with MQL5 patterns and official references.

📖 16 min read

📝 3,200 words

🏷️ MQL5 & Expert Advisors

Share this article:

Want to build a no-code strategy right now?

Create your free account in seconds and start building immediately.


MT5 Expert Advisor for Prop Firms: Daily Loss, News Filter, and Lot Rules (2026)

Short answer: A prop-firm-ready MT5 Expert Advisor should enforce daily and max loss limits, block entries around high-impact news, and cap lot size from account risk — using inputs you set to match your firm's published rules (FTMO-style challenges often use ~5% daily and ~10% max loss, but always verify the live terms). Build these guards in MQL5 with AccountInfoDouble(), the Economic Calendar API, and strict OrderSend checks before every trade.

Prop accounts fail for boring reasons: one oversize lot after a losing streak, or a news spike that breaches daily drawdown. This guide is practical — tables, checklist, and copy-paste patterns — linked to FTMO trading objectives (example of public rules) and official MQL5 documentation.

Related guides: Create and Edit an MT5 EA · EA Risk Management · Advanced EA: Session & Spread Filters · Backtest in Strategy Tester · Build EA Without Coding


Why Prop Firms Need Different EA Rules

A retail EA might only care about signals. On a funded or challenge account, the EA must respect firm risk metrics that are calculated outside your code — often on equity, closed balance, or end-of-day snapshots.

Common failure modes when automation meets prop rules:

ProblemWhat the firm seesWhat your EA should do
Revenge sizing after lossesDaily loss breachHard stop: no new trades for the day
Trading through NFP/FOMCRule violation or slippage lossNews window: no entries ±X minutes
Fixed 1.0 lot on a $10k accountMax risk / max lot breachRisk-based lots from equity
Overnight gap on FridayMax loss or weekend rule breakSession filter + flatten before cutoff

Disclaimer: Prop firms change rules by program and date. FTMO, FundedNext, The5ers, etc. each publish their own terms. This article is educational — not legal or compliance advice.


Typical Prop Firm Limits (FTMO-Style)

Many traders search FTMO expert advisor, prop firm EA rules, or pass MT5 challenge because FTMO documents objectives publicly. As of their FAQ, FTMO trading objectives describe challenge targets such as:

Objective (example — verify on FTMO site)Typical meaning for your EA
Profit targetStop trading or reduce risk after target hit (optional guard)
Maximum daily lossBlock trading when daily drawdown hits limit
Maximum loss (overall)Block trading when total drawdown hits limit
Minimum trading daysEA may trade small; you still need calendar days with activity
News / consistency rulesNo entries around restricted events; avoid "all-in" days

Other firms use similar labels: daily drawdown, max drawdown, trailing drawdown, news blackout. Map each label to an input parameter in your EA (InpMaxDailyLossPct, InpNewsMinutesBefore, etc.) so you can retune without recompiling for every brand.

Industry context: The CFTC has warned consumers about proprietary trading firms; treat marketing claims skeptically and read the rule PDF your firm provides.


Daily and Max Drawdown Guards in MQL5

MetaTrader exposes account state through AccountInfoDouble. For loss guards you typically need:

  • ACCOUNT_EQUITY — includes floating P/L (what hurts you during open trades)
  • ACCOUNT_BALANCE — closed balance
  • ACCOUNT_LOGIN — sanity check you are on the intended account

Pattern: daily loss from equity

  1. On first tick of the server day (or at OnInit if day matches), store dayStartEquity = AccountInfoDouble(ACCOUNT_EQUITY).
  2. Before any new entry, compute
    dailyLossPct = 100.0 * (dayStartEquity - AccountInfoDouble(ACCOUNT_EQUITY)) / dayStartEquity.
  3. If dailyLossPct >= InpMaxDailyLossPct, set a flag tradingAllowed = false and skip OrderSend.

Use a buffer below the firm limit (e.g. 4.5% if the rule is 5%) so spread and slippage do not push you over after the EA stops.

Pattern: max (overall) loss

Track initialBalance at EA start (or challenge start date input). Overall loss percent:

totalLossPct = 100.0 * (initialBalance - AccountInfoDouble(ACCOUNT_EQUITY)) / initialBalance

If the firm uses trailing max drawdown on equity highs, you must track highestEquity and measure drawdown from that peak — stricter than balance-only math. The firm's dashboard is the source of truth; align your variable definitions with their glossary.

Minimal guard sketch

input double InpMaxDailyLossPct = 4.5;  // buffer under firm 5% rule
input double InpMaxTotalLossPct  = 9.0;  // buffer under firm 10% rule

double g_dayStartEquity = 0;
double g_initialEquity  = 0;
int    g_lastDay        = -1;

bool TradingAllowedByDrawdown()
{
   MqlDateTime dt;
   TimeToStruct(TimeCurrent(), dt);
   if(dt.day != g_lastDay)
   {
      g_lastDay = dt.day;
      g_dayStartEquity = AccountInfoDouble(ACCOUNT_EQUITY);
   }
   double equity = AccountInfoDouble(ACCOUNT_EQUITY);
   if(g_dayStartEquity > 0)
   {
      double dailyLoss = 100.0 * (g_dayStartEquity - equity) / g_dayStartEquity;
      if(dailyLoss >= InpMaxDailyLossPct) return false;
   }
   if(g_initialEquity > 0)
   {
      double totalLoss = 100.0 * (g_initialEquity - equity) / g_initialEquity;
      if(totalLoss >= InpMaxTotalLossPct) return false;
   }
   return true;
}

Call TradingAllowedByDrawdown() at the top of OnTick() before signal logic. For position sizing patterns, see EA risk management.


News Filter for Funded Accounts

Firms often restrict trading around high-impact macro releases. In MQL5 you do not need a third-party feed: MetaQuotes provides Calendar functions (CalendarValueHistory, CalendarEventById, structures like MqlCalendarValue).

Practical news filter workflow

  1. Select currencies tied to your symbol (e.g. EURUSD → EUR and USD).
  2. On OnInit, subscribe or load today's events with CalendarValueHistory.
  3. For each upcoming high-impact event, define a blackout:
    [eventTime - InpMinutesBefore, eventTime + InpMinutesAfter].
  4. In OnTick(), if TimeCurrent() falls in any blackout, do not open new positions (optionally allow manage/close only).

MQL5 article How to use the calendar for trading walks through calendar access patterns. Always filter by importance field — do not block every minor report unless your firm requires it.

Combine with session filters from Advanced EA: Multi-Timeframe & Filters so you are not trading illiquid hours outside the firm's spirit of "consistent" trading.


Lot Size and Risk Per Trade

Prop firm EA rules are not about maximum profit per trade — they are about maximum damage per trade.

MethodPros on prop accountsCaveat
Fixed lotSimpleDangerous if account size changes after payout
% risk per trade (SL-based)Scales with equityNeeds valid stop distance
Fixed fractionalEasy to codeVolatility changes risk

Use SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE) and stop distance to compute lots, or the CTrade / OrderCalcMargin helpers documented in MQL5 trade functions. Cap with InpMaxLot even when risk % allows more — some firms publish absolute lot limits per instrument.

If you build the strategy visually, export code and add these guards in MetaEditor — see Build EA Without Coding and Create/Edit MT5 EA.


Prop Firm EA Checklist Before You Trade

Use this on Demo that mirrors the firm's server before challenge money:

  1. Inputs match the rule PDF — daily %, max %, news minutes, max lot.
  2. AutoTrading on, correct symbol and account login.
  3. Journal clean — no repeated OrderSend errors (common EA errors).
  4. Daily reset tested — simulate a losing day; EA must flatline new entries.
  5. News day tested — run on a day with red-folder events; verify no entries in window.
  6. One chart, one magic — avoid duplicate EAs stacking risk (EA architecture basics).
  7. VPS clock — if using VPS for EA, confirm server time matches broker.

Optional: log every block reason ("BLOCK: daily loss", "BLOCK: news") to the Experts tab — you will need screenshots if you dispute a breach.


Backtest Limits for Prop Rules

The MetaTrader 5 Strategy Tester is excellent for signal quality, but prop dashboards are not simulated:

  • Trailing drawdown on closed P/L only
  • Firm-side consistency or "minimum days" counters
  • Copy trading / hedging detection across accounts

Backtest with realistic spread and Every tick when your EA is scalping-sensitive (scalping EA guide). Then forward test on Demo with drawdown and news guards enabled. For deployment discipline, read Deploy and Maintain Your EA.


Next Steps

References: FTMO — Trading objectives (FAQ), MQL5 AccountInfoDouble, MQL5 Economic Calendar, MQL5 article: calendar for trading, MetaTrader 5 Strategy Tester, CFTC prop firm customer advisory.

Build your no-code trading strategy now — free

Create your account and start building a complete no-code strategy right now. Add indicators, filters, and risk rules, then export MQL5 in minutes.

Frequently Asked Questions

Most proprietary trading firms allow EAs on MetaTrader 5, but each firm publishes its own rules: drawdown limits, news restrictions, lot caps, and forbidden practices (e.g. latency arbitrage). Read your firm's current terms before attaching any EA. This guide shows how to code guards that match common FTMO-style objectives — not a substitute for the official rulebook.

Track starting equity or balance at the server day reset, compare to current ACCOUNT_EQUITY via AccountInfoDouble, and block new entries when loss exceeds your input threshold (e.g. 4.5% to stay under a 5% firm limit). Close or disable trading for the rest of the day. See MQL5 AccountInfoDouble documentation for ACCOUNT_EQUITY and ACCOUNT_BALANCE.

Use the built-in Economic Calendar API: CalendarValueHistory and MqlCalendarValue to detect high-impact events on your symbol's currencies, then skip OrderSend when TimeCurrent() is inside your pre/post news window. MetaQuotes documents this in the MQL5 Calendar functions reference.

There is no universal lot — risk per trade as a small percent of account (often 0.25%–1% per trade) is safer than fixed lots. Combine with max daily loss logic and firm-specific caps. Our EA risk management guide covers position sizing patterns.

No. Backtests do not replicate firm dashboards, trailing drawdown on closed equity, or rule violations detected by the broker. Use Strategy Tester for logic checks, then forward test on Demo with the same EA guards enabled.

Build your no-code strategy now — free

Create Free Account