Edit strategy (AI edit)
edit_strategyModify an existing trading strategy using natural language to change entry/exit logic, thresholds, position sizing, or symbols. Get a backtest comparison verdict and revert option to undo bad edits.
Instructions
Modify an existing strategy with a natural-language instruction using Pyon's AI editor, waiting up to 300s. Use this to change entry/exit logic, thresholds, position sizing, symbols, or to fix issues found by diagnose_strategy. Parameters: strategyId (UUID, required; from list_strategies); instruction (string, 10 to 8000 characters, required) stating exactly what to change and to what - diagnose_strategy's agentRequest can be pasted here verbatim. Use get_capabilities to check indicator names and ranges before writing the instruction. Returns a verification verdict comparing a sample backtest before and after the edit, with before/after trade counts and return percentages, plus revertToVersion for undoing a bad edit. Verdict values: improved (better), unchanged (no measurable change), degraded (worse), broke (errored or stopped trading - revert), still_zero (zero trades before and after - root cause not fixed). If the wait times out, the error includes a jobId to check with get_job_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strategyId | Yes | Strategy UUID. Find it with list_strategies (it is also returned by create_strategy). Not a strategy name. | |
| instruction | Yes | The change to make, in plain language - at least 10 characters, e.g. 'loosen the RSI entry threshold from 30 to 35 and add a 5% trailing stop loss'. diagnose_strategy's agentRequest can be pasted here verbatim. |