Prop Firm Risk Guard
- Utilità
- Nguyen Thanh Trieu
- Versione: 1.1
- Aggiornato: 19 gennaio 2026
- Attivazioni: 10
What It Does
Monitors your equity drawdown and closes all positions automatically when your limit is reached. Attach once, set your limits, trade without worrying about breaching your funded account rules.
Features
- Daily drawdown monitoring (equity-based, not balance)
- Maximum account drawdown protection
- Profit lock to preserve daily gains
- News event filter (high-impact only)
- Real-time panel with status display
- One-click panic close button
How It Works
Daily Drawdown Calculation
The utility calculates your daily drawdown from equity, not balance. This matches how most prop firms calculate their limits. At the configured daily reset hour (broker server time), the baseline equity is recorded. Drawdown is calculated as the percentage drop from this baseline.
When drawdown reaches your configured daily limit, all open positions are closed immediately using asynchronous order execution for speed. Trading on the chart is then locked until the next daily reset or manual reset via the panel button.
Maximum Account Drawdown
Separately tracks your total account drawdown from the initial balance you specify. This protects against breaching the overall account loss limit. When this threshold is reached, all positions are closed and trading is locked permanently until the utility is restarted.
Profit Lock System
When your daily profit reaches the configured trigger level, the utility activates a trailing protection. For example, if you set the trigger at 2% and offset at 1%, once your daily profit reaches 2%, a lock is set at 1%. If profit then falls back to 1%, positions are closed to preserve that gain.
The lock level moves up as profit increases. If profit reaches 3%, the lock moves to 2%. This creates a ratchet effect that prevents giving back locked profits.
News Event Filter
Integrates with the MQL5 Economic Calendar to identify high-impact news events. During the buffer period you configure (default 5 minutes before and after), any new positions opened will be closed immediately. This helps avoid exposure during periods of high volatility.
Ghost Stop Loss
Optional feature that monitors your positions internally without sending visible stop orders to the broker. When price reaches your configured ghost SL or TP level, the position is closed at market. This can be useful if you prefer not to show your stops to the broker.
On-Chart Panel
The panel displays in real-time:
- Current account equity
- Daily drawdown percentage with color indicator
- Maximum drawdown percentage with color indicator
- Daily baseline equity value
- Profit lock status and current lock level
- News filter status
- Ghost SL/TP status
- Overall risk status
Status colors:
- Green - Safe, drawdown within normal range
- Orange - Warning, approaching your limits
- Red - Locked, limit reached or manually locked
Panel buttons:
- Panic Close - Immediately closes all open positions
- Reset - Clears daily lock and resets baseline equity
Input Parameters
Daily Drawdown Settings
- MaxDailyLossPercent - Your daily drawdown limit in percent. Set this to match your funded account rules. Default: 5.0
- DailyResetHour - The server hour when the daily equity baseline resets. Match this to your broker/prop firm reset time. Default: 0 (midnight)
Maximum Account Drawdown
- MaxAccountLossPercent - Your maximum total account loss limit in percent. Default: 10.0
- InitialBalance - Your funded account starting balance. Set to 0 to use the current account balance when the utility starts. Important: Set this correctly if your account has already been traded.
Profit Lock Settings
- ProfitLockTrigger - Daily profit percent that activates the lock. Default: 2.0
- ProfitLockOffset - Buffer below current profit for the lock level. Default: 1.0
News Filter Settings
- EnableNewsBlocker - Enable or disable the news event filter. Default: true
- NewsBufferMinutes - Minutes before and after high-impact news events to block trading. Default: 5
Ghost SL/TP Settings
- EnableGhostSL - Enable or disable ghost stop management. Default: false
- GhostSLPoints - Ghost stop loss distance from entry in points. Default: 500
- GhostTPPoints - Ghost take profit distance from entry in points. Default: 1000
Panel Settings
- PanelX - Horizontal position of the panel on chart. Default: 20
- PanelY - Vertical position of the panel on chart. Default: 50
Installation
- Download the product directly from the MQL5 Market tab in your terminal.
- Open the Navigator (Ctrl+N) and find the utility under "Expert Advisors" -> "Market".
- Drag and drop the utility onto ANY single chart (e.g., EURUSD).
- Ensure the "Algo Trading" button on the top toolbar is enabled (Green).
- Configure the input parameters to match your specific funded account rules.
Usage Recommendations
- Attach to one chart only. The utility monitors all positions across all symbols on the account.
- Set MaxDailyLossPercent slightly below your actual prop firm limit to provide a safety buffer.
- If your prop firm resets at a specific time, set DailyResetHour to match (in broker server time).
- If you already have floating profit or loss when attaching, the utility records current equity as baseline.
- Check the log file (PropFirmRiskGuard.log in Files folder) to review all protective actions taken.
Technical Information
- Single chart attachment with account-wide position monitoring
- Uses OrderSendAsync for fast asynchronous position closure
- Automatic retry with exponential backoff for failed order execution
- Falls back to synchronous close after maximum retry attempts
- All actions logged to terminal journal and file
- Timer-based monitoring with 1-second interval
- Compatible with hedging and netting account types
- Works alongside manual trading and other Expert Advisors
Notes
- Daily lock is automatically cleared at the next daily reset time.
- You can also clear daily lock manually using the Reset button on the panel.
- Maximum drawdown lock is permanent and requires restarting the utility to clear.
- The utility cannot physically prevent order execution, but it closes unauthorized positions immediately upon detection.
- When locked, the one-click trading panel on the chart is hidden to reduce accidental trades.
