set_indicator_input
Change indicator or strategy inputs live on a TradingView chart to A/B test parameters without re-saving the Pine script. Restore original values anytime.
Instructions
Change input values of an indicator or strategy already on a chart — the write counterpart to get_indicator_inputs. The Pine source is untouched, but the study's input values on the chart remain changed until set back (this is a live chart edit, like opening the study's Settings dialog, and may be captured by TradingView's own layout autosave). Works for both plain indicators and strategies (for a strategy, follow up with get_strategy_report to read the recalculated backtest). Use this to A/B-test parameters without re-saving the script each time, and restore the original values when done.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | Yes | Inputs to change, e.g. [{id:'in_0', value:14}]. Get ids/current values from get_indicator_inputs | |
| study_id | Yes | Indicator/strategy id from get_chart_context or add_pine_to_chart/run_backtest(keep_on_chart:true) | |
| chart_index | No | Chart index in a multi-chart layout. Default: the active chart |