Skip to content
These docs describe Tradr v0.17.0. Running an older release? Check the release notes for what changed.

Replace a trading rule.

PUT
/api/trading-rules/{id}
curl --request PUT \
--url https://api.tradr.cloud/api/trading-rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--data '{ "accountId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "definition": { "params": {}, "type": "example" }, "enabled": true, "tagId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "weight": "critical" }'

Authed. A full replacement — the whole rule, definition included, is sent. The same scope, currency and duplicate rules apply as on create.

id
required
string format: uuid
Media typeapplication/json
object
accountId
required
string format: uuid
nullable
definition
required
object
params
required
object
type
required
string
enabled
required
boolean
tagId
required
string format: uuid
nullable
weight
required
string
Allowed values: critical important nice_to_have

The updated rule.

Validation error

No valid session.

No such rule for this user.

TRADING_RULE_DUPLICATE — a rule with the same type, scope and parameters already exists.