Struct yata::indicators::StochasticOscillator[][src]

pub struct StochasticOscillator<M: MovingAverageConstructor = MA> {
    pub period: PeriodType,
    pub ma: M,
    pub signal: M,
    pub zone: ValueType,
}
Expand description

Stochastic Oscillator

2 values

  • main value

Range in [0.0; 1.0].

  • signal line value

Range in [0.0; 1.0].

3 signals

  • Signal #1

When main value crosses lower bound upwards, returns full buy signal. When main value crosses upper bound downwards, returns full sell signal. Otherwise returns no signal.

  • Signal #2

When signal line value crosses lower bound upwards, returns full buy signal. When signal line value crosses upper bound downwards, returns full sell signal. Otherwise returns no signal.

  • Signal #3

When main value crosses signal line upwards, returns full buy signal. When main value crosses signal line downwards, returns full sell signal. Otherwise returns no signal.

Fields

period: PeriodType

Period for searching highest high and lowest low. Default is 14.

Range in [2; PeriodType::MAX)

ma: M

Moving average for smoothing main value.

Default is SMA(14).

Usually it is equal to period.

Period range is in [2; PeriodType::MAX)

signal: M

Moving average type for smoothing signal line value.

Default is SMA(3).

Period range is in [2; PeriodType::MAX)

zone: ValueType

Zone size for #1 and #2 signals.

Range in [0.0; 0.5].

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)

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.