Skip to content

IIndicatorsAccessor.OscillatorMovingAverage

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

The Oscillator of a Moving Average (OsMA) is a technical indicator that shows the difference between an oscillator and its moving average over a given period of time.

Definition

OscillatorMovingAverage OscillatorMovingAverage(DataSeries source, int periods, MovingAverageType maType)
api.Indicators.OscillatorMovingAverage(source: DataSeries, periods: int, maType: MovingAverageType) -> OscillatorMovingAverage

Parameters

Name C# type Python type Description
source DataSeries DataSeries The oscillator Data Series used for the OsMA calculation.
periods int int Moving Average Period
maType MovingAverageType MovingAverageType Moving Average Type

Returns OscillatorMovingAverage — OscillatorMovingAverage

Examples

var rsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, 14);
var rsiOsma = Indicators.OscillatorMovingAverage(rsi.Result, 9, MovingAverageType.Simple);
Print("RSI OsMA histogram: {0}", rsiOsma.Histogram.LastValue);
rsi = api.Indicators.RelativeStrengthIndex(api.Bars.ClosePrices, 14)
rsiOsma = api.Indicators.OscillatorMovingAverage(rsi.Result, 9, MovingAverageType.Simple)
api.Print(f"RSI OsMA histogram: {rsiOsma.Histogram.LastValue}")