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_ALLwhenADXoverzoneand+DI>-DI,SELL_ALLwhenADXoverzoneand-DI>+DI. Otherwise - no signal.- Digital signal by difference between
+DIand-DI
Fields§
§method1: MDefault is RMA(14)
Period range is in (period1; PeriodType::MAX)
method2: MDefault is RMA(14)
Period range is in (period1; PeriodType::MAX)
period1: PeriodTypeDefault is 1
Range in [1; min(di_length, adx_smoothing))
zone: ValueTypeDefault is 0.2
Range in [0.0; 1.0]
Trait Implementations§
Source§impl<M: Clone + MovingAverageConstructor> Clone for AverageDirectionalIndex<M>
impl<M: Clone + MovingAverageConstructor> Clone for AverageDirectionalIndex<M>
Source§fn clone(&self) -> AverageDirectionalIndex<M>
fn clone(&self) -> AverageDirectionalIndex<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M: Debug + MovingAverageConstructor> Debug for AverageDirectionalIndex<M>
impl<M: Debug + MovingAverageConstructor> Debug for AverageDirectionalIndex<M>
Source§impl Default for AverageDirectionalIndex
impl Default for AverageDirectionalIndex
Source§impl<'de, M> Deserialize<'de> for AverageDirectionalIndex<M>where
M: Deserialize<'de> + MovingAverageConstructor,
impl<'de, M> Deserialize<'de> for AverageDirectionalIndex<M>where
M: Deserialize<'de> + MovingAverageConstructor,
Source§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
Source§impl<M: MovingAverageConstructor> IndicatorConfig for AverageDirectionalIndex<M>
impl<M: MovingAverageConstructor> IndicatorConfig for AverageDirectionalIndex<M>
Source§type Instance = AverageDirectionalIndexInstance<M>
type Instance = AverageDirectionalIndexInstance<M>
Type of State
Source§fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
Initializes the State based on current Configuration
Source§fn set(&mut self, name: &str, value: String) -> Result<(), Error>
fn set(&mut self, name: &str, value: String) -> Result<(), Error>
Dynamically sets Configuration parameters
Source§fn size(&self) -> (u8, u8)
fn size(&self) -> (u8, u8)
Returns an
IndicatorResult size processing by the indicator (count of raw values, count of signals)Source§impl<M> Serialize for AverageDirectionalIndex<M>where
M: Serialize + MovingAverageConstructor,
impl<M> Serialize for AverageDirectionalIndex<M>where
M: Serialize + MovingAverageConstructor,
impl<M: Copy + MovingAverageConstructor> Copy for AverageDirectionalIndex<M>
Auto Trait Implementations§
impl<M> Freeze for AverageDirectionalIndex<M>where
M: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, I, C> IndicatorConfigDyn<T> for Cwhere
T: OHLCV,
I: IndicatorInstanceDyn<T> + IndicatorInstance<Config = C> + 'static,
C: IndicatorConfig<Instance = I> + Clone + 'static,
impl<T, I, C> IndicatorConfigDyn<T> for Cwhere
T: OHLCV,
I: IndicatorInstanceDyn<T> + IndicatorInstance<Config = C> + 'static,
C: IndicatorConfig<Instance = I> + Clone + 'static,
Source§fn init(
&self,
initial_value: &T,
) -> Result<Box<dyn IndicatorInstanceDyn<T>>, Error>
fn init( &self, initial_value: &T, ) -> Result<Box<dyn IndicatorInstanceDyn<T>>, Error>
Dynamically initializes the State based on the current Configuration
Source§fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
Evaluates dynamically dispatched
IndicatorConfig over series of OHLC and returns series of IndicatorResults Read more