# 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.");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/nbarsup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
