Struct yata::indicators::AverageDirectionalIndex [−][src]
pub struct AverageDirectionalIndex<M: MovingAverageConstructor = MA> {
pub method1: M,
pub method2: M,
pub period1: PeriodType,
pub zone: ValueType,
}
Expand description
Average Directional Index
Links:
- https://school.stockcharts.com/doku.php?id=technical_indicators:average_directional_index_adx
- https://www.investopedia.com/terms/a/adx.asp
- https://primexbt.com/blog/average-directional-index/
3 values
ADX
Range in [0.0
; 1.0
]
+DI
Range in [0.0
; 1.0
]
-DI
Range in [0.0
; 1.0
]
2 signals
BUY_ALL
whenADX
overzone
and+DI
>-DI
,SELL_ALL
whenADX
overzone
and-DI
>+DI
. Otherwise - no signal.- Digital signal by difference between
+DI
and-DI
Fields
method1: M
Default is RMA(14)
Period range is in (period1
; PeriodType::MAX
)
method2: M
Default is RMA(14)
Period range is in (period1
; PeriodType::MAX
)
period1: PeriodType
Default is 1
Range in [1
; min(di_length, adx_smoothing)
)
zone: ValueType
Default is 0.2
Range in [0.0
; 1.0
]
Trait Implementations
impl<'de, M: MovingAverageConstructor> Deserialize<'de> for AverageDirectionalIndex<M> where
M: Deserialize<'de>,
impl<'de, M: MovingAverageConstructor> Deserialize<'de> for AverageDirectionalIndex<M> where
M: Deserialize<'de>,
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 = AverageDirectionalIndexInstance<M>
type Instance = AverageDirectionalIndexInstance<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 AverageDirectionalIndex<M> where
M: RefUnwindSafe,
impl<M> Send for AverageDirectionalIndex<M> where
M: Send,
impl<M> Sync for AverageDirectionalIndex<M> where
M: Sync,
impl<M> Unpin for AverageDirectionalIndex<M> where
M: Unpin,
impl<M> UnwindSafe for AverageDirectionalIndex<M> where
M: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more