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