
    Q-jV	                         d dl mZmZ d dlmZmZ d dlmZ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defdZy)    )	DataFrameSeries)DictLikeInt)hlc3sma)v_offsetv_pos_defaultv_series   )atrNhighlowcloselength
atr_lengthoffsetkwargsreturnc                    t        |d      }t        |d      }t        ||      dz   }t        | |      } t        ||      }t        ||      }| ||yt        |      }t	        | |||      }t        | ||      }	t        |	|      }
|
|z   }|
|z
  }|dk7  rD|
j                  |      }
|j                  |      }|j                  |      }|j                  |      }d|v rX|
j                  |d   d	
       |j                  |d   d	
       |j                  |d   d	
       |j                  |d   d	
       d| d| }d| |
_	        d| |_	        d| |_	        d| |_	        dx|
_
        |_
        |
j                  x|_
        |_
        |
j                  |
|j                  ||j                  ||j                  |i}t        ||j                        }d| |_	        |
j                  |_
        |S )a0  Aberration

    Similar to Keltner Channels.

    Sources:
        * [Request #46](https://github.com/twopirllc/pandas-ta/issues/46)

    Parameters:
        high (Series): ```high``` Series
        low (Series): ```low``` Series
        close (Series): ```close``` Series
        length (int): The period. Default: ```5```
        atr_length (int): ATR period. Default: ```15```
        offset (int): Post shift. Default: ```0```

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

    Returns:
        (DataFrame): 4 columns
          r   N)r   r   r   r   )r   r   r   r   fillnaT)inplace_ABER_ZGABER_SGABER_XGABER_ATR
volatility)indexABER)r
   maxr   r	   r   r   r   shiftr   namecategoryr   r!   )r   r   r   r   r   r   r   _lengthatr_jgzgsgxg_propsdatadfs                   m/Users/jameslopez/projects/TradingBot25/.venv/lib/python3.12/site-packages/pandas_ta/volatility/aberration.py
aberrationr1   
   s   6 61%Fz2.J*f%)GD'"D
3
 CUG$E|s{emfF DczBD	4S	.B	RB	dB	dB {XXfXXfXXfzz&! 6
		&"D	1
		&"D	1
		&"D	1F8$d3 *&Fx BGx BGx BG6(#DI ,,BK"+"$++-BK$-GGR"bggr499dCD	4u{{	+BVHoBG++BKI    )NNN)pandasr   r   pandas_ta._typingr   r   pandas_ta.overlapr   r   pandas_ta.utilsr	   r
   r   r   r1    r2   r0   <module>r8      ss    $ + ' = =  +/K
KK&,KK$'K K #+K 	Kr2   