Struct yata::indicators::TrendStrengthIndex
source · pub struct TrendStrengthIndex {
pub period: PeriodType,
pub zone: ValueType,
pub reverse_offset: PeriodType,
pub source: Source,
}
Expand description
Trend Strength Index
There are bunch of different indicators named “Trend Strength Index” on the internet.
This particular one was seen somewhere a long time ago. I can’t even tell where. It produces an oscillator which may move in range [-1.0
; 1.0
].
§1 value
Main value
Range in [-1.0
; 1.0
]
§2 signals
-
When
main value
crosses upperzone
downwards, gives full negative #1 signal. Whenmain value
crosses lowerzone
upwards, gives full positive #1 signal. -
When
main value
is below lowerzone
and changes direction upwards, gives full positive #2 signal Whenmain value
is above upperzone
and changes direction downwards, gives full negative #2 signal
Fields§
§period: PeriodType
Main period length. Default is 14
.
Range in [2
; PeriodType::MAX
).
zone: ValueType
Zone value determines when signal #2 appears. Default is 0.75
.
Range in [0.0
; 1.0
).
reverse_offset: PeriodType
Reverse period
Range in [1
; PeriodType::MAX
/2
].
source: Source
Source type of values. Default is Close
.
Trait Implementations§
source§impl Clone for TrendStrengthIndex
impl Clone for TrendStrengthIndex
source§fn clone(&self) -> TrendStrengthIndex
fn clone(&self) -> TrendStrengthIndex
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TrendStrengthIndex
impl Debug for TrendStrengthIndex
source§impl Default for TrendStrengthIndex
impl Default for TrendStrengthIndex
source§impl<'de> Deserialize<'de> for TrendStrengthIndex
impl<'de> Deserialize<'de> for TrendStrengthIndex
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>,
source§impl IndicatorConfig for TrendStrengthIndex
impl IndicatorConfig for TrendStrengthIndex
§type Instance = TrendStrengthIndexInstance
type Instance = TrendStrengthIndexInstance
source§fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
source§fn set(&mut self, name: &str, value: String) -> Result<(), Error>
fn set(&mut self, name: &str, value: String) -> Result<(), Error>
source§fn size(&self) -> (u8, u8)
fn size(&self) -> (u8, u8)
IndicatorResult
size processing by the indicator (count of raw values, count of signals)
source§impl Serialize for TrendStrengthIndex
impl Serialize for TrendStrengthIndex
impl Copy for TrendStrengthIndex
Auto Trait Implementations§
impl RefUnwindSafe for TrendStrengthIndex
impl Send for TrendStrengthIndex
impl Sync for TrendStrengthIndex
impl Unpin for TrendStrengthIndex
impl UnwindSafe for TrendStrengthIndex
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
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>
source§fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
IndicatorConfig
over series of OHLC and returns series of IndicatorResult
s Read more