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

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

# ChartTemplateDisplaySettings.PriceToBarRatio

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

## PriceToBarRatio

Gets or sets the price to bar ratio for chart template. Values that are not greater than zero, NaN or infinite are ignored.

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
double PriceToBarRatio {get; set;}
```

Python:

```python
chartTemplateDisplaySettings.PriceToBarRatio: float
```

### Returns

`double` — 

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.PriceToBarRatio = Symbol.PipSize * 10;
template.DisplaySettings.IsPriceToBarRatioLocked = true;

Print("Template price to bar ratio: {0}", template.DisplaySettings.PriceToBarRatio);
```

Python:

```python
template = api.ChartTemplates.Get("Template Name")

if template is None:
    print("Template not found")
    return

template.DisplaySettings.PriceToBarRatio = api.Symbol.PipSize * 10
template.DisplaySettings.IsPriceToBarRatioLocked = True

print(f"Template price to bar ratio: {template.DisplaySettings.PriceToBarRatio}")
```

