//+------------------------------------------------------------------+ //| SovereignDrawdownGuard.mq5 | //| Copyright 2026, PropTraderPulse & PPC | //| https://proptraderpulse.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Sovereign Quant Desk (PropTraderPulse.com)" #property link "https://proptraderpulse.com" #property version "2.60" #property description "Real-Time Daily Drawdown Guard & Safe Lot Calculator for FundedNext (Code: JESSOFFER), The 5%ers (Partner: 1hmg), Instant Funding (Partner: 8970) & Apex (Code: TRENDS)." input double InpDailyDrawdownPct = 5.0; // Max Daily Drawdown Limit (%) input double InpSafeStopPct = 4.0; // Soft Lock Warning Threshold (%) input double InpDefaultRiskPct = 0.50; // Default Risk Per Trade (%) input int InpDefaultStopPips = 15; // Default Stop Loss (Pips) double g_dayStartBalance = 0.0; int g_lastDayOfYear = -1; int OnInit() { MqlDateTime dt; TimeCurrent(dt); g_lastDayOfYear = dt.day_of_year; g_dayStartBalance = AccountInfoDouble(ACCOUNT_BALANCE); EventSetTimer(2); RenderHUD(); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { EventKillTimer(); Comment(""); } void OnTick() { RenderHUD(); } void OnTimer() { RenderHUD(); } void RenderHUD() { MqlDateTime dt; TimeCurrent(dt); if(dt.day_of_year != g_lastDayOfYear) { g_lastDayOfYear = dt.day_of_year; g_dayStartBalance = AccountInfoDouble(ACCOUNT_BALANCE); } double equity = AccountInfoDouble(ACCOUNT_equity); double balance = AccountInfoDouble(ACCOUNT_BALANCE); double maxDailyLossUsd = g_dayStartBalance * (InpDailyDrawdownPct / 100.0); double breachEquity = g_dayStartBalance - maxDailyLossUsd; double currentDdUsd = g_dayStartBalance - equity; double currentDdPct = (currentDdUsd > 0) ? (currentDdUsd / g_dayStartBalance) * 100.0 : 0.0; double remainingBufferUsd = equity - breachEquity; double riskUsd = balance * (InpDefaultRiskPct / 100.0); double safeLots = riskUsd / (InpDefaultStopPips * 10.0); string status = "SAFE TO TRADE (OPTIMAL EV)"; if(currentDdPct >= InpSafeStopPct) status = "WARNING: SOFT DAILY STOP REACHED - HALT TRADING!"; string hud = "========================================================\n"; hud += " SOVEREIGN PROP DRAWDOWN GUARD HUD v2.6 (MT5) \n"; hud += "========================================================\n"; hud += StringFormat(" Prior Day / Start Balance : $%.2f\n", g_dayStartBalance); hud += StringFormat(" Current Floating Equity : $%.2f\n", equity); hud += StringFormat(" Hard Daily Breach Level : $%.2f (-%.1f%%)\n", breachEquity, InpDailyDrawdownPct); hud += StringFormat(" Remaining Daily Buffer : $%.2f (Used: %.2f%%)\n", remainingBufferUsd, currentDdPct); hud += StringFormat(" Recommended Max Lot Size : %.2f Lots (%.2f%% Risk @ %d pips)\n", safeLots, InpDefaultRiskPct, InpDefaultStopPips); hud += "--------------------------------------------------------\n"; hud += " STATUS: " + status + "\n"; hud += "--------------------------------------------------------\n"; hud += " VERIFIED 2026 REBATE VAULT (PropTraderPulse.com): \n"; hud += " * FundedNext (150% Refund + 15% Eval Split): JESSOFFER \n"; hud += " * The 5%ers (True Static 10% Floor to $4M) : Partner 1hmg\n"; hud += " * Instant Funding (Zero Eval / Day 1 Live) : Partner 8970\n"; hud += " * Apex Futures (80%-90% Off 20 Accounts) : TRENDS \n"; hud += "========================================================\n"; Comment(hud); }