
    Q-ja                     x    d dl mZ d dlmZmZ d dlmZ d dlmZm	Z	m
Z
 ddlmZ 	 	 	 dded	ed
ededededefdZy)    )Series)DictLikeInt)wma)v_offsetv_pos_defaultv_series   )rocNcloselengthfastslowoffsetkwargsreturnc                 j   t        |d      }t        |d      }t        |d      }||z   |z   }t        | |      } | yt        |      }t        | |      t        | |      z   }t	        ||      }|dk7  r|j                  |      }d|v r|j                  |d   d       d	| d
| d
| |_        d|_        |S )aP  Coppock Curve

    This indicator, by Edwin Coppock 1962, was originally called the
    "Trendex Model", attempts to identify major upturns and downturns.

    Sources:
        * [wikipedia](https://en.wikipedia.org/wiki/Coppock_curve)

    Parameters:
        close (Series): ```close``` Series
        length (int): WMA period. Default: ```10```
        fast (int): Fast ROC period. Default: ```11```
        slow (int): Slow ROC period. Default: ```14```
        offset (int): Post shift. Default: ```0```

    Other Parameters:
        fillna (value): ```pd.DataFrame.fillna(value)```

    Returns:
        (Series): 1 column

    Note:
        Although designed for monthly use, a daily calculation over the same
        period length can be made, converting the periods to 294-day and
        231-day rate of changes, and a 210-day WMA.

    
         Nr   fillnaT)inplaceCOPC__momentum)	r   r	   r   r   r   shiftr   namecategory)	r   r   r   r   r   r   _length	total_roccoppocks	            h/Users/jameslopez/projects/TradingBot25/.venv/lib/python3.12/site-packages/pandas_ta/momentum/coppock.pyr!   r!   
   s    B 62&Fr"Dr"Dtmd"GUG$E}fF E4 3ud#33I)V$G {--' 6vh'6 4&$q1GL!GN    )NNNN)pandasr   pandas_ta._typingr   r   pandas_ta.overlapr   pandas_ta.utilsr   r   r	   r   r!    r#   r"   <module>r)      se     + ! = = 
 "&"&<<<
<< < #+< 	<r#   