
    ia                    &    d Z ddlmZ ddlZdddZy)u8   ATR (rolling mean of True Range) — port fedele da V15.    )annotationsNc                B   | d   | d   z
  }| d   | d   j                         z
  j                         }| d   | d   j                         z
  j                         }t        j                  |||gd      j	                  d      j                  |      j                         S )u   
    ATR series. Caller typically reads iloc[-1] for current ATR and
    `series.rolling(20).mean().iloc[-1]` for the average — the ratio
    of the two becomes `atr_ratio` consumed by both Brains.
    highlowclose   )axis)shiftabspdconcatmaxrollingmean)dfperiodhlhclcs        ./home/work/apex_v16/analysis/indicators/atr.pycalc_atrr      s     
Fbi	B
V*r'{((*
*	/	/	1B
U)bk'')
)	.	.	0B99b"b\*..A.6>>vFKKMM    )   )r   zpd.DataFramer   intreturnz	pd.Series)__doc__
__future__r   pandasr   r    r   r   <module>r       s    > " 	Nr   