Struct yata::indicators::ChandeKrollStop
source · pub struct ChandeKrollStop<M: MovingAverageConstructor = MA> {
pub ma: M,
pub x: ValueType,
pub q: PeriodType,
pub source: Source,
}
Expand description
Chande Kroll Stop
§Links
§3 values
-
stop long
Range of values is the same as the range of thesource
values. -
source
value -
stop short
Range of values is the same as the range of the source
values.
§2 signals
- signal 1 is calculated according to relative position of the
source
value betweenstop short
andstop long
values.
When source
value goes above stop short
, then returns full buy signal.
When source
value goes below stop long
, then returns full sell signal.
- signal 2 appears only when
stop long
crossesstop short
upwards.
When cumulative move of stop short
and stop long
is upwards, then returns full buy.
When cumulative move of stop short
and stop long
is downwards, then returns full sell.
Fields§
§ma: M
§x: ValueType
ATR multiplier. Default is 1.0
.
Range in [0
; +inf
)
q: PeriodType
multiplied highest/lowest period length. Default is 9
.
Range in [1
; PeriodType::MAX
]
source: Source
Price source. Default is Close
Trait Implementations§
source§impl<M: Clone + MovingAverageConstructor> Clone for ChandeKrollStop<M>
impl<M: Clone + MovingAverageConstructor> Clone for ChandeKrollStop<M>
source§fn clone(&self) -> ChandeKrollStop<M>
fn clone(&self) -> ChandeKrollStop<M>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<M: Debug + MovingAverageConstructor> Debug for ChandeKrollStop<M>
impl<M: Debug + MovingAverageConstructor> Debug for ChandeKrollStop<M>
source§impl Default for ChandeKrollStop<MA>
impl Default for ChandeKrollStop<MA>
source§impl<'de, M> Deserialize<'de> for ChandeKrollStop<M>where
M: Deserialize<'de> + MovingAverageConstructor,
impl<'de, M> Deserialize<'de> for ChandeKrollStop<M>where
M: Deserialize<'de> + MovingAverageConstructor,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<M: MovingAverageConstructor> IndicatorConfig for ChandeKrollStop<M>
impl<M: MovingAverageConstructor> IndicatorConfig for ChandeKrollStop<M>
§type Instance = ChandeKrollStopInstance<M>
type Instance = ChandeKrollStopInstance<M>
Type of State
source§fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
Initializes the State based on current Configuration
source§fn set(&mut self, name: &str, value: String) -> Result<(), Error>
fn set(&mut self, name: &str, value: String) -> Result<(), Error>
Dynamically sets Configuration parameters
source§fn size(&self) -> (u8, u8)
fn size(&self) -> (u8, u8)
Returns an
IndicatorResult
size processing by the indicator (count of raw values, count of signals)
source§impl<M> Serialize for ChandeKrollStop<M>where
M: Serialize + MovingAverageConstructor,
impl<M> Serialize for ChandeKrollStop<M>where
M: Serialize + MovingAverageConstructor,
impl<M: Copy + MovingAverageConstructor> Copy for ChandeKrollStop<M>
Auto Trait Implementations§
impl<M> RefUnwindSafe for ChandeKrollStop<M>where
M: RefUnwindSafe,
impl<M> Send for ChandeKrollStop<M>where
M: Send,
impl<M> Sync for ChandeKrollStop<M>where
M: Sync,
impl<M> Unpin for ChandeKrollStop<M>where
M: Unpin,
impl<M> UnwindSafe for ChandeKrollStop<M>where
M: UnwindSafe,
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, I, C> IndicatorConfigDyn<T> for Cwhere
T: OHLCV,
I: IndicatorInstanceDyn<T> + IndicatorInstance<Config = C> + 'static,
C: IndicatorConfig<Instance = I> + Clone + 'static,
impl<T, I, C> IndicatorConfigDyn<T> for Cwhere
T: OHLCV,
I: IndicatorInstanceDyn<T> + IndicatorInstance<Config = C> + 'static,
C: IndicatorConfig<Instance = I> + Clone + 'static,
source§fn init(
&self,
initial_value: &T
) -> Result<Box<dyn IndicatorInstanceDyn<T>>, Error>
fn init( &self, initial_value: &T ) -> Result<Box<dyn IndicatorInstanceDyn<T>>, Error>
Dynamically initializes the State based on the current Configuration
source§fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
Evaluates dynamically dispatched
IndicatorConfig
over series of OHLC and returns series of IndicatorResult
s Read more