Struct yata::indicators::MACD [−][src]
pub struct MACD<M: MovingAverageConstructor = MA> {
pub ma1: M,
pub ma2: M,
pub signal: M,
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
ma1: M
ma2: M
signal: M
source: Source
Source value type. Default is Close
Trait Implementations
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
type Instance = MACDInstance<M>
type Instance = MACDInstance<M>
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<M> RefUnwindSafe for MACD<M> where
M: RefUnwindSafe,
impl<M> UnwindSafe for MACD<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more