trade29.sc.SCBridge.set_historical_bar_period_parameters#

SCBridge.set_historical_bar_period_parameters(key: str, historical_chart_bar_period_type: int = 0, historical_chart_days_per_bar: int = 0) SetBarPeriodParametersResponse#

Set the bar period for the chart

The parameters to this function follow the SC ACSIL function, reference the SC docs for usage details

This is a convenience method to set_bar_period_parameters_request

SC docs: https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scSetBarPeriodParameters

Parameters:
keystr

The key of the SC-dX study applied to the target chart.

historical_chart_bar_period_type: int
historical_chart_days_per_bar:int
Returns:
SetBarPeriodParametersResponse

Examples

The following snippet changes chart es_2 to a historical daily chart.

from trade29.sc.bridge import SCBridge
bridge = SCBridge()
ret = bridge.set_historical_bar_period_parameters(
    key='xx',
    historical_chart_bar_period_type=1, 
    historical_chart_days_per_bar=1)
print(ret.rdata)