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)
Links
2 values
MACD
value
Range in (-inf
; +inf
).
Signal line
value
Range in (-inf
; +inf
).
2 signal
-
When
MACD
crossesSignal line
upwards, returns full buy signal. WhenMACD
crossesSignal line
downwards, returns full sell signal. Otherwise returns no signal. -
When
MACD
crosses zero line upwards, returns full buy signal. WhenMACD
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
type Instance = MACDInstance
type Instance = MACDInstance
Type of State
Initializes the State based on current Configuration
Dynamically sets Configuration parameters
Returns an IndicatorResult
size processing by the indicator (count of raw values, count of signals)
Creates an IndicatorInstance
function from this IndicatorConfig
.
Auto Trait Implementations
impl RefUnwindSafe for MACD
impl UnwindSafe for MACD
Blanket Implementations
Mutably borrows from an owned value. Read more