pub struct IchimokuCloud {
    pub l1: PeriodType,
    pub l2: PeriodType,
    pub l3: PeriodType,
    pub m: PeriodType,
    pub source: Source,
}
Expand description

Ichimoku cloud

§4 values

  • Tenkan Sen
  • Kijun Sen
  • Senkou Span A
  • Senkou Span B

Range of all the values is the same as the range of the source values.

§2 signals

  • When Tenkan Sen crosses Kijun Sen upwards and source value is greater than both Senkou Span A and B and when Senkou Span A is greater than Senkou Span B, returns full buy signal. When Tenkan Sen crosses Kijun Sen downwards and source value is lower than both Senkou Span A and B and when Senkou Span A is lower than Senkou Span B, returns full sell signal.

  • When source value crosses Kijun Sen upwards and source value is greater than both Senkou Span A and B and when Senkou Span A is greater than Senkou Span B, returns full buy signal. When source value crosses Kijun Sen downwards and source value is lower than both Senkou Span A and B and when Senkou Span A is lower than Senkou Span B, returns full sell signal.

Fields§

§l1: PeriodType

Tenkan Sen period. Default is 9.

Range in [1; l2).

§l2: PeriodType

Kijun Sen period. Default is 26.

Range in (l1; l3).

§l3: PeriodType

Senkou Span B period. Default is 52.

Range in (l2; PeriodType::MAX).

§m: PeriodType

Move Senkou Span A and B forward by this period. Default is 26.

Range in [1; PeriodType::MAX).

§source: Source

Source type. Default is Close.

Trait Implementations§

source§

impl Clone for IchimokuCloud

source§

fn clone(&self) -> IchimokuCloud

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IchimokuCloud

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for IchimokuCloud

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for IchimokuCloud

source§

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 IchimokuCloud

§

type Instance = IchimokuCloudInstance

Type of State
source§

const NAME: &'static str = "IchimokuCloud"

Name of an indicator
source§

fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>

Initializes the State based on current Configuration
source§

fn validate(&self) -> bool

Validates if Configuration is OK
source§

fn set(&mut self, name: &str, value: String) -> Result<(), Error>

Dynamically sets Configuration parameters
source§

fn size(&self) -> (u8, u8)

Returns an IndicatorResult size processing by the indicator (count of raw values, count of signals)
source§

fn name(&self) -> &'static str

Returns a name of the indicator
source§

fn init_fn<'a, T: OHLCV>( self, initial_value: &'a T ) -> Result<Box<dyn FnMut(&'a T) -> IndicatorResult>, Error>
where Self: 'static,

Creates an IndicatorInstance function from this IndicatorConfig.
source§

fn over<T, S>(self, inputs: S) -> Result<Vec<IndicatorResult>, Error>
where T: OHLCV, S: AsRef<[T]>, Self: Sized,

Evaluates indicator config over sequence of OHLC and returns sequence of IndicatorResults Read more
source§

impl Serialize for IchimokuCloud

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for IchimokuCloud

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, I, C> IndicatorConfigDyn<T> for C
where 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>

Dynamically initializes the State based on the current Configuration
source§

fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>

Evaluates dynamically dispatched IndicatorConfig over series of OHLC and returns series of IndicatorResults Read more
source§

fn name(&self) -> &'static str

Returns a name of the indicator
source§

fn validate(&self) -> bool

Validates if Configuration is OK
source§

fn set(&mut self, name: &str, value: String) -> Result<(), Error>

Dynamically sets Configuration parameters
source§

fn size(&self) -> (u8, u8)

Returns an IndicatorResult size processing by the indicator (count of raw values, count of signals)
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,