Create strategy (AI build)
create_strategyTurn a natural-language description into a ready-to-run trading strategy. Specify the instrument, entry/exit rules, and position size; optionally pass a research report ID to ground the build.
Instructions
Build a brand new trading strategy from a natural-language description using Pyon's AI builder, waiting up to 300s for the build to finish. Use this when the user wants a new strategy; pass analysisId to ground the build in a saved research report from create_research. Parameters: description (string, 10 to 8000 characters, required) - name the instrument, entry rule, exit rule and position size; analysisId (UUID, optional) from create_research or list_research. Call get_capabilities FIRST so the indicator names, operators, action types and tickers you write into the description are ones the engine supports, and so thresholds stay inside each indicator's range (an RSI entry above 100 can never fire). Returns the new strategyId, name, a summary of what was built, and a nextSteps hint. Always evaluate the result with run_backtest before editing or optimizing. If the wait times out, the error includes a jobId for get_job_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysisId | No | Optional research report UUID from create_research or list_research; grounds the build in that research. | |
| description | Yes | What to build, in plain language - at least 10 characters. Name the instrument, entry rule, exit rule and position size, e.g. 'RSI mean reversion on AAPL: buy when RSI(14) crosses below 30, sell when RSI crosses above 55, 25% of cash per entry'. Call get_capabilities first so you use real indicator names and in-range thresholds. |