dwlf_run_backtest
Run an asynchronous strategy backtest for a DWLF strategy and return a request ID to poll for results; activate symbols and use a long enough date range to avoid zero-trade runs.
Instructions
⚠️ Run a strategy backtest (async). Returns requestId → poll with dwlf_get_backtest_results. PREREQUISITES: 1) Strategy MUST have symbols activated (dwlf_activate_strategy_symbols) or backtest returns 0 trades. 2) Requires 200+ daily candles: startDate must be 10+ months before endDate. If backtest returns 0 trades, check: a) Are symbols activated? b) Is date range long enough? c) Do event conditions actually match historical data? Optional capital/risk params (initialCapital, riskPerTrade, maxConcurrentTrades, portfolioMode, allowSymbolPyramiding) override backend defaults — set portfolioMode=true together with maxConcurrentTrades to model shared-capital concurrency across symbols; set allowSymbolPyramiding=true to permit more than one concurrent open position per symbol, and maxPositionsPerSymbol to bound that (e.g. 3) so per-symbol concentration stays capped. Set disableTakeProfit=true for exit-signal-only strategies (no tp node) so the backend does NOT force a fallback take-profit that would exit early.
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": {
"strategyId": "<strategyId>"
},
"name": "dwlf_run_backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | Single symbol shorthand (e.g. BTC, TSLA). Use "symbols" for multiple. | |
| endDate | No | End date (YYYY-MM-DD) | |
| symbols | No | Symbols to backtest against (e.g. ["BTC", "TSLA"]). Defaults to strategy assets. | |
| startDate | No | Start date (YYYY-MM-DD) | |
| strategyId | Yes | Strategy ID to backtest | |
| riskPerTrade | No | Risk per trade as a decimal, e.g. 0.005 = 0.5% (default 0.02). | |
| portfolioMode | No | Opt into shared-capital simulation across symbols (default false). Combine with maxConcurrentTrades to cap simultaneous open positions. | |
| initialCapital | No | Starting account size in USD (default 10000). | |
| disableTakeProfit | No | Suppress the implicit fallback take-profit (default false). When a strategy has NO take-profit node the backend otherwise force-applies a 3xATR fallback TP, which exits exit-signal-only strategies early. Set true to truly ride the exit graph (e.g. exit on cycle high / trendline break). | |
| maxConcurrentTrades | No | Concurrency cap for portfolio mode (default 3). Pair with portfolioMode=true. | |
| allowSymbolPyramiding | No | Opt into >1 concurrent open position per symbol in portfolio mode (default false = one position per symbol). Note: global maxConcurrentTrades still caps total positions, but per-symbol concentration is unbounded unless maxPositionsPerSymbol is set. | |
| maxPositionsPerSymbol | No | Bound concurrent open positions per symbol when allowSymbolPyramiding=true (e.g. 3). Default unlimited. No effect when allowSymbolPyramiding is false (cap is 1 then). |