# nBarsUp

#### Description <a href="#description_78" id="description_78"></a>

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 <a href="#usage_78" id="usage_78"></a>

```csharp
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 <a href="#return-value_75" id="return-value_75"></a>

**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 <a href="#parameters_68" id="parameters_68"></a>

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 <a href="#visualization_73" id="visualization_73"></a>

![nBarsUp](https://agenatrader.github.io/AgenaIndicator-documentation/media/nBarsUp.jpg)

#### Example <a href="#example_74" id="example_74"></a>

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