# Maximum (MAX)

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

Max (MAX) delivers the highest value for a predefined number of periods.

#### Usage <a href="#usage_111" id="usage_111"></a>

```csharp
MAX(int period)
MAX (IDataSeries inSeries, int period)
MAX (int period)[int barsAgo]
MAX (IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_109" id="return-value_109"></a>

**double**

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

#### Parameters <a href="#parameters_101" id="parameters_101"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_108" id="visualization_108"></a>

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

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

```csharp
// Output of the highest value of the last 20 periods
// The output is identical to high [GetSerieHighestValue(High,20)]
Print("The highest value of the last 20 periods is " + MAX(High, 20)[0]);
```


---

# 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/maximum-max.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.
