Triangular Moving Average Formula (Chart Controls)

The triangular moving average formula takes a simple moving average of data and applies a simple moving average on the first moving average. It is a lagging indicator, and is always behind the price. The triangular moving average gives the most weight to the middle portion of the data.

Sample plot of the triangular moving average

Formula Details

Syntax

Chart.DataManipulator.FinancialFormula(
    FinancialFormula.TriangularMovingAverage,
    "Period",
    "Price",
    "TMA")

Parameters

This formula takes one required parameter.

  • Period
    Period for calculating the moving averages.

Input Values

This formula takes one input Y value.

  • Price
    Price for which the triangular moving average is calculated.

Output Value

This formula outputs one Y value.

  • TMA
    Triangular moving average.

Remarks

The Line chart type is a convenient chart type to display the formula output.

Example

The following example takes input from Series1's second Y value (Series1:Y2) and outputs a 20-day triangular moving average on Series2's first Y value (Series2:Y).

Chart1.DataManipulator.FinancialFormula (FinancialFormula.TriangularMovingAverage, "20", "Series1:Y2", "Series2:Y")
Chart1.DataManipulator.FinancialFormula (FinancialFormula.TriangularMovingAverage, "20", "Series1:Y2", "Series2:Y");

See Also

Reference

Exponential Moving Average Formula
Simple Moving Average Formula
Weighted Moving Average Formula
System.Windows.Forms.DataVisualization.Charting
System.Web.UI.DataVisualization.Charting

Concepts

Applying Formulas

Other Resources

Moving Averages