Struct yata::indicators::MACD[][src]

pub struct MACD {
    pub period1: PeriodType,
    pub method1: RegularMethods,
    pub period2: PeriodType,
    pub method2: RegularMethods,
    pub period3: PeriodType,
    pub method3: RegularMethods,
    pub source: Source,
}
Expand description

Moving average convergence/divergence (MACD)

2 values

  • MACD value

Range in (-inf; +inf).

  • Signal line value

Range in (-inf; +inf).

2 signal

  • When MACD crosses Signal line upwards, returns full buy signal. When MACD crosses Signal line downwards, returns full sell signal. Otherwise returns no signal.

  • When MACD crosses zero line upwards, returns full buy signal. When MACD crosses zero line downwards, returns full sell signal. Otherwise returns no signal.

Fields

period1: PeriodType

Fast MA period. Default is 12.

Range in [2; period2)

method1: RegularMethods

Fast MA type. Default is EMA.

period2: PeriodType

Slow MA period. Default is 26.

Range in (period1; PeriodType::MAX)

method2: RegularMethods

Slow MA type. Default is EMA.

period3: PeriodType

Signal line MA period. Default is 9.

Range in [2; PeriodType::MAX)

method3: RegularMethods

Signal line MA type. Default is EMA.

source: Source

Source value type. Default is Close

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Type of State

Name of an indicator

Initializes the State based on current Configuration

Validates if Configuration is OK

Dynamically sets Configuration parameters

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

Returns a name of the indicator

Creates an IndicatorInstance function from this IndicatorConfig.

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.