pub struct ATR { /* private fields */ }Expand description
Average True Range (ATR) — EMA-smoothed variant, not Wilder’s RMA.
This smooths true range with a standard EMA (alpha = 2/(period+1)), seeded
from the first bar’s high - low and emitting a value from bar 0 with no NaN
warmup. It is not the ATR that Wilder defined in 1978 and that TA-Lib,
TradingView Pine ta.atr, and pandas.ewm(alpha=1/period, adjust=False)
compute — for that, use TaATR, which is proptest-verified against
talib_rs::volatility::atr.
No authoritative source has been recorded for this EMA-smoothed variant; the
divergence and its blast radius (SuperTrend, Keltner, ATR trailing stop, TTM
Squeeze, VPN, S/R monitor, volatility-clustering regime) are tracked in
quantwave-xnaf and recorded as data in
crate::indicators::conventions::CONVENTION_NOTES.
Note that the Polars plugin pl.col(close).ta.atr(high, low) and
quantwave.talib.ATR are backed by TaATR and are Wilder; only this
struct and the atr(period, high, low, close) PyO3 batch function are not.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ATR
impl<'de> Deserialize<'de> for ATR
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ATR
impl RefUnwindSafe for ATR
impl Send for ATR
impl Sync for ATR
impl Unpin for ATR
impl UnsafeUnpin for ATR
impl UnwindSafe for ATR
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.