Minimum (MIN)

View as Markdown

Description

Returns the lowest value over the specified period.

Syntax

MIN(int period)

MIN(ISeries\<double\> input, int period)

Returns default value

MIN(int period)[int barsAgo]

MIN(ISeries\<double\> input, int period)[int barsAgo]

Return Value

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

Parameters

ParameterDescription
inputIndicator source data (Series<T>)
periodNumber of bars used in the calculation

Examples

1// Prints the lowest low value over the last 20 periods
2double value = MIN(Low, 20)[0];
3Print("The current MIN value is " + value.ToString());
4
5// Note the above call with a barsAgo of 0 includes the current MIN of the input low series in the value. If we want to check for example for a break of this value, storing the last bar's MIN would be needed.
6double value = MIN(Low, 20)[1];
7
8if (Low[0] < value)
9 Draw.ArrowDown(this, CurrentBar.ToString(), true, 0, High[0] + TickSize, Brushes.Red);

Source Code

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