> For the complete documentation index, see [llms.txt](https://indicators.agenatrader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://indicators.agenatrader.com/standard-indicators/moving-averages/vma-variable-moving-average.md).

# VMA - Variable Moving Average

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

This variation of an EMA automatically smoothes any fluctuations in the market, and its sensitivity grows as more weight is placed on more recent data.

The VMA attempts to get rid of the disadvantages of other moving averages by automatically regulating the smoothing constant. This is why the VMA can be implemented for most of the market conditions, and is in a few cases actually better than other averages.

**Caution** The VMA is not to be confused with the Volume Moving Average (VolMA)!

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

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

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

**double**

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

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

inSeries Input data series for the indicator

period Number of bars included in the calculations

volatility period Number of bars included in the calculation for the signal line

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

![VMA - Variable Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/VMA.jpg)

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

```csharp
//Output the VMA value
Print("The current VMA value is " + VMA(9, 9)[0]);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/moving-averages/vma-variable-moving-average.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
