API reference
Create equity monitor
POST
https://api.tradesync.com/equity-monitorsSave an active equity monitor for an account. The account connection evaluates the threshold and reports the trigger. See Equity monitors for supported connections and percentage calculation.
Last updated
Request body
- account_idType: integerRequired: Yes
- Tradesync account ID belonging to the authenticated userAccepted values / limits: At least 1
- typeType: stringRequired: Yes
- Equity trigger typeAccepted values / limits: See Types below
- valueType: numberRequired: Yes
- Threshold in base-currency units or percentage, according to typeAccepted values / limits: 0.00000001 to 9999999999; up to 8 decimal places
- actionType: stringRequired: Yes
- Readonly accounts accept only alertAccepted values / limits: See Actions below
Types
| Value | Description |
|---|---|
| target_value | Upper equity threshold in the account's base currency |
| target_percentage | Upper equity threshold as a percentage of current balance plus credit |
| protect_value | Lower equity threshold in the account's base currency |
| protect_percentage | Lower equity threshold as a percentage of current balance plus credit |
MetaTrader terminal connections include equality. Direct connections trigger strictly above a target or strictly below a protect threshold.
Actions
| Value | Description |
|---|---|
| alert | Record an equity_monitor_completed account event |
| alert_disable_copiers | Record the event, turn Off copiers where this account is the follower, and cancel its queued commands |
| alert_disable_copiers_close_trades | Apply the same actions and create a full-close command for each record currently marked open, including pending orders |
See Get equity monitor for status meanings and the steps to trace close requests.
Response example
{
"result": "success",
"status": 200,
"data": {
"id": 64172,
"created_at": "2025-04-23T14:52:31Z",
"updated_at": "2025-04-23T14:52:31Z",
"account_id": 1241453,
"status": "active",
"type": "protect_value",
"value": 5001300,
"action": "alert_disable_copiers_close_trades"
}
}
Errors
| Code | HTTP status | Condition |
|---|---|---|
| invalid_type_for_readonly_accounts | 422 | A readonly account was supplied with an action other than alert. |
| equity_monitor_active | 422 | An active monitor of this type already exists for the account. |
See also common response codes.