Prop Guard

  • librerie
  • Shipra Gupta
    Shipra Gupta
    Sono Shipra Gupta, trader e sviluppatrice di strategie quantitative con una solida formazione in matematica, economia e sistemi di trading algoritmico. Nel corso degli anni ho lavorato ampiamente nei mercati forex, oro, indici, materie prime e criptovalute, concentrandomi sulla costruzione di
  • Versione: 1.0

PropGuard – Prop-Firm Rule Engine for Any EA

Turn any EA into a prop-firm-safe EA. PropGuard tracks the rules challenge accounts are judged on and stops your strategy before it breaks them.

Features

  • Daily loss limit – Balance or max(balance, equity) basis, with your firm's reset hour.
  • Max loss modes – Static, end-of-day trailing or intraday trailing, with optional lock at the start balance.
  • Safety buffer & warnings – Stop before the limit, not at it. Breach states stay locked for the day or the account.
  • Room-aware sizing – PG_SafeLots() caps risk to the room left and respects volume min/max/step/limit and free margin.
  • Open-risk aware – PG_CanOpen() adds the stop risk of every open position before allowing a new one.
  • Challenge tools – Flatten-all by magic, profit-target detection, trading-day counter, consistency ratio. State survives restarts without files.

Quick start

1. Buy and download the library. MetaTrader installs it to MQL5\Libraries\PropGuard.ex5.
2. Paste the import block below at the top of your EA, indicator or script.
3. Call the functions.

int OnInit()
  {
   if(!PG_Init(0,5,10,PG_DD_STATIC,true,10,PG_BASIS_MAXBE,0,0.5,25))
      return(INIT_PARAMETERS_INCORRECT);
   return(INIT_SUCCEEDED);
  }
void OnTick()
  {
   if(PG_Update()>=PG_DAILY_BREACH) { PG_CloseAll(-1); return; }
   double lots=PG_SafeLots(_Symbol,ORDER_TYPE_BUY,ask,sl,0.5,0.5);
   if(lots>0.0 && PG_CanOpen(risk_money)) trade.Buy(lots,_Symbol,0,sl);
  }

Import block (copy into your code)

#define PG_OK              0
#define PG_WARN            1
#define PG_DAILY_BREACH    2
#define PG_MAX_BREACH      3
#define PG_TARGET_HIT      4
#define PG_NOT_INIT       -1
#define PG_ERR_NONE        0
#define PG_ERR_PARAM       1
#define PG_ERR_NOTINIT     2
#define PG_ERR_SYMBOL      3
#define PG_ERR_CALC        4
#define PG_ERR_MARGIN      5
#define PG_ERR_NOROOM      6
#define PG_ERR_TRADE       7
#define PG_DD_STATIC       0
#define PG_DD_TRAIL_EOD    1
#define PG_DD_TRAIL_INTRA  2
#define PG_BASIS_BALANCE   0
#define PG_BASIS_MAXBE     1

#import "PropGuard.ex5"
int PG_LastError();
bool PG_Init(const double initial_balance,const double daily_loss_pct,const double max_loss_pct, const int dd_mode,const bool lock_at_initial,const double profit_target_pct, const int daily_basis,const int reset_hour_server,const double safety_buffer_pct, const double warn_room_pct);
void PG_SetMagic(const ulong magic);
int PG_Update();
int PG_Status();
double PG_DailyFloor();
double PG_MaxFloor();
double PG_Room();
double PG_DailyPnL();
bool PG_CanOpen(const double risk_money);
double PG_SafeLots(const string symbol,const ENUM_ORDER_TYPE type,const double entry,const double sl, const double risk_pct,const double room_share);
int PG_CloseAll(const long magic);
int PG_TradingDays(const datetime from);
double PG_ConsistencyRatio(const datetime from);
string PG_StatusName(const int status);
string PG_Report();
void PG_ResetState();
#import

Notes

  • Rules differ by firm. Set the inputs to match your firm's published rules.
  • Works on hedging and netting accounts, any account currency.
  • Close requests are throttled; trade permissions are checked before each request.

Technical

  • Pure MQL5. No DLL, no WebRequest, no file I/O.
  • Every exported function validates its inputs. PG_LastError() returns the reason for any failed call.
  • Works in the Strategy Tester and live, on any broker, symbol and account currency.

Past performance shown in screenshots is from historical data and does not guarantee future results.


Altri dall’autore
AMD Po3
Shipra Gupta
AMD Po3 for MetaTrader 5 Accumulation, manipulation, distribution: mapped for you. AMD Po3 is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator maps the reaction zones that matter right now: the nearest areas above and
KN Smart TP SL Signals — Incrocio EMA + TP/SL Smart KN Smart TP SL Signals è un indicatore pulito di incrocio EMA per MetaTrader 5 che trasforma ogni incrocio confermato in un setup operativo visivo completo: Entry → Stop Loss → TP1 → TP2 → TP3 Non è necessario calcolare manualmente i livelli. Logica principale La Fast EMA incrocia sopra la Slow EMA → Acquisto La Fast EMA incrocia sotto la Slow EMA → Vendita I segnali vengono confermati sulle candele chiuse , evitando segnali generati dalla can
IFVG Sniper Entry Engine — Descrizione per il Marketplace MQL5 IFVG Sniper Entry Engine è un indicatore MT5 di precisione sviluppato attorno a uno dei modelli di ingresso più specifici e ad alta probabilità di Smart Money Concepts: l'Inverse Fair Value Gap (IFVG). Monitora silenziosamente ogni Fair Value Gap grezzo formato sul grafico, controlla ciascuno di essi per verificarne l'inversione (mitigazione) e, nel momento in cui viene confermato un IFVG valido, emette un segnale di ACQUISTO (BUY) o
Coppock Curve MultiFilter for MetaTrader 5 The classic Coppock curve with modern filters. Coppock Curve MultiFilter is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with
FREE
Tension Flow Trend — Nastro HMA Dinamico con Backtest Storico RR Tension Flow Trend è un indicatore di trend-following avanzato per MetaTrader 5 che combina un nastro di tendenza basato sulla Media Mobile di Hull (HMA), un'analisi del momentum Z-Score e un motore di backtesting visivo del rapporto Rischio:Rendimento (Risk:Reward) integrato in un unico overlay sul grafico. Progettato per identificare opportunità di continuazione del trend ad alta probabilità, l'indicatore filtra il rumore del mer
FREE
Adaptive RSI Supertrend for MetaTrader 5 Trend and RSI momentum in one view. Adaptive RSI Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
FREE
Trend Target Ribbon [BOSWaves] Trend Target Ribbon [BOSWaves] , MetaTrader 5 (MQL5) için geliştirilmiş gelişmiş ve çok yönlü bir trend takip ve risk yönetimi göstergesidir. Pürüzsüzleştirilmiş Arnaud Legoux Moving Average (ALMA) çekirdeğini volatilite ve eğim tabanlı doğrulama filtreleriyle birleştirerek piyasa trendlerini, renk kodlu dinamik ribbon'ları ve otomatik çok seviyeli Risk-to-Reward ($R$) işlem projeksiyonlarını gösterir. Temel Özellikler 1. ALMA Trend Ribbon ve Eğim Filtreleme ALMA S
FREE
Structure-Anchored VWAP [WAT] Structure-Anchored VWAP [WAT] è un indicatore VWAP per MetaTrader 5 basato sulla struttura del mercato. Ancora il VWAP a swing e punti strutturali significativi invece di affidarsi esclusivamente a reset fissi della sessione. Combina Struttura di Mercato + Anchored VWAP + Bande di Deviazione + Segnali di Retest + Gestione del Trade basata su ATR in un unico framework visivo. Caratteristiche principali 3 modalità di ancoraggio — Swing, Structure e Fast Rilevament
FREE
Liquidity Intelligence System — Descrizione per il Marketplace MQL5 Liquidity Intelligence System è un indicatore MT5 di livello istituzionale che mappa i pool di liquidità dello Smart Money, rileva le configurazioni di caccia alla liquidità e inversione (sweep-and-reverse) e genera segnali di trading ad alta confluenza attraverso 16 modelli di segnale testabili in modo indipendente, il tutto all'interno di un unico indicatore pulito. Come Funziona Il motore costruisce continuamente una mappa de
Precision Sniper Trader Precision Sniper Trader è un indicatore professionale di trend-following e conferma del momentum, progettato per i trader che desiderano un'esecuzione pulita sui grafici, ingressi ad alta probabilità e una gestione strutturata delle operazioni nei mercati Forex, Oro, Indici e Criptovalute. Sviluppato con un approccio in stile "sniper" (cecchino), l'indicatore combina l'analisi del trend basata su EMA, la conferma del momentum, target dinamici basati sull'ATR e un filtragg
FREE
TrendIQ Pro for MetaTrader 5 Adaptive volatility trend with a trend cloud. TrendIQ Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull colour for long
INDICATORE SQUEEZE MOMENTUM BREAKOUT MT5 Sistema di Trading Professionale di Compressione della Volatilità e Breakout del Momentum per MetaTrader 5 Squeeze Momentum Breakout è un indicatore di breakout di livello professionale per MT5 progettato per rilevare movimenti di mercato esplosivi dopo periodi di consolidamento a bassa volatilità. Sviluppato per scalper, trader intraday e momentum trader, l'indicatore combina la compressione della volatilità, la conferma del momentum, il filtraggio dei v
FREE
INDICATORE VOLUME BREAKOUT PRO MT5 Sistema di Trading Professionale di Espansione del Volume e Breakout per MetaTrader 5 Volume Breakout Pro è un indicatore di breakout di livello istituzionale sviluppato specificamente per la piattaforma MetaTrader 5. Progettato per scalper, day trader e momentum trader, il sistema si concentra sull'identificazione di movimenti di prezzo esplosivi guidati da un'espansione anomala del volume e da uno squilibrio di liquidità. L'indicatore combina: Logica dell'Osc
FREE
Meridian Flow — Indicatore Smart Money Structure per MT5 Meridian Flow è un indicatore per MetaTrader 5 progettato per i trader che utilizzano Smart Money Concepts (SMC) e la metodologia ICT Price Action . Rileva automaticamente gli eventi BOS (Break of Structure) e CHoCH (Change of Character) su qualsiasi strumento e timeframe, quindi traccia una mappa completa del rischio — Entry, Stop Loss, TP1, TP2 e TP3 — per ogni segnale, inclusi quelli storici. I segnali vengono generati esclusivamente s
Adaptive Trend System for MetaTrader 5 A trend line that adapts to volatility. Adaptive Trend System is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
Market Path Forecast for MetaTrader 5 Projected price paths from swing statistics. Market Path Forecast is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how price b
FREE
RSI Signal Entries for MetaTrader 5 RSI extremes plus candle confirmation. RSI Signal Entries is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with clear extreme zones.
FREE
Trident Swing Projector for MetaTrader 5 Quarter-swing projections from ABC structures. Trident Swing Projector is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how
Z-Score Range Boxes Breakout for MetaTrader 5 Statistical extremes boxed, breakouts flagged. Z-Score Range Boxes Breakout is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator tracks the range or channel price is tradin
Precision Sniper Pro for MetaTrader 5 Four pillars: EMA, RSI, MACD and ADX. Precision Sniper Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator watches for its signal condition and waits for the candle to close b
FREE
Stealth Trail Supertrend for MetaTrader 5 A supertrend that adapts its own multiplier. Stealth Trail Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the tre
Fibonacci Path Profile for MetaTrader 5 How price moved after similar retracements. Fibonacci Path Profile is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how pric
Strong Fade Signals for MetaTrader 5 Fade the overextended move, with a score. Strong Fade Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator watches for its signal condition and waits for the candle to close
FREE
Fan Principle Signals for MetaTrader 5 The classic fan principle, as clear signals. Fan Principle Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and tracks how price
McGinley Dynamic Fusion for MetaTrader 5 McGinley Dynamic crossovers with ATR levels. McGinley Dynamic Fusion is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend
Liquidity Entry Signals for MetaTrader 5 Entries where liquidity gets taken. Liquidity Entry Signals is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator maps the reaction zones that matter right now: the nearest areas
Cardwell Range Pro for MetaTrader 5 RSI ranges that change with the market regime. Cardwell Range Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator plots its oscillator in a separate subwindow with clear extreme
Adaptive RSI Supertrend for MetaTrader 5 Trend and RSI momentum in one view. Adaptive RSI Supertrend is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator draws one trend line that changes colour with the trend: bull co
Market Structure Target Tracker for MetaTrader 5 Swings, BOS, CHoCH and ATR targets. Market Structure Target Tracker is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator detects confirmed swing highs and lows and track
Smart TrendFlow Pro for MetaTrader 5 Channel breaks with a volatility heatmap. Smart TrendFlow Pro is a MetaTrader 5 indicator built for traders who want clear, rule-based chart reading without clutter. It focuses on one job and does it visibly on your chart, so you can make decisions faster and with more confidence. It works on gold (XAUUSD), forex, indices and crypto, on any timeframe from M5 to D1. How it works The indicator tracks the range or channel price is trading in and highlights per
Filtro:
Nessuna recensione
Rispondi alla recensione