Struct yata::indicators::CommodityChannelIndex
source · pub struct CommodityChannelIndex {
pub period: PeriodType,
pub zone: ValueType,
pub source: Source,
}
Expand description
Commodity Channel Index
§Links
§1 value
oscillator
value. Most of the time value is in the range around [-1.0
;+1.0
]
Range in (-inf
; +inf
)
§1 signal
When oscillator
value goes above zone
, then returns full sell signal.
When oscillator
value goes below -zone
, then returns full buy signal.
Otherwise no signal
Fields§
§period: PeriodType
Main period size. Default is 18
.
Range in [2
; PeriodType::MAX
).
zone: ValueType
Signal zone size. Default is 1.0
.
Range in [0.0
; +inf
).
source: Source
Source type. Default is Close
.
Trait Implementations§
source§impl Clone for CommodityChannelIndex
impl Clone for CommodityChannelIndex
source§fn clone(&self) -> CommodityChannelIndex
fn clone(&self) -> CommodityChannelIndex
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 Debug for CommodityChannelIndex
impl Debug for CommodityChannelIndex
source§impl Default for CommodityChannelIndex
impl Default for CommodityChannelIndex
source§impl<'de> Deserialize<'de> for CommodityChannelIndex
impl<'de> Deserialize<'de> for CommodityChannelIndex
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 IndicatorConfig for CommodityChannelIndex
impl IndicatorConfig for CommodityChannelIndex
§type Instance = CommodityChannelIndexInstance
type Instance = CommodityChannelIndexInstance
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 Serialize for CommodityChannelIndex
impl Serialize for CommodityChannelIndex
impl Copy for CommodityChannelIndex
Auto Trait Implementations§
impl RefUnwindSafe for CommodityChannelIndex
impl Send for CommodityChannelIndex
impl Sync for CommodityChannelIndex
impl Unpin for CommodityChannelIndex
impl UnwindSafe for CommodityChannelIndex
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