Global Account Risk Manager
- ユーティリティ
- バージョン: 1.51
- アクティベーション: 10
Global Account Risk Manager applies account-level risk rules to a MetaTrader 5 account. It watches every open position and pending order on the account and closes everything when a limit that you define is reached. It does not open trades and it does not generate signals.
It is intended for traders who run several Expert Advisors, or EAs together with manual trades, and want one place to set rules for the whole account instead of configuring each EA separately.
Works on any chart
Attach it to one chart: any symbol, any timeframe. The chart you choose has no effect on the limits. The EA reads account data, not chart data, and it checks the account on a timer (every 250 ms by default), so it keeps working even if the symbol of that chart receives no ticks. It manages all symbols and all magic numbers, including manual trades. Use one copy per account: a second copy refuses to start while the first one is active.
Limits (every limit set to 0 is disabled)
Floating profit target: closes everything when the total floating profit reaches the value.
Floating loss limit: closes everything when the total floating loss reaches the value.
Daily loss limit: closes everything when the result of the day reaches the loss value.
Daily profit target: closes everything when the result of the day reaches the target.
Daily trailing: once the result of the day reaches the activation level, everything is closed if the result falls back by the give-back amount from the peak of the day. Both values are required.
Maximum total drawdown: closes everything when equity falls below the reference capital by the set amount. The reference capital is taken from the deposits and withdrawals in the account history, or you can enter it manually.
All values are in account currency.
How the result of the day is calculated
Result of the day = trades closed today (profit, swap, commission and fees) + current floating result - floating result carried over from the previous day (measured at server midnight). Days start at 00:00 server time. Positions held overnight are handled, so yesterday's floating result is not counted as today's.
When a limit is reached
All positions are closed and all pending orders are deleted. If the broker rejects a request, the EA retries.
Optional lock: while the lock is active, any new position or order is closed as soon as it appears. This prevents other EAs from reopening trades right after the close. The lock lasts until 00:00 server time or for a number of hours that you set.
The daily loss, daily target, daily trailing and total drawdown limits always lock. For the floating loss and floating target you choose whether to lock.
The lock is kept if the terminal or the EA is restarted. An input removes an active lock when the EA starts.
Optional alert and push notification with the reason for the close.
On-chart panel
Large panel (covers the chart) or compact text panel. It shows status (monitoring, closing, locked), balance, equity, open positions and pending orders, result of the day, day peak, day low, floating result, trades closed today, every active limit with the amount remaining, and the last trigger.
Daily statistics
The EA stores the peak, low and close of each day and shows the last days in a table. After 10 days of data it shows typical values (peak, close, low, give-back from the peak) as reference for choosing limits. These values are informative only and are never applied automatically.
System warnings
An on-screen warning appears if the terminal has no connection to the broker or if algorithmic trading is disabled, because in those cases the EA cannot close positions.
Inputs
Floating P/L: floating profit target, floating loss limit.
Account limits: daily loss limit, maximum total drawdown, reference capital (0 = automatic).
Daily target and trailing: daily profit target, trailing activation, trailing give-back.
Daily statistics: enable statistics, number of days to use.
Lock after closing: lock after floating target, lock after floating loss, lock duration in hours (0 = until 00:00 server time), remove an active lock at start.
General: also delete pending orders, maximum deviation when closing (points), check interval (ms), alerts and push notifications, show panel, large panel.
Examples
Daily loss limit 200: closed trades of the day are -120 and the floating result reaches -80. The result of the day is -200, so everything is closed and the account stays locked until 00:00 server time.
Trailing with activation 100 and give-back 40: the day reaches +150 and then falls to +110. Everything is closed and the account is locked.
Quick start
1. Enable algorithmic trading in the terminal.
2. Attach the EA to any chart.
3. Set the limits you need in the Inputs tab and leave the others at 0. To change them later, select the chart where the EA runs and press F7.
4. Keep the terminal running and connected. A VPS is recommended.
Changing the inputs while the EA is running restarts it and the limits are applied with the new values. An active lock is kept after the restart. If the input that removes a lock at start is enabled, the lock is removed every time the EA restarts, including when you change the inputs. Leave that input disabled in normal use.
Requirements and limitations
Positions are closed at market price. Slippage, gaps, closed markets or broker rejections can make the final result differ from the configured limit.
If the terminal is closed or disconnected, the EA cannot act.
The EA does not guarantee that a limit will not be exceeded and it does not replace stop losses.
The panel in large mode covers the candles of the chart where it runs. Use a spare chart or switch to the compact panel.
Questions and bug reports: use the comments section of this page or private messages.
