Struct yata::indicators::TrendStrengthIndex [−][src]
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
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 = TrendStrengthIndexInstance
type Instance = TrendStrengthIndexInstance
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 TrendStrengthIndex
impl Send for TrendStrengthIndex
impl Sync for TrendStrengthIndex
impl Unpin for TrendStrengthIndex
impl UnwindSafe for TrendStrengthIndex
Blanket Implementations
Mutably borrows from an owned value. Read more