nBarsUp

Description

The nBarsUp indicator looks for a specified number of rising closing prices. Other conditions can also be added to the search, for example: Constantly rising bars, i.e. close < open (red candles) Constantly rising highs Constantly rising lows

Usage

NBarsUp(int barCount, bool BarUp, bool higherHigh, bool higherLow)
NBarsUp(IDataSeries inSeries, int barCount, bool BarUp, bool higherHigh, bool higherLow)
NBarsUp(int barCount, int barCount, bool BarUp, bool higherHigh, bool higherLow)[int barsAgo]
NBarsUp(IDataSeries inSeries, int barCount, bool BarUp, bool higherHigh, bool higherLow)[int barsAgo]

Return value

double

When using this method with an index (e.g. NBarsUp(...)[int barsAgo] ), the value of the indicator will be issued for the referenced bar.

1 – The condition applies 0 – The condition does not apply

Parameters

inSeries Input data series for the indicator

barCount Number of successively rising closing prices

barUp Additional condition (true): each close must be higher than the open (green bar)

higherHigh Additional condition (true): continuously rising highs

higherLow Additional condition (true): continuously rising lows

Visualization

Example

// Look for 3 successively rising closing prices
if (NBarsUp(3, true, true, true)[0] == 1)
Print("3 successively higher closing prices have occurred.");

Last updated