Update Strategy
tt_update_strategyApply edits to an existing strategy and save.
LIVE-EDIT CONFIRM GATE: if this template is DEPLOYED, has SUBSCRIBERS, or is PUBLIC, a non-dry-run call refuses once with LIVE_EDIT_CONFIRMATION_REQUIRED — carrying the blast radius, the live-position consequences, and a copy alternative. RELAY those to the user, ask one confirm question, and only after the user explicitly agrees re-call with the SAME arguments plus live_edit_confirmed=true. Never set it on your own initiative.
MODIFY WORKFLOW (read this before any edit — there is NO rollback):
tt_get_strategy() FIRST and keep the result. It is your only snapshot; nothing here can undo a write. (tt_get_strategy also re-validates the STORED strategy, so it doubles as a health check on what is live right now.)
Rehearse with dry_run=True. Same validation, no write.
Apply, then re-read to confirm what actually persisted. Prefer tt_apply_strategy_patch for a surgical single set/condition/leg change; this tool replaces whole top-level fields,
setsincluded.
Heads-up when diffing before/after: a create/patch INJECTS blank
Add Repair / Exit envelopes into each set as scaffolding, so a
strategy read back will show conditions you did not author. They are
inert placeholders, not a bug and not content loss.
A sets replacement that would REMOVE the strategy's Universal Exit
is refused (STRATEGY_EDIT_UE_REMOVED) unless
allow_universal_exit_removal=True — pass it only when the user
explicitly wants the UE gone.
Edits top-level scalar fields (name, description, capital_required,
currency, max_multiple / min_multiple, exit settings, tags,
python_code, etc.) AND — since 2026-06-29 — a full sets replacement
(structural). A structural edit routes through the clean create-shape +
content-preservation check; if TT silently drops content it FAILS LOUD
(STRATEGY_UPDATE_CONTENT_DROPPED). For SURGICAL add/remove/modify of an
individual set/condition/leg, prefer tt_apply_strategy_patch. Do NOT
recreate the strategy. Pass the TEMPLATE id, not a deployed SID — they
are both 8-digit numbers and cannot be told apart by shape; get the
template id from tt_list_my_strategies or a strategy's edit URL.
Call tt_list_editable_fields() to see the full list of allowed keys.
Args:
strategy_id: integer ID from a prior create or list call.
edits: dict of {top-level-field: new-value}. Non-empty. sets (the
whole array) is allowed for structural changes.
dry_run: validate and report what WOULD change without writing.
Defaults to False (this tool writes by default, unlike
tt_apply_strategy_patch). A dry run cannot predict a
SERVER-side content drop — only the real POST can.
live_edit_confirmed: set True ONLY after the user has been shown
the LIVE_EDIT_CONFIRMATION_REQUIRED blast radius and
consequences and explicitly agreed to edit the live
template. Never set it on your own initiative.
exchange_brokers: {exchange: broker_id}, e.g. {"BFO": 1021}. Send
ONLY after a STRATEGY_EXCHANGE_BROKER_REQUIRED refusal, with
the broker the USER picked from that error's
details.missing[].brokers for each exchange. Tradetron then
adds the broker to the user's running deployments of this
template. Never guess or pick one yourself.
Returns on success: {"ok": True, "data": {"id", "name", "edit_url", "request_id", "changed_fields": []}}
SET IDS ARE NOT STABLE ACROSS AN EDIT. There is no partial-field wire
here: any edit other than python_code reposts the whole body, and
Tradetron deletes and recreates the SET rows on every such write. So a
one-scalar edit — a description change — moves every set id, and each
condition's strategy_template_set_id moves with it. Condition and leg
ids are preserved. changed_fields reports the FIELDS you asked for and
that persisted; it does not, and cannot, report the row churn. Never
cache a set id across an edit — re-read with tt_get_strategy instead.
Possible error codes worth surfacing to the user: STRATEGY_VALIDATION_FAILED — edits would produce invalid spec STRATEGY_UPDATE_CONTENT_DROPPED — structural edit lost sets/ conditions/legs server-side STRATEGY_EXCHANGE_BROKER_REQUIRED — the user's running deployment has no broker for an exchange the edited legs now use; ask which broker, re-call with exchange_brokers. On success, relay data.subscriber_broker_warning if present: other users' deployments will not trade that exchange until they redeploy. STRATEGY_PARTIAL_PERSIST — TT 200 but some scalar fields silently dropped (see details.dropped)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"strategy_id": "<strategy_id>",
"edits": "<edits>"
},
"name": "tt_update_strategy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | ||
| dry_run | No | ||
| strategy_id | Yes | ||
| exchange_brokers | No | ||
| live_edit_confirmed | No | ||
| allow_universal_exit_removal | No |