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:
| Problem | What the firm sees | What your EA should do |
|---|---|---|
| Revenge sizing after losses | Daily loss breach | Hard stop: no new trades for the day |
| Trading through NFP/FOMC | Rule violation or slippage loss | News window: no entries ±X minutes |
| Fixed 1.0 lot on a $10k account | Max risk / max lot breach | Risk-based lots from equity |
| Overnight gap on Friday | Max loss or weekend rule break | Session 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 target | Stop trading or reduce risk after target hit (optional guard) |
| Maximum daily loss | Block trading when daily drawdown hits limit |
| Maximum loss (overall) | Block trading when total drawdown hits limit |
| Minimum trading days | EA may trade small; you still need calendar days with activity |
| News / consistency rules | No 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 balanceACCOUNT_LOGIN— sanity check you are on the intended account
Pattern: daily loss from equity
- On first tick of the server day (or at
OnInitif day matches), storedayStartEquity = AccountInfoDouble(ACCOUNT_EQUITY). - Before any new entry, compute
dailyLossPct = 100.0 * (dayStartEquity - AccountInfoDouble(ACCOUNT_EQUITY)) / dayStartEquity. - If
dailyLossPct >= InpMaxDailyLossPct, set a flagtradingAllowed = falseand skipOrderSend.
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
- Select currencies tied to your symbol (e.g. EURUSD → EUR and USD).
- On
OnInit, subscribe or load today's events withCalendarValueHistory. - For each upcoming high-impact event, define a blackout:
[eventTime - InpMinutesBefore, eventTime + InpMinutesAfter]. - In
OnTick(), ifTimeCurrent()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.
| Method | Pros on prop accounts | Caveat |
|---|---|---|
| Fixed lot | Simple | Dangerous if account size changes after payout |
| % risk per trade (SL-based) | Scales with equity | Needs valid stop distance |
| Fixed fractional | Easy to code | Volatility 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:
- Inputs match the rule PDF — daily %, max %, news minutes, max lot.
- AutoTrading on, correct symbol and account login.
- Journal clean — no repeated
OrderSenderrors (common EA errors). - Daily reset tested — simulate a losing day; EA must flatline new entries.
- News day tested — run on a day with red-folder events; verify no entries in window.
- One chart, one magic — avoid duplicate EAs stacking risk (EA architecture basics).
- 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
- Build or export base logic: Create and Edit an MT5 EA
- Position sizing deep dive: EA Risk Management
- Session + spread filters: Advanced EA: MTF & Filters
- Validate: Backtest EA in Strategy Tester
- Prototype rules visually: Strategy Builder demo
References: FTMO — Trading objectives (FAQ), MQL5 AccountInfoDouble, MQL5 Economic Calendar, MQL5 article: calendar for trading, MetaTrader 5 Strategy Tester, CFTC prop firm customer advisory.