
    Q-jB                     v    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ededed	ed
ededededefdZy)    )Series)DictLikeInt)Imports)non_zero_rangev_offsetv_seriesv_talibNhighlowclosevolumeopen_taliboffsetkwargsreturnc                    t        |       } t        |      }t        |      }t        |      }t        |      }t        |      }t        d   r |r|j                  rddlm}	  |	| |||      }
nI|t        |      }t        ||      }
nd|z  | |z   z
  }
t        | |      }|
||z  z  }
|
j                         }
|dk7  r|
j                  |      }
d|v r|
j                  |d   d       |dnd	|
_        d
|
_        |
S )a  Accumulation/Distribution

    This indicator attempts to quantify accumulation/distribution from a
    relative position within it's High-Low range and volume.

    Sources:
        * [tradingtechnologies](https://www.tradingtechnologies.com/help/x-study/technical-indicator-definitions/accumulationdistribution-ad/)

    Parameters:
        high (Series): ```high``` Series
        low (Series): ```low``` Series
        close (Series): ```close``` Series
        volume (Series): ```volume``` Series
        open_ (Series): Optional ```open``` Series
        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
    r   r   )AD   fillnaT)inplacer   ADor   )r	   r
   r   r   sizer   r   r   cumsumshiftr   namecategory)r   r   r   r   r   r   r   r   mode_talr   adhigh_low_ranges               a/Users/jameslopez/projects/TradingBot25/.venv/lib/python3.12/site-packages/pandas_ta/volume/ad.pyr    r    	   s   : D>D
3-CUOEfFu~HfF wHc5&)UOEu-BUdSj)B'c2
f~%%YY[ {XXf 6
		&"D	1 mdBGBKI    )NNN)pandasr   pandas_ta._typingr   r   pandas_ta.mapsr   pandas_ta.utilsr   r   r	   r
   boolr     r#   r"   <module>r*      so     + " G G )-?
??&,?6<??!%? ? #+? 	?r#   