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

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

# IIndicatorsAccessor.DetrendedPriceOscillator

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

## DetrendedPriceOscillator(DataSeries source, int periods, MovingAverageType maType)

The Detrended Price Oscillator shows intermediate overbought and oversold levels.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
DetrendedPriceOscillator DetrendedPriceOscillator(DataSeries source, int periods, MovingAverageType maType)
```

Python:

```python
api.Indicators.DetrendedPriceOscillator(source: DataSeries, periods: int, maType: MovingAverageType) -> DetrendedPriceOscillator
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The price source data used for calculation.
- `periods` (`int`, Python `int`): The period used for calculation.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Type of the Moving Average.

### Returns

`DetrendedPriceOscillator` — Detrended Price Oscillator indicator instance

### Examples

C#:

```csharp
var dpoFast = Indicators.DetrendedPriceOscillator(Bars.ClosePrices, 10, MovingAverageType.Simple);
var dpoSlow = Indicators.DetrendedPriceOscillator(Bars.ClosePrices, 30, MovingAverageType.Simple);
if (dpoFast.Result.Last(1) > dpoSlow.Result.Last(1))
    Print("Fast DPO is above slow DPO");
```

Python:

```python
dpoFast = api.Indicators.DetrendedPriceOscillator(api.Bars.ClosePrices, 10, MovingAverageType.Simple)
dpoSlow = api.Indicators.DetrendedPriceOscillator(api.Bars.ClosePrices, 30, MovingAverageType.Simple)
if dpoFast.Result.Last(1) > dpoSlow.Result.Last(1):
    api.Print("Fast DPO is above slow DPO")
```

