# TMA - Triangular Moving Average

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

This specifically weighted average has an extra smoothing component. The weightings are not linear, but instead take on a triangular pattern. To demonstrate, the weighting for a 7-period average would be 1,2,3,4,3,2,1. More weight is given to the median value of the time series, and the newest and oldest data is given less weight.

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

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

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

**double**

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

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

inSeries Input data series for the indicator

period Number of bars included in the calculations

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

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

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

```csharp
//Output for the value of the TMA
Print("The current value for the TMA is " + TMA(14)[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/moving-averages/tma-triangular-moving-average.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.
