
    Q-j                         d dl mZ 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mZ ddlmZ 	 	 dd	ed
ededededefdZy)    )isnan)Series)DictLikeInt)Imports)v_offsetv_pos_defaultv_seriesv_talib   )emaNcloselengthtaliboffsetkwargsreturnc                    t        |d      }t        | |      } | yt        |      }t        |      }t        d   r|rddlm}  || |      }n$t        | ||      }t        |||      }	d|z  |	z
  }t        t        |j                                     ry|dk7  r|j                  |      }d|v r|j                  |d   d	
       d| |_        d|_        |S )a  Double Exponential Moving Average

    This indicator attempts to create a smoother average with less lag than
    the EMA.

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

    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:
        fillna (value): ```pd.DataFrame.fillna(value)```

    Returns:
        (Series): 1 column

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

    Tip:
        Corrective contributions welcome!
    
   Nr   r   )DEMA)r   r   r      fillnaT)inplaceDEMA_overlap)r	   r
   r   r   r   r   r   r   allr   to_numpyshiftr   namecategory)
r   r   r   r   r   mode_talr   demaema1ema2s
             d/Users/jameslopez/projects/TradingBot25/.venv/lib/python3.12/site-packages/pandas_ta/overlap/dema.pyr"   r"      s    > 62&FUF#E}u~HfF wHE6"vX>fH=4x$
5!" {zz&! 6F8$d3 x DIDMK    )NNN)numpyr   pandasr   pandas_ta._typingr   r   pandas_ta.mapsr   pandas_ta.utilsr   r	   r
   r   r   boolr"    r&   r%   <module>r.      s`      + " F F 
 6:@@@.2@@"*@ @r&   