Generate Strategy Code (no training)
generate_strategyGenerate Python strategy code only: nothing is trained or deployed.
Returns the generated code for the user to read or edit; each call is billed
from the account's credits.
Args:
features: Plain-English description of features (e.g. "RSI 14, Bollinger Bands").
signals: Plain-English description of signal logic (e.g. "Buy when RSI < 30").
model: ML model name (default Random Forest), or "rule-based" for fixed rules with no ML (#3258: the
code then holds model_type RuleBased and a rules list; train_strategy trains it).
risk: Plain-English risk rules (e.g. "0.5% stop loss").
description: Optional one-line summary; the generator weighs it as the
main request.
symbol: Market the code should target. One of: EURUSD, USDJPY,
GBPUSD, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD, BTCUSD. Default EURUSD.
timeframe: Candle granularity. One of: 1min, 5min, 15min, 1h. Default 15min.
claude_model: "sonnet" (default), "haiku" (faster, about a third of the credits) or "sonnet-haiku"
(Sonnet writes the spec, Haiku the code). Any case.
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": "generate_strategy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| risk | No | Risk rules in plain English, e.g. "0.5% stop loss". | |
| model | No | The model the code uses: an ML model name such as Random Forest (default), XGBoost or LightGBM, or rule-based for fixed rules with no ML. | Random Forest |
| symbol | No | Market: EURUSD, USDJPY, GBPUSD, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD or BTCUSD. Default EURUSD. | |
| signals | No | The signal logic in plain English, e.g. "Buy when RSI < 30". | |
| features | No | The features in plain English, e.g. "RSI 14, Bollinger Bands". | |
| timeframe | No | Bar size: 1min, 5min, 15min or 1h. Default 15min. | |
| description | No | Optional one-line summary of the whole request; the generator weighs it as the main request. | |
| claude_model | No | Which Claude model writes the code: sonnet (default), sonnet-haiku (Sonnet writes the spec, Haiku the code) or haiku (faster, about a third of the credits). Any case. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||