Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

New: Metatrader 5 Indicator | PropFirm Consistency and Drawdown Monitor | MQL5 Code

Discover expert developed MetaTrader tools that can complement professional solutions.

Most funded-account challenges fail on two rules traders rarely track side by side: peak-to-equity drawdown and single-day consistency caps. If a single winning session exceeds your prop firm consistency share (such as 30% of total net profit), payouts can be delayed or rejected even when equity stays positive.

PropFirm Consistency and Drawdown Monitor tracks daily drawdown, trailing total drawdown, and closed-bar consistency ratio in a lightweight chart HUD and exposes four iCustom buffers for automated Expert Advisors. Every ratio calculation guards denominators above 1e-9 and evaluates closed bars at shift >= 1 to prevent zero-divide faults and look-ahead bias.

Image for PropFirm Consistency and Drawdown Monitor

Smooth out market noise with the Heiken Ashi Expert Advisor for MT4 and MT5. Reliable trend-following automation. Details here.

iCustom Buffers and Closed-Bar Logic

Your EA reads closed-bar index InpClosedBarShift (default 1 , enforced >= 1 ) via CopyBuffer . Buffer 0 ( ExtStateBuf ) outputs monitor state ( 0 = OK, 1 = Warning at >=80% of any limit, 2 = Breach). Buffer 1 ( ExtDailyDdBuf ) outputs current daily drawdown percentage. Buffer 2 ( ExtTotalDdBuf ) outputs peak-to-equity total drawdown percentage. Buffer 3 ( ExtConsistencyBuf ) outputs the largest single-day profit share against total net profit (%).

EA Integration Snippet (MQL5)

int g_monitorHandle = INVALID_HANDLE;

int OnInit()
  {
   g_monitorHandle = iCustom(_Symbol, _Period, "PropFirm_Consistency_Drawdown_Monitor");
   if(g_monitorHandle == INVALID_HANDLE)
      return(INIT_FAILED);
   return(INIT_SUCCEEDED);
  }

bool IsRiskWithinLimits()
  {
   double stateBuf[1];
   if(CopyBuffer(g_monitorHandle, 0, 1, 1, stateBuf) <= 0)
      return(false);
   return((int)MathRound(stateBuf[0]) < 2);
  }

Input Parameters

Parameter Default Description
InpInitialBalance 100000.0 Initial account balance in account currency used as peak equity floor.
InpMaxDailyDdPct 5.0 Maximum allowed daily drawdown percentage before flagging a breach.
InpMaxTotalDdPct 10.0 Maximum allowed overall peak-to-equity drawdown percentage.
InpConsistencyCapPct 30.0 Maximum allowed single-day profit share of total net profit (%).
InpClosedBarShift 1 Closed bar shift used for evaluation (enforced >= 1 to avoid look-ahead bias).
InpLookbackDays 30 Closed trade history lookback window in calendar days for daily profit aggregation.
InpPanelX 20 Top-right HUD horizontal offset in pixels.
InpPanelY 20 Top-right HUD vertical offset in pixels.
InpShowHud true Toggle read-only chart HUD panel visibility.

Technical Scope

This indicator focuses on live chart drawdown and consistency telemetry plus iCustom state output. It does not execute orders, close positions, replay historical M1 tick curves, or audit external HTML backtest reports. For setup notes and related risk utilities, visit the prop-firm risk guide or my MQL5 profile.

Complement community code with advanced automation from RobotFX.

80205

Best MetaTrader Indicators + Profitable Expert Advisors