TRIMA (Triangular Moving Average)

Indicator Description

TRIMA (Triangular Moving Average) is a weighted moving average that gives greater weight to middle prices, better reflecting the central tendency of prices.

Function Information

  • Function Name: TRIMA
  • Input Parameters:
    • #Kline: K-line data
  • Parameter Settings:
    • timeperiod: Time period (default: 30)
  • Output: Moving average value

Calculation Principle

TRIMA is calculated using the following formula:

TRIMA = Sum(Price * Weight) / Sum(Weight)

Where:

  • Price is the price data
  • Weight is the triangular weight, with the middle value having the highest weight and decreasing towards both ends

Usage Scenarios

  1. Trend identification and tracking
  2. Support and resistance level judgment
  3. Price breakout confirmation
  4. Trading signal generation
Last Updated: