pub struct KagiConfig {
pub reversal_amount: f64,
pub source: PriceBasedSource,
}Expand description
Configuration for the Kagi chart transformation.
The reversal amount can be set directly, derived from ATR, or computed as a percentage of price.
Fields§
§reversal_amount: f64Reversal amount - price movement needed to create a new line
source: PriceBasedSourcePrice input; high/low gives continuation priority when a bar crosses both thresholds.
Implementations§
Source§impl KagiConfig
impl KagiConfig
Sourcepub fn new(reversal_amount: f64) -> Self
pub fn new(reversal_amount: f64) -> Self
Create a Kagi config with an explicit reversal amount in price units.
Sourcepub fn from_atr(bars: &[Bar], period: usize, multiplier: f64) -> Self
pub fn from_atr(bars: &[Bar], period: usize, multiplier: f64) -> Self
Calculate reversal amount from ATR (Avg True Range)
Sourcepub fn from_percentage(base_price: f64, percentage: f64) -> Self
pub fn from_percentage(base_price: f64, percentage: f64) -> Self
Calculate reversal amount as percentage of price
Trait Implementations§
Source§impl Clone for KagiConfig
impl Clone for KagiConfig
Source§fn clone(&self) -> KagiConfig
fn clone(&self) -> KagiConfig
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 moreSource§impl Debug for KagiConfig
impl Debug for KagiConfig
Auto Trait Implementations§
impl Freeze for KagiConfig
impl RefUnwindSafe for KagiConfig
impl Send for KagiConfig
impl Sync for KagiConfig
impl Unpin for KagiConfig
impl UnsafeUnpin for KagiConfig
impl UnwindSafe for KagiConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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