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

Metatrader 5 Indicator | Prop Firm Live Daily Breach Line (OrderCalcProfit and iCustom Ready) | MetaTrader …

RobotFX curates the best open-source MetaTrader code to inspire your trading automation.

Prop Firm Live Daily Breach Line is a lightweight chart indicator built for prop firm evaluations and funded accounts. It tracks your remaining daily drawdown buffer in account currency and draws a dynamic horizontal line (Daily Breach Level) on the chart. You can immediately see the exact price where your open net volume on the active symbol will hit the daily loss limit.

Simple tick-value calculators often drift on cross pairs or miss intraday commissions from closed trades. To solve this, the indicator reconstructs your exact 00:00 server-time balance from today's deal history and uses a two-step OrderCalcProfit() check so the breach price stays accurate across forex pairs, metals, and indices.

Image for Prop Firm Live Daily Breach Line (OrderCalcProfit and iCustom Ready)

Grid trading done right – try the robust Grid Expert Advisor for controlled risk. Details here.

How It Works

  • 00:00 Baseline Reconstruction (Entry and Exit Deals): When InpManualStartBase is left at 0.0, the indicator reads today's deal history starting from 00:00 server time (iTime PERIOD_D1). It reverses all realized profits, swaps, fees, and both entry (DEAL_ENTRY_IN) and exit (DEAL_ENTRY_OUT / INOUT / OUT_BY) commissions. A 5-second history cache prevents chart lag during fast market ticks.
  • 00:00 HWM Snapshot (Balance vs. Equity): Supports both Balance Only and Higher of Balance or Equity (00:00 HWM) reset rules. During the midnight rollover window, it locks a single terminal GlobalVariable snapshot so post-midnight equity spikes don't artificially push your daily floor higher.
  • OrderCalcProfit Price Calibration: Calculates net open volume (Buy Lots minus Sell Lots) on the current chart while floating P/L from other symbols is already included in Account Equity. After a first linear estimate, it validates the exact loss distance with MQL5's native OrderCalcProfit() function. If you're flat, hedged, or your lot size is too small to hit the limit even at zero price, the line hides automatically and shows the current status on the panel.
  • iCustom() Buffers for Expert Advisors: Provides two non-drawing buffers (DRAW_NONE) so your own EA can read the numbers directly without scanning chart objects: Buffer 0 returns the Breach Price on the active symbol (0.0 if flat or unreachable), and Buffer 1 returns the Remaining Daily Buffer in account currency ($).
  • DPI-Scaled Panel and Clean Removal: Displays a compact dark-slate HUD in the top-right corner scaled via TERMINAL_SCREEN_DPI, restores your original chart settings, and deletes all PFLBL_ objects cleanly in OnDeinit().

Input Parameters

Parameter Default Description
InpBaseMode BASE_HIGHEST_OF_BALANCE_EQUITY Daily reset rule at 00:00 server time (Higher of Balance/Equity HWM or Balance Only).
InpDailyLossPct 5.0 Maximum daily loss percentage relative to the 00:00 reference base.
InpManualStartBase 0.0 Manual 00:00 reference override in account currency (0.0 = auto reconstruct from history).
InpBreachLineColor clrCrimson Color of the horizontal daily breach line.
InpBreachLineStyle STYLE_SOLID Line style of the horizontal daily breach line.
InpBreachLineWidth 2 Width of the horizontal daily breach line.
InpPanelX / InpPanelY 20 / 20 Horizontal and vertical pixel offsets for the top-right HUD panel.

Technical Scope

This utility is strictly a live single-chart monitor for intraday trading. Offline Strategy Tester HTML report parsing, historical M1 drawdown replay, Prague CE(S)T timezone HWM simulation, and static .mq5 code auditing require a dedicated report parser (available in my MQL5 profile).

Level up your trading with professional RobotFX expert advisors and indicators. Visit robotfx.org for proven MT4/MT5 tools.

79080

Best MetaTrader Indicators + Profitable Expert Advisors