Back to Blog

Prop Firm EA Development: Building EAs That Pass FTMO Challenges

A funded trader reached out to us after failing his third FTMO challenge in a row. Same strategy each time. Same result: account closed mid-way through, daily loss limit hit during a volatile session. His strategy was profitable — the backtest proved

Viprasol Tech Team
March 5, 2026
10 min read

Prop Firm EA Development: Building EAs That Pass FTMO Challenges | Viprasol Tech

Prop Firm EA Development: Building EAs That Pass FTMO Challenges

By Viprasol Tech Team | Trading Software Development


A funded trader reached out to us after failing his third FTMO challenge in a row. Same strategy each time. Same result: account closed mid-way through, daily loss limit hit during a volatile session. His strategy was profitable — the backtest proved it. The problem wasn't his edge. It was that his EA had no idea FTMO's rules existed.

This is the most common prop firm EA mistake we see. Traders take a retail EA — even a genuinely profitable one — drop it onto a challenge account, and wait. The rules that protect their funded capital are nowhere in the code. One news spike, one bad session, and the evaluation is over.

A prop firm EA is a fundamentally different piece of software from a retail EA. The trading logic might be identical, but wrapped around it is a compliance layer that understands the specific rules of the firm, monitors them continuously, and acts before a violation occurs.


What Prop Firm Rules Actually Require From Your Code

Different firms have different specifics, but the structure is consistent. Here's what FTMO's current rules require:

RuleFTMO ChallengeFTMO Verification
Profit target10%5%
Max daily loss5% of initial balance5%
Max overall loss10% of initial balance10%
Minimum trading days1010
EA tradingAllowedAllowed

The Funded Trader adds a consistency rule: no single trading day can account for more than 40% of total profits. That rule alone eliminates a common EA behavior — running large positions on high-volatility days to hit the target quickly.

Every single rule above is something your EA must track and enforce in code. Not "the trader will monitor it manually." The EA must know when it's approaching a limit and stop trading before the violation occurs, automatically, even if the trader is asleep.


The Five Systems Every Prop Firm EA Needs

1. Daily Drawdown Guard

This is the rule that kills most accounts. The daily loss limit — typically 4-5% — is measured on equity (balance plus floating P&L), not just closed trades. An EA that monitors only realized P&L is blind to a large adverse floating loss.

bool IsDailyLossBreached()
{
   double startBalance = GetStartOfDayBalance();
   double equity       = AccountInfoDouble(ACCOUNT_EQUITY);
   double ddPercent    = (startBalance - equity) / startBalance * 100.0;
   
   if(ddPercent >= DailyLossLimit)  // set to 4.5% when firm limit is 5%
   {
      Print("Daily loss limit reached: ", DoubleToString(ddPercent, 2), "%");
      EmergencyCloseAll();
      isBlockedToday = true;
      return true;
   }
   return false;
}

The DailyLossLimit input should be set at a safety buffer below the firm's actual limit. We configure it at 4.5% when the firm's limit is 5%. In a fast-moving market, 50ms can be the difference between a 4.9% loss and a 5.2% loss — and the firm sees the 5.2%.

The daily balance reference (GetStartOfDayBalance()) needs careful implementation. It should capture the account balance at the start of the calendar day in the broker's timezone — not when the EA starts, not at UTC midnight. Different brokers use different day-reset times; this must be verified with your broker's server time before deployment.

2. Overall Drawdown Guard

The maximum drawdown rule measures cumulative equity loss from the initial balance set at the start of the challenge — not a rolling 24-hour window. This one is permanent: once the threshold is hit, the account is typically auto-closed by the firm.

bool IsMaxDrawdownBreached()
{
   double initial = GetInitialChallengeBalance();  // stored at first EA launch
   double equity  = AccountInfoDouble(ACCOUNT_EQUITY);
   double dd      = (initial - equity) / initial * 100.0;
   
   if(dd >= MaxOverallDrawdown)  // 9.5% when firm limit is 10%
   {
      Print("CRITICAL: Max drawdown breached at ", DoubleToString(dd, 2), "%");
      EmergencyCloseAll();
      ExpertRemove();   // shut down EA completely — do not restart automatically
      return true;
   }
   return false;
}

We use ExpertRemove() here intentionally. Once the max drawdown is threatened, the EA should not attempt to recover. Any new position at this stage is gambling with the last remaining capital. The trader needs to make a conscious decision about what to do next.

3. Trading Days Counter

FTMO requires a minimum of 10 trading days — defined as days where at least one trade was opened and closed. Many traders fail this by trying to rush to the profit target in fewer sessions.

void UpdateTradingDayLog()
{
   MqlDateTime now;
   TimeToStruct(TimeCurrent(), now);
   string todayKey = IntegerToString(now.year) + "-" +
                     IntegerToString(now.mon)  + "-" +
                     IntegerToString(now.day);
   
   if(HistorySelect(StringToTime(todayKey), TimeCurrent()))
   {
      if(HistoryDealsTotal() > 0 && todayKey != lastLoggedDay)
      {
         tradingDayCount++;
         lastLoggedDay = todayKey;
         GlobalVariableSet("EA_TradingDays", tradingDayCount);
      }
   }
}

The trading day count is stored in a MetaTrader global variable so it persists across EA restarts. We've seen accounts where the EA was restarted mid-challenge and the counter reset — costing the trader days of progress.

4. Consistency Rule Compliance

For firms like The Funded Trader, the EA must actively prevent a single session from generating more than 40% of cumulative profits. We build this as a dynamic position size cap:

double GetComplianceLimitedLotSize(double requestedLots)
{
   double totalProfit  = GetTotalChallengeProfit();
   double todayProfit  = GetTodayClosedProfit();
   double maxDayProfit = totalProfit * 0.38;   // buffer below 40%
   double room         = maxDayProfit - todayProfit;
   
   if(room <= 0)
   {
      Print("Consistency cap reached for today. Blocking new entries.");
      return 0;
   }
   
   // Scale position size to stay within cap
   double safeRisk    = room * 0.5;
   double scaledLots  = CalculateLotForRiskAmount(safeRisk);
   return MathMin(requestedLots, scaledLots);
}

This runs on every entry attempt. As today's profit approaches the consistency cap, position sizes scale down automatically — the EA can still trade, just more conservatively.

5. News Event Filter

No prop firm rule explicitly bans trading during news. But a single unfiltered NFP spike can trigger the daily loss limit in seconds — a 100-pip 30-second candle on EURUSD during Non-Farm Payrolls is not unusual.

We maintain a news schedule file (updated weekly via our backend service) that the EA reads on initialization. Entries within 30 minutes before or 15 minutes after a scheduled high-impact event are blocked:

bool IsInsideNewsWindow()
{
   for(int i = 0; i < newsCount; i++)
   {
      long secsBefore = (newsSchedule[i].time - TimeCurrent());
      long secsAfter  = (TimeCurrent() - newsSchedule[i].time);
      
      if(secsBefore >= 0 && secsBefore <= 1800) return true;  // 30 min before
      if(secsAfter  >= 0 && secsAfter  <= 900)  return true;  // 15 min after
   }
   return false;
}

🤖 Can This Strategy Be Automated?

In 2026, top traders run custom EAs — not manual charts. We build MT4/MT5 Expert Advisors that execute your exact strategy 24/7, pass prop firm challenges, and eliminate emotional decisions.

  • Runs 24/7 — no screen time, no missed entries
  • Prop-firm compliant (FTMO, MFF, TFT drawdown rules)
  • MyFXBook-verified backtest results included
  • From strategy brief to live EA in 2–4 weeks

Position Sizing on a Challenge Account

The mindset shift when building a prop firm EA: you are not managing your capital. You are managing the firm's capital within a defined loss budget.

With a $100,000 FTMO account and a 5% daily limit ($5,000), we typically configure the EA to risk 0.5–1% per trade ($500–$1,000 maximum). Why not more? Because you might have 3–5 concurrent positions. If all five go against you simultaneously during a correlated move, the aggregate loss hits the daily limit. The EA needs to account for worst-case concurrent exposure, not just per-trade risk.

The calculation we use for correlated pairs:

double GetMaxAllowedLot(string symbol)
{
   double dailyRiskBudget = GetDailyRiskBudget();      // remaining daily budget
   int    openPositions   = CountOpenPositions();
   
   // If 3 positions already open, cap new position's risk at 20% of budget
   // to prevent full budget exhaustion from correlated adverse move
   double positionRiskCap = (openPositions >= 3)
                          ? dailyRiskBudget * 0.20
                          : dailyRiskBudget * 0.33;
   
   return CalculateLotForRiskAmount(positionRiskCap, symbol, GetCurrentSL(symbol));
}

The On-Chart Dashboard

Visibility into risk status is not optional for a prop firm EA. A trader monitoring their account needs to see at a glance where they stand — without opening spreadsheets or logging into the broker portal:

void RenderDashboard()
{
   string panel = "";
   panel += "── PROP FIRM EA ────────────\n";
   panel += "Balance :  $" + DoubleToString(AccountInfoDouble(ACCOUNT_BALANCE), 2) + "\n";
   panel += "Equity  :  $" + DoubleToString(AccountInfoDouble(ACCOUNT_EQUITY),  2) + "\n";
   panel += "────────────────────────────\n";
   panel += "Daily P&L   : " + DoubleToString(GetDailyPnL(), 2)          + "%\n";
   panel += "Daily Limit : " + DoubleToString(DailyLossLimit, 1)         + "%\n";
   panel += "Max DD Used : " + DoubleToString(GetOverallDDUsed(), 2)     + "%\n";
   panel += "────────────────────────────\n";
   panel += "Trading Days: " + IntegerToString(tradingDayCount)          + "/10\n";
   panel += "To Target   : " + DoubleToString(GetRemainingTarget(), 2)   + "%\n";
   panel += "Status      : " + (isBlockedToday ? "⛔ PAUSED" : "✅ ACTIVE") + "\n";
   
   Comment(panel);
}

We also build Telegram notifications into every prop firm EA. When daily drawdown hits 60% of the limit, the trader gets a warning. At 80%, a stronger alert. At 95%, a final warning with current open positions listed. This means a trader using the EA doesn't have to watch MT5 all day — the EA notifies them when attention is needed.


📈 Stop Trading Manually — Let AI Do It

While you sleep, your EA keeps working. Viprasol builds prop-firm-compliant Expert Advisors with strict risk management, real backtests, and live deployment support.

  • No rule violations — daily drawdown, max drawdown, consistency rules built in
  • Covers MT4, MT5, cTrader, and Python-based algos
  • 5.0★ Upwork record — 100% job success rate
  • Free strategy consultation before we write a single line

Testing a Prop Firm EA Before the Challenge

Standard backtest metrics — profit factor, Sharpe ratio — don't tell you whether the EA will survive a prop firm challenge. You need a compliance simulation layer.

We run every prop firm EA build through a custom Python script that reads the MT5 backtest trade history export and simulates the exact firm rules day by day:

  • Would the daily drawdown limit have been hit on any day?
  • What was the worst single-day equity drawdown?
  • Was the max drawdown limit ever breached intraday (not just at close)?
  • How many trading days were logged across the test period?
  • Did any day exceed 40% of cumulative profit? (if applicable)

This compliance report goes alongside the standard backtest metrics and is reviewed with the client before deployment. We've caught issues this way that the standard MT5 report doesn't surface — most notably, intraday equity dips that the bar-level backtest smoothes over.


Common Mistakes We See

Using a retail EA without modification. Commercial EAs have no prop firm compliance layer. They'll trade normally until the daily limit is hit, and keep trading.

Monitoring closed trades only. The firm measures equity — balance plus open floating P&L. An EA watching only realized P&L is blind to a large adverse floating position.

Safety buffer too tight. Setting the kill switch at exactly the firm's stated limit is dangerous. Fast markets can move through it before the next tick fires.

No weekend gap protection. Positions left open over the weekend can gap 50–100+ pips against you before the EA can respond Monday morning. Most prop firm EAs should include a configurable Friday close time.


What We Deliver

Our prop firm EA development service delivers an EA with every compliance system built in — daily drawdown guard, overall drawdown guard, trading days counter, optional consistency rule compliance, news filter, Telegram alerts, and on-chart dashboard. Every build includes a full compliance simulation report alongside the standard backtest metrics.

We've built prop firm EAs for clients on FTMO, The Funded Trader, Funding Pips, TopStep, and several private firms. The goal isn't just to pass the challenge — it's to build an EA that operates safely on a funded account for months without a compliance incident.

If you're ready to take the challenge seriously, let's talk about your strategy.


See also: Building Your First MT5 EA · Backtesting Without Curve-Fitting

Sources: FTMO Trader Rules · The Funded Trader Rules · MQL5 CTrade Documentation

Share this article:

About the Author

V

Viprasol Tech Team

Custom Software Development Specialists

The Viprasol Tech team specialises in algorithmic trading software, AI agent systems, and SaaS development. With 100+ projects delivered across MT4/MT5 EAs, fintech platforms, and production AI systems, the team brings deep technical experience to every engagement. Based in India, serving clients globally.

MT4/MT5 EA DevelopmentAI Agent SystemsSaaS DevelopmentAlgorithmic Trading

Ready to Automate Your Trading?

Get a custom Expert Advisor built by professionals with verified MyFXBook results.

Free consultation • No commitment • Response within 24 hours

Viprasol · Trading Software

Need a custom EA or trading bot built?

We specialise in MT4/MT5 Expert Advisor development — prop-firm compliant, forward-tested before live, MyFXBook verifiable. 5.0★ Upwork, 100% Job Success, 100+ projects shipped.