tv_backtest_compare
Compare a Pine strategy across multiple parameter sets using TradingView's Strategy Tester. Run backtests with different parameter combinations to analyze performance.
Instructions
Compare a Pine strategy across multiple parameter sets using the Strategy Tester. Pro+ only. DESTRUCTIVE: changes the chart, saves/loads the strategy, and opens the Strategy Tester.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Full Pine strategy v6 source including //@version=6 | |
| symbol | Yes | Symbol to test, e.g. NASDAQ:AAPL | |
| maxWaitMs | No | Max milliseconds to wait for Strategy Tester results per run (default 20000) | |
| paramSets | Yes | List of parameter maps to apply to the source (e.g. [{fastLength: 10, slowLength: 30}]) | |
| timeframe | Yes | Timeframe for the test, e.g. D, 240, 60 |