Summary

Returns the Triangular Moving Average indicator instance.

Syntax

TriangularMovingAverage(DataSeries source, int periods)

Parameters

Example

 
//...
[Parameter]
public DataSeries Source { get; set; }

[Output("Result", Color = Colors.Orange)]
public IndicatorDataSeries Result { get; set; }
[Output("previousResult", Color = Colors.Green)]
public IndicatorDataSeries previousResult { get; set; }

private SimpleMovingAverage tma;

protected override void Initialize()
{
    tma = Indicators.TriangularMovingAverage(Source, 50);
}
public override void Calculate(int index)
{
    Result[index] = tma.Result[index]; //This stores current tma to Result Output
    previousResult[index] = tma.Result[index-1]; //This stores previous tma to previousResult Output
}
//...