---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.PriceROC(cAlgo.API.DataSeries,System.Int32)"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/PriceROC/"
---

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

# IIndicatorsAccessor.PriceROC

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

## PriceROC(DataSeries source, int periods)

The Price Rate of Change indicator is the percentage change of the current price and the price N periods ago.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
PriceROC PriceROC(DataSeries source, int periods)
```

Python:

```python
api.Indicators.PriceROC(source: DataSeries, periods: int) -> PriceROC
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The source data used for calculation.
- `periods` (`int`, Python `int`): The value of the periods used for calculation.

### Returns

`PriceROC` — Price Rate of Change indicator instance

### Examples

C#:

```csharp
var priceRoc = Indicators.PriceROC(Bars.ClosePrices, 12);
Print("Price ROC(12): {0}%", priceRoc.Result.LastValue);
```

Python:

```python
priceRoc = api.Indicators.PriceROC(api.Bars.ClosePrices, 12)
api.Print(f"Price ROC(12): {priceRoc.Result.LastValue}%")
```

