---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.TrueRange"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/TrueRange/"
---

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

# IIndicatorsAccessor.TrueRange

Member of [IIndicatorsAccessor](https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/index.md).

## TrueRange()

Initializes the True Range indicator.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TrueRange TrueRange()
```

Python:

```python
api.Indicators.TrueRange() -> TrueRange
```

### Returns

`TrueRange` — True Range indicator instance

### Examples

C#:

```csharp
var trueRange = Indicators.TrueRange();
Print("True range of the last closed bar: {0}", trueRange.Result.Last(1));
```

Python:

```python
trueRange = api.Indicators.TrueRange()
api.Print(f"True range of the last closed bar: {trueRange.Result.Last(1)}")
```

## TrueRange(Bars bars)

Initializes the True Range indicator.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
TrueRange TrueRange(Bars bars)
```

Python:

```python
api.Indicators.TrueRange(bars: Bars) -> TrueRange
```

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars

### Returns

`TrueRange` — True Range indicator instance

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyTrueRange = Indicators.TrueRange(dailyBars);
Print("True range of the last closed daily bar: {0}", dailyTrueRange.Result.Last(1));
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyTrueRange = api.Indicators.TrueRange(dailyBars)
api.Print(f"True range of the last closed daily bar: {dailyTrueRange.Result.Last(1)}")
```

