Equity monitors
An equity monitor watches the account's total equity. When the account connection reports that the threshold condition was met, Tradesync processes the selected action.
Supported connections
Equity monitors are evaluated by MetaTrader 4 and MetaTrader 5 terminal connections and by Direct connections for MetaTrader 4, MetaTrader 5, cTrader, DXtrade, Match-Trader, and TradeLocker. See Connected accounts for account types and connection methods.
Tradesync saves a new monitor as Active. The connection picks up the monitor during account reporting, evaluates its threshold, and reports a trigger. Check connection health if the account has stopped reporting.
Monitor types
| Type | Compares |
|---|---|
| Target value | Account equity against an upper monetary threshold |
| Protect value | Account equity against a lower monetary threshold |
| Target percentage | Account equity as a percentage of current balance plus credit against an upper threshold |
| Protect percentage | Account equity as a percentage of current balance plus credit against a lower threshold |
Monetary thresholds use the account's base currency. A target value of 11,000 on a GBP account watches for account equity of 11,000 GBP.
| Connection | Target triggers when equity or its percentage is | Protect triggers when equity or its percentage is |
|---|---|---|
| MetaTrader terminal | At or above the threshold | At or below the threshold |
| Direct | Above the threshold | Below the threshold |
For example, a protect value of 9,000 GBP can trigger at exactly 9,000 GBP on a MetaTrader terminal. A Direct connection triggers once it observes equity below 9,000 GBP.
How the equity percentage is calculated
Both integrations use current balance plus credit.
percentage basis = current balance + current credit
equity percentage = equity / percentage basis × 100
MetaTrader terminals round the percentage to their trade precision before comparing it and use zero when balance plus credit is zero. Direct compares the calculated percentage and skips percentage checks when balance plus credit is zero.
With balance 10,000, zero credit, and equity 11,000, the equity percentage is 110%. With the same balance and equity 9,000, it is 90%.
With balance 10,000, credit 1,000, and equity 11,000, the percentage is 100%. Credit changes the denominator.
The basis is recalculated as the account changes. Deposits, withdrawals, credit changes, and realised results can change the comparison.
Actions
| Action | What Tradesync requests when triggered |
|---|---|
| Alert | Record the completed monitor as an account event |
| Alert and disable copiers | Also turn Off copiers where the monitored account is the follower and cancel its queued commands |
| Alert, disable copiers and close all trades | Also create full-close commands for all trades currently recorded as open on the monitored account |
Readonly accounts can use Alert. The actions that disable copiers or close trades require a Full account.
Disabling copiers affects incoming copying relationships. It does not turn Off copiers where this account is the lead, or copiers on unrelated accounts. Queued-command cancellation applies to the monitored account's queued commands, including those created outside copying.
The close action is not restricted to copied trades. It targets all records currently marked open, including pending orders. The connection must perform the appropriate supported close or cancellation operation.
Completion and cancellation
An account can have one active monitor of each type. Different types can be active together, such as a target and a protection threshold.
When Tradesync processes a trigger, the monitor becomes Complete and records an equity_monitor_completed account event. A monitor completes once. Create another monitor when you need a new threshold. Cancelling an active monitor keeps the record with status Cancelled.
For the close action, Tradesync creates a separate full-close command for each record it has open at trigger time. The monitor can show Complete while close commands are still Working, and it stays Complete if any command is abandoned. For example, two positions and one pending order produce three close commands. Check each command's outcome, then check the account's trade history for actual closes or order cancellations. Execution conditions can affect the equity that remains after the trades close.
App guide and API reference
| Task | App guide | API docs |
|---|---|---|
| Create a monitor | Create equity monitor | Create equity monitor |
| Cancel an active monitor | Cancel equity monitor | Update equity monitor |
Some linked references are not currently available on this site.