run_backtest
Backtest a saved TradingView strategy on the active chart's symbol and timeframe, get the report, then remove the strategy so the chart stays unchanged; keep it on the chart when needed.
Instructions
Backtest one of the user's OWN saved strategies on the active chart's current symbol and timeframe: temporarily applies the strategy, waits for the Strategy Tester report, returns it (same shape as get_strategy_report) and removes the strategy again so the chart is left unchanged (set keep_on_chart to keep it). Get strategy pine_ids (kind 'strategy') from list_pine_scripts. Combine with set_symbol/set_timeframe to test other markets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pine_id | Yes | Strategy script id from list_pine_scripts, e.g. 'USER;71f1e4e6807c4bb48bd55edb886908a0' | |
| trades_limit | No | Max most-recent trades to include. Default: 20 | |
| keep_on_chart | No | Leave the strategy on the chart after the test. Default: false (auto-remove) |