trade29.sc.SCBridge.set_chart_study_input#
- SCBridge.set_chart_study_input(key: str, study_id: int, input_index: int, value: int | float | str, chart_number: int | None = -1, reload_chart: str | None = 'ReloadChart', return_after_reload: int | None = 1) SetChartStudyInputFloatResponse | SetChartStudyInputIntResponse | SetChartStudyInputStringResponse #
Set the input parameter of a study to a new value
Use this to set integer, float or str values.
Boolean (yes/no) values are integer values and are supported
User chart_number to specify the chart. A chart_number of -1 refers to the current chart.
The parameters to this function follow the SC ACSIL function, reference the SC docs for usage details
- SC docs:
https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scSetChartStudyInputInt https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scSetChartStudyInputString https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scSetChartStudyInputFloat
- Parameters:
- keystr
The key of the SC-dX study applied to the target chart.
- chart_number: int
- study_id: int
- input_index: int
1-based index of the input to set.
- value: int | float | string
The new value to set to. Must be an integer, float or string, otherwise an exception is thrown.
- Returns:
Examples
The following example sets the input 10 in study id 2 to 5.
from trade29.sc.bridge import SCBridge bridge = SCBridge() ret = bridge.set_chart_study_input( key='xx', chart_number=2, study_id=2, input_index=10, value=5) print(ret.rdata)