Median

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > ISeries<T> > PriceSeries<double> >

Median

Previous page Return to chapter overview Next page

Definition

A collection of historical bar median prices. Median price = (High + Low) / 2.

 

Property Value

An ISeries<double> type object. Accessing this property via an index value [int barsAgo] returns a double value representing the price of the referenced bar.

 

Syntax

Median
Median[int barsAgo]

 

 

Examples

ns


// Current bar median price
double barMedianPrice = Median[0];
 
// Median price of 10 bars ago
double barMedianPrice = Median[10];
 
// Current bar value of a 20 period exponential moving average of median prices
double value = EMA(Median, 20)[0];