ChartTemplateDisplaySettings.IsPriceToBarRatioLocked
property · ChartTemplateDisplaySettings · cAlgo.API Since 5.10
DesktopCLICloud
Defines if the price to bar ratio is locked for chart template. Locking sets the price scale mode to Regular.
Environment behaviour
Cloud — not supported. Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.DisplaySettings).
Definition
bool IsPriceToBarRatioLocked {get; set;}
chartTemplateDisplaySettings.IsPriceToBarRatioLocked: bool
Returns bool
Examples
var template = ChartTemplates.Get("Template Name");
if (template is null)
{
Print("Template not found");
return;
}
template.DisplaySettings.IsPriceToBarRatioLocked = true;
Print("Template price to bar ratio locked: {0} | Price scale mode: {1}", template.DisplaySettings.IsPriceToBarRatioLocked, template.DisplaySettings.PriceScaleMode);
template = api.ChartTemplates.Get("Template Name")
if template is None:
print("Template not found")
return
template.DisplaySettings.IsPriceToBarRatioLocked = True
print(f"Template price to bar ratio locked: {template.DisplaySettings.IsPriceToBarRatioLocked} | Price scale mode: {template.DisplaySettings.PriceScaleMode}")