Create Strategy
tt_create_strategyCreate a new Tradetron strategy template from markdown or JSON, or copy an existing one server-side (copy_from_strategy_id).
TO COPY A STRATEGY: pass copy_from_strategy_id (and optionally copy_name), nothing else. Do NOT fetch the body with tt_get_strategy and send it back: on a large strategy that is 100+ KB of arguments. The copy is validated like any create; to move it to another underlying afterwards, use tt_apply_strategy_patch on the new id.
Pipeline: emit (if markdown) → validate locally → POST to TT.
Returns the new strategy's id and edit_url. The user then opens the edit_url in Tradetron's Advanced Strategy Builder to review and deploy.
STRONGLY RECOMMENDED: call tt_validate_markdown(text) FIRST to catch
validation errors before paying for the network round-trip. Local
validation is free and immediate; server-side rejection is slower
and burns wallet. Pass the dry_run_token it returns here — the server
confirms this exact spec was dry-run-validated (dry_run_verified).
For LARGE strategies (>20 KB JSON, common for multi-Set books),
use compressed_payload instead of text_or_json.
*** ONLY USE THIS IF YOU CAN EXECUTE CODE. ***
base64(gzip(...)) cannot be WRITTEN, only COMPUTED — producing it by
hand means deriving byte-exact DEFLATE output and a CRC32 in your head.
If you do not have a code-execution tool, pass the strategy as markdown
or JSON in text_or_json, or — for one too large for a single tool
argument — split that PLAIN JSON across tt_create_strategy_chunked,
which accepts it uncompressed. Guessing at this argument fails 100% of the time; it was 25
failed creates in 14 days before this warning existed.
If you CAN execute code:
import base64, gzip, json
compressed_payload = base64.b64encode(
gzip.compress(json.dumps(strategy_dict).encode())
).decode()Why it exists: tool-call arguments are emitted as LLM output tokens, and a 100 KB strategy JSON (~60 K tokens) exceeds any per-turn budget. Gzip+base64 shrinks the same content to ~15 KB encoded. Pass exactly ONE of the two arguments; the server rejects ambiguous input.
The server is TOLERANT of near-miss encodings — zlib instead of gzip, base64 with the compress step skipped, or raw JSON — and will read them and warn rather than fail your create. It cannot read a fabricated string.
Set dry_run=True to build + validate and return the EXACT would-be
create payload WITHOUT saving to TT — for inspecting/diffing the
emitted JSON. The response carries a dry_run_token you can pass back
here to perform the real create — good for 30 minutes, and for that
exact spec; an expired one is reported, not refused.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tt_create_strategy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Build and validate, return the would-be payload, and do NOT save to Tradetron. | |
| copy_name | No | Name for the copy (with copy_from_strategy_id). Default: 'Copy of <source name>'. | |
| source_video | No | ONLY when building from tt_read_strategy_video: {video_id, strategy_index, answers: {field: {kind: answer|confirm|leave_out, value?}}, trace: [{element, field}]}. The create is refused while any gap is unanswered, an inferred rule is unconfirmed, the trace cites a left-out rule or skips an in-force one, or a time differs from the video. Omit for strategies that don't come from a video. | |
| text_or_json | No | The strategy, as markdown (preferred) or a JSON string. REQUIRED unless you pass compressed_payload — supply EXACTLY ONE of the two. This is the argument you want in almost every case. | |
| dry_run_token | No | Token returned by tt_validate_markdown for this exact spec; proves it was dry-run validated. Optional, and good for 30 minutes. An OLDER token does not block the create — the spec is validated inline either way — it just reports dry_run_verified: false with dry_run_status 'expired'. A token minted for a DIFFERENT spec, or a forged one, IS refused. | |
| compressed_payload | No | base64(gzip(json)) of the strategy, for very large books. ONLY usable if you can EXECUTE code to produce it — it cannot be written by hand. Leave empty and use text_or_json otherwise. Supply EXACTLY ONE of the two. | |
| copy_from_strategy_id | No | COPY an existing strategy server-side: its template id (or a deployment id, resolved to its template). The server reads it and creates the copy, so you send no body: leave text_or_json and compressed_payload empty. Only strategies this account can read. Use dry_run=true first to see the validation. 0 = not a copy. |