Daily Risk Protector MT5
- Utilitários
- Versão: 1.0
- Ativações: 5
DAILY RISK PROTECTOR MT5
Daily Risk Protector MT5 is a risk-control utility for MetaTrader 5. It monitors daily performance, account drawdown and user-defined limits. When a configured condition is reached, it can issue an alert or close the matching exposure and keep the selected scope locked until the next daily reset.
This utility does not open trades, generate signals or use an entry strategy. It is designed to work alongside manual trading, trading panels and other Expert Advisors.
MAIN FEATURES
-
Daily loss limit in account currency or percentage.
-
Daily profit target in account currency or percentage.
-
Maximum drawdown control based on balance, starting equity, highest equity or a custom reference.
-
Daily profit trailing with configurable activation and giveback.
-
Optional inclusion of floating profit and loss.
-
Optional inclusion of swaps and commissions.
-
Configurable daily reset based on server time.
-
Position closing and pending-order deletion.
-
Closing of matching new trades after a limit has been reached.
-
Alert-only mode without closing or locking.
-
Protection for the entire account, one Magic Number or one symbol.
-
Persistent protection state after terminal restart or utility reload.
-
Optional daily CSV history.
-
Optional popup alerts and push notifications.
-
Compact and advanced graphical panel.
HOW THE LOCK WORKS
When a configured rule reaches its limit, Daily Risk Protector MT5 can perform one of the following actions:
-
Alert Only: displays an alert without closing positions or enabling the lock.
-
Close and Lock: closes matching positions, deletes matching pending orders and locks the selected protection scope.
While the lock is active, any new trade matching the protected scope is detected and closed. The lock is automatically cleared at the next daily reset.
The Manual Unlock option can temporarily suspend the lock until the next reset. This action requires confirmation.
PROTECTION SCOPES
Entire Account
Monitors all account trades regardless of symbol or Magic Number. This is the recommended mode for general account-level protection.
Magic Number
Monitors only trades with the selected Magic Number. This can protect one Expert Advisor without affecting other strategies.
Symbol
Monitors only the configured symbol. The name must exactly match the broker symbol, including any prefix or suffix.
GRAPHICAL PANEL
The panel displays:
-
Current protection status.
-
Balance and equity.
-
Total daily profit and loss.
-
Closed and floating results in advanced mode.
-
Daily loss progress.
-
Daily profit progress.
-
Current drawdown.
-
Profit-trailing status.
-
Daily low and peak values.
-
Number of matching positions and orders.
-
Selected protection scope.
-
Time remaining until the next reset.
-
Lock reason.
-
CSV history location.
The Compact View and Advanced View buttons change the amount of information displayed.
INSTALLATION
-
Install the product from MQL5 Market.
-
Attach it to one MetaTrader 5 chart.
-
Enable Algo Trading to allow position closing and pending-order deletion.
-
Select the protection scope.
-
Configure the limits and daily reset time.
-
Confirm that the panel displays Protection Active.
-
Continue using your manual trades or other Expert Advisors normally.
For entire-account protection, one instance on one chart is normally sufficient. The chart symbol and timeframe do not change the protected scope when Entire Account is selected.
INPUT PARAMETERS
PROTECTION SCOPE
ProtectionScope: selects Entire Account, Magic Number or Symbol.
ProtectedMagicNumber: Magic Number monitored when the Magic Number scope is selected.
ProtectedSymbol: exact symbol monitored when the Symbol scope is selected.
DAILY LOSS LIMIT
EnableDailyLoss: enables or disables the daily loss limit.
DailyLossUnit: expresses the limit in account currency or percentage.
DailyLossValue: maximum daily loss amount or percentage.
LossPercentReference: percentage reference based on start-of-day balance, start-of-day equity, current balance or custom balance.
LossSafetyBufferMoney: reduces the effective loss limit by a monetary amount so protection can act earlier.
LossAction: selects Alert Only or Close and Lock.
DAILY PROFIT TARGET
EnableDailyProfit: enables or disables the daily profit target.
DailyProfitUnit: expresses the target in account currency or percentage.
DailyProfitValue: daily target amount or percentage.
ProfitPercentReference: reference used for percentage calculation.
ProfitSafetyBufferMoney: reduces the effective profit target so the selected action can be triggered earlier.
ProfitAction: selects Alert Only or Close and Lock.
MAXIMUM DRAWDOWN
EnableMaximumDrawdown: enables or disables maximum drawdown protection.
MaximumDrawdownUnit: expresses drawdown in account currency or percentage.
MaximumDrawdownValue: maximum permitted drawdown.
DrawdownAnchor: selects start-of-day balance, start-of-day equity, highest observed equity or custom balance.
CustomReferenceBalance: balance used by custom reference options.
DrawdownSafetyBufferMoney: reduces the effective drawdown limit so the action can be triggered earlier.
DrawdownAction: selects Alert Only or Close and Lock.
DAILY PROFIT TRAILING
EnableProfitTrailing: enables or disables daily profit trailing.
ProfitTrailUnit: expresses activation and giveback in money or percentage.
ProfitTrailActivation: daily profit required to arm the trailing function.
ProfitTrailGiveback: permitted reduction from the daily peak after activation.
TrailPercentReference: reference used when trailing values are expressed as percentages.
ProfitTrailAction: action applied when daily profit reaches the calculated trailing floor.
P/L CALCULATION AND DAILY RESET
IncludeFloatingPL: includes open-position profit and loss in the daily result.
IncludeSwapCommissionFees: includes available swaps and commissions in calculations.
DailyResetHour: daily reset hour based on server time.
DailyResetMinute: daily reset minute.
LOCK EXECUTION
CloseMatchingPositions: closes matching positions when the lock is triggered.
DeleteMatchingPendingOrders: deletes matching pending orders.
MaxDeviationPoints: maximum permitted deviation during position closing.
CloseRetryCount: number of closing attempts.
RetryDelayMilliseconds: delay between attempts.
LockCheckMilliseconds: monitoring interval while locked.
PLCheckMilliseconds: profit and loss calculation interval.
AllowManualUnlock: displays the manual unlock button.
HISTORY AND NOTIFICATIONS
SaveDailyCSVHistory: saves the daily summary to a CSV file.
HistoryFileName: file name created in the Common Files folder.
PopupAlert: enables terminal popup alerts.
PushNotification: enables push notifications configured in MetaTrader 5.
PANEL
ShowGraphicalPanel: shows or hides the panel.
StartPanelInAdvancedMode: starts the panel in advanced mode.
PanelX and PanelY: panel position.
PanelWidth: panel width.
PanelBackground and PanelTextColor: panel colors.
IMPORTANT INFORMATION
Daily Risk Protector MT5 requires the terminal to remain open and connected, with Algo Trading enabled, to close positions or delete pending orders. It cannot act when the platform is disconnected, the market is closed, trading is unavailable for a symbol or the broker rejects a request.
Closing operations can be affected by latency, slippage, price gaps, liquidity and broker conditions. The utility helps enforce user-defined limits, but it cannot guarantee an exact exit price or prevent every loss.
Test the configuration in the Strategy Tester or on a demo account before using it on a live account.
