
    i^                     z    S SK Jr  S SKJrJr  S SKJr  S SKJrJ	r	J
r
Jr  SSKJr    SS\S	\S
\S\S\S\4S jjrg)    )Series)DictLikeInt)Imports)v_offsetv_pos_defaultv_seriesv_talib   )smaNcloselengthtaliboffsetkwargsreturnc                 |   [        US5      n[        X5      n U c  g[        U5      n[        U5      n[        S   (       a  U(       a  SSKJn  U" X5      nO%[        SUS-   -  5      n[        XUS9n	[        XUS9nUS:w  a  UR                  U5      nS	U;   a  UR                  US	   S
S9  SU 3Ul        SUl        U$ )a  Triangular Moving Average

This indicator is a weighted moving average where the shape of the
weights are triangular with the greatest weight is in the middle
of the period.

Sources:
    * [tradingtechnologies](https://www.tradingtechnologies.com/help/x-study/technical-indicator-definitions/triangular-moving-average-trima/)

Parameters:
    close (Series): ```close``` Series
    length (int): The period. Default: ```10```
    talib (bool): If installed, use TA Lib. Default: ```True```
    offset (int): Post shift. Default: ```0```

Other Parameters:
    adjust (bool): Default: True
    fillna (value): ```pd.DataFrame.fillna(value)```

Returns:
    (Series): 1 column

Note:
    tma = sma(sma(src, ceil(length / 2)), floor(length / 2) + 1)  # Tradingview
    trima = sma(sma(x, n), n)  # Tradingview

Warning:
    TA-Lib Correlation: ```np.float64(0.9991752493891967)```

Tip:
    Corrective contributions welcome!

   Nr   r   )TRIMAg      ?r   )r   r   fillnaT)inplaceTRIMA_overlap)r   r	   r
   r   r   r   r   roundr   shiftr   namecategory)
r   r   r   r   r   mode_talr   trimahalf_lengthsma1s
             R/var/www/html/trading/venv/lib/python3.13/site-packages/pandas_ta/overlap/trima.pyr   r   
   s    J 62&FU#E}u~HfF wHe$C6A:./5H=DH= {F# 6VH%t4 &"EJENL    )NNN)pandasr   pandas_ta._typingr   r   pandas_ta.mapsr   pandas_ta.utilsr   r   r	   r
   r   boolr    r#   r"   <module>r*      s]     + " F F 
 6:CCC.2CC"*C Cr#   