Price Oscillator

View as Markdown

Description

The Price Oscillator is an indicator based on the difference between two moving averages, and is expressed as either a percentage or in absolute terms.

… Courtesy of StockCharts

Syntax

PriceOscillator(int fast, int slow, int smooth)

PriceOscillator(ISeries\<double\> input, int fast, int slow, int smooth)

Returns default value

PriceOscillator(int fast, int slow, int smooth)[int barsAgo]

PriceOscillator(ISeries\<double\> input, int fast, int slow, int smooth)[int barsAgo]

Return Value

double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.

Parameters

ParameterDescription
fastThe number of bars to calculate the fast EMA
inputIndicator source data (Series<T>)
slowThe number of bars to calculate the slow EMA
smoothThe number of bars to calculate the EMA signal line

Examples

1// Prints the current value of a 20 period PriceOscillator using default price type
2double value = PriceOscillator(12, 26, 9)[0];
3Print("The current PriceOscillator value is " + value.ToString());

Source Code

You can view this indicator method source code by selecting the menu New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.