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

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

# IIndicatorsAccessor.MacdOscillatorMovingAverage

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

## MacdOscillatorMovingAverage(int longCycle, int shortCycle, int signalPeriods, MovingAverageType maType)

The Oscillator of a Moving Average (OsMA) over the MACD.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
MacdOscillatorMovingAverage MacdOscillatorMovingAverage(int longCycle, int shortCycle, int signalPeriods, MovingAverageType maType)
```

Python:

```python
api.Indicators.MacdOscillatorMovingAverage(longCycle: int, shortCycle: int, signalPeriods: int, maType: MovingAverageType) -> MacdOscillatorMovingAverage
```

### Parameters

- `longCycle` (`int`, Python `int`): The long period used calculation.
- `shortCycle` (`int`, Python `int`): The short period used calculation.
- `signalPeriods` (`int`, Python `int`): The period used for the calculation of the signal.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type

### Returns

`MacdOscillatorMovingAverage` — MacdOscillatorMovingAverage

### Examples

C#:

```csharp
var macdOsma = Indicators.MacdOscillatorMovingAverage(26, 12, 9, MovingAverageType.Exponential);
Print("MACD OsMA histogram: {0}", macdOsma.Histogram.LastValue);
```

Python:

```python
macdOsma = api.Indicators.MacdOscillatorMovingAverage(26, 12, 9, MovingAverageType.Exponential)
api.Print(f"MACD OsMA histogram: {macdOsma.Histogram.LastValue}")
```

## MacdOscillatorMovingAverage(DataSeries source, int longCycle, int shortCycle, int signalPeriods, MovingAverageType maType)

The Oscillator of a Moving Average (OsMA) over the MACD.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
MacdOscillatorMovingAverage MacdOscillatorMovingAverage(DataSeries source, int longCycle, int shortCycle, int signalPeriods, MovingAverageType maType)
```

Python:

```python
api.Indicators.MacdOscillatorMovingAverage(source: DataSeries, longCycle: int, shortCycle: int, signalPeriods: int, maType: MovingAverageType) -> MacdOscillatorMovingAverage
```

### Parameters

- `source` (`DataSeries`, Python `DataSeries`): The source series to be applied
- `longCycle` (`int`, Python `int`): The long period used calculation.
- `shortCycle` (`int`, Python `int`): The short period used calculation.
- `signalPeriods` (`int`, Python `int`): The period used for the calculation of the signal.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Moving Average Type

### Returns

`MacdOscillatorMovingAverage` — MacdOscillatorMovingAverage

### Examples

C#:

```csharp
var macdOsma = Indicators.MacdOscillatorMovingAverage(Bars.MedianPrices, 26, 12, 9, MovingAverageType.Exponential);
Print("MACD OsMA histogram of median prices: {0}", macdOsma.Histogram.LastValue);
```

Python:

```python
macdOsma = api.Indicators.MacdOscillatorMovingAverage(api.Bars.MedianPrices, 26, 12, 9, MovingAverageType.Exponential)
api.Print(f"MACD OsMA histogram of median prices: {macdOsma.Histogram.LastValue}")
```

