pub struct StochasticParams {
pub k_period: usize,
pub k_smooth: usize,
pub d_period: usize,
}Expand description
Unvalidated (but Copy) stochastic parameter pack.
Build with StochasticParams::fast, StochasticParams::full, or struct update.
Prefer validating once via ValidatedStochastic::new for hot paths.
Fields§
§k_period: usizeLookback for highest high / lowest low.
k_smooth: usizeSMA length on raw %K (1 = Fast stochastic).
d_period: usizeSMA length on smoothed %K → %D line.
Implementations§
Source§impl StochasticParams
impl StochasticParams
Sourcepub const fn fast(k_period: usize, d_period: usize) -> Self
pub const fn fast(k_period: usize, d_period: usize) -> Self
Fast stochastic: raw %K over k_period, %D = SMA(d_period) of %K.
Common packs: fast(9, 3), fast(14, 3).
Sourcepub const fn full(k_period: usize, k_smooth: usize, d_period: usize) -> Self
pub const fn full(k_period: usize, k_smooth: usize, d_period: usize) -> Self
Full stochastic: smooth raw %K by k_smooth, then %D by d_period.
Common packs: full(14, 3, 3), full(60, 10, 1).
Sourcepub const fn warm_up_bars(self) -> usize
pub const fn warm_up_bars(self) -> usize
Minimum bars before both %K and %D can be defined.
Trait Implementations§
Source§impl Clone for StochasticParams
impl Clone for StochasticParams
Source§fn clone(&self) -> StochasticParams
fn clone(&self) -> StochasticParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StochasticParams
Source§impl Debug for StochasticParams
impl Debug for StochasticParams
impl Eq for StochasticParams
Source§impl Hash for StochasticParams
impl Hash for StochasticParams
Source§impl PartialEq for StochasticParams
impl PartialEq for StochasticParams
impl StructuralPartialEq for StochasticParams
Auto Trait Implementations§
impl Freeze for StochasticParams
impl RefUnwindSafe for StochasticParams
impl Send for StochasticParams
impl Sync for StochasticParams
impl Unpin for StochasticParams
impl UnsafeUnpin for StochasticParams
impl UnwindSafe for StochasticParams
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more