Account Rule Keeper
- 유틸리티
- 버전: 1.0
- 활성화: 5
Account Rule Keeper watches the balance and equity of the whole account and enforces the limits you set: a daily loss limit, a maximum drawdown and, if you want, a profit target. When a limit is reached, it closes every open position, deletes every pending order and keeps the account flat until the lock ends. It does not open trades on your account and does not make trading decisions.
How the rules work
The daily loss limit can be set as a percent of the initial balance, a percent of the day's reference, or a fixed amount. The day's reference can be the balance at the daily reset, the equity at the reset, or the higher of the two. The reset time is set in the broker's server time. The balance at the reset is rebuilt from the deal history, so it stays correct if the terminal is started later in the day. Deposits and withdrawals move the day's reference by the same amount, so the daily loss limit treats them as neither loss nor gain. They move a trailing high-water mark too, but the mark never drops below the initial balance, and a trailing floor that stops rising at the initial balance does not rise past it. The static drawdown floor and the profit target stay tied to the initial balance. So a withdrawal can use up drawdown room, a deposit can add room to the static floor or a stopped trailing floor, and a deposit counts toward the profit target.
The maximum drawdown can be static from the initial balance, or trail the peak equity or the peak closed balance. A trailing floor can be set to stop rising at the initial balance.
A safety buffer makes the guard act a little before the limit, so that slippage while closing has room. A warning is raised once when a chosen share of an allowance is used, in the terminal and optionally as a push notification.
What happens on a breach
A daily loss breach locks the account until the next daily reset. A drawdown breach or a reached profit target locks it until you clear the stored state. While locked, any new position, manual or from another Expert Advisor, is closed as soon as it appears. The day's reference, the high-water mark and the locks are stored in the terminal, so a restart keeps them.
Limits you should know
The guard cannot stop an order from being sent; it closes positions after they open. It cannot guarantee that equity stays above a limit: gaps, closed sessions, fast markets and rejected orders can move equity past a limit before positions are closed. It works only while the terminal is running with Algo Trading enabled. Rules differ between the firms that run funded and evaluation accounts, so compare your firm's rules with the inputs before you rely on them.
When the terminal cannot read the deal history, or the history does not match the balance, the guard cannot tell a deposit from a trading result, so it pauses new trades until the history can be read again and matches. No limit needs to be reached for this. During the pause it closes positions opened and deletes pending orders placed since the pause started, and earlier positions and orders stay. On a netting account, where a trade adds to or reverses the symbol's one position, volume added to an earlier position during the pause is closed again by an opposite deal, back to the volume the position had when the pause started, where the symbol's minimum volume and filling modes allow such a deal. A position reversed during the pause is closed. The daily loss, drawdown and profit target rules keep running during the pause.
Strategy Tester demo
On its own in the Strategy Tester the guard has no trades to protect, so the demo opens random demonstration positions there and shows the guard closing them at the limits. These positions exist only in the tester. They are random and say nothing about any trading result.
Setup
Attach the guard to one chart of the account, enable Algo Trading, and enter the account size and your limits. Each input is named in plain English. To end a drawdown or profit target lock, set "Clear stored day reference, high-water mark and locks on start" to true.
