---
id: "P:cAlgo.API.ChartTemplateDisplaySettings.IsPriceToBarRatioLocked"
kind: "property"
type: "T:cAlgo.API.ChartTemplateDisplaySettings"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplateDisplaySettings/IsPriceToBarRatioLocked/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartTemplateDisplaySettings.IsPriceToBarRatioLocked

Member of [ChartTemplateDisplaySettings](https://help.ctrader.com/ctrader-algo/references/Chart/Templates/ChartTemplateDisplaySettings/index.md).

## IsPriceToBarRatioLocked

Defines if the price to bar ratio is locked for chart template. Locking sets the price scale mode to Regular.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.DisplaySettings).

C#:

```csharp
bool IsPriceToBarRatioLocked {get; set;}
```

Python:

```python
chartTemplateDisplaySettings.IsPriceToBarRatioLocked: bool
```

### Returns

`bool` — 

Available since cAlgo.API 5.10.

### Examples

C#:

```csharp
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);
```

Python:

```python
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}")
```

