Struct yata::indicators::TrueStrengthIndex
source · pub struct TrueStrengthIndex {
pub period1: PeriodType,
pub period2: PeriodType,
pub period3: PeriodType,
pub zone: ValueType,
pub source: Source,
}
Expand description
True Strength Index
§Links
§2 values
main
value
Range in [-1.0
; 1.0
]
signal line
value
Range in [-1.0
; 1.0
]
§3 signals
- Signal #1.
When main
value crosses upper zone
upwards , returns full sell signal.
When main
value crosses lower -zone
downwards, returns full buy signal.
Otherwise returns no signal.
-
Signal #2. When
main
value crosses zero line upwards, returns full buy signal. Whenmain
value crosses zero line downwards, returns full sell signal. Otherwise returns no signal. -
Signal #3. When
main
value crossessignal line
upwards, returns full buy signal. Whenmain
value crossessignal line
downwards, returns full sell signal. Otherwise returns no signal.
Fields§
§period1: PeriodType
Long TSI period. Default is 25
.
Range in [period2
, PeriodType::MAX
).
period2: PeriodType
Short TSI period. Default is 13
.
Range in (2
, period1
].
period3: PeriodType
Signal line MA period. Default is 13
.
Range in [2
, PeriodType::MAX
).
zone: ValueType
Signal zone size. Default is 0.25
.
Range in [0.0
; 1.0
]
source: Source
Source type of values. Default is Close
Trait Implementations§
source§impl Clone for TrueStrengthIndex
impl Clone for TrueStrengthIndex
source§fn clone(&self) -> TrueStrengthIndex
fn clone(&self) -> TrueStrengthIndex
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TrueStrengthIndex
impl Debug for TrueStrengthIndex
source§impl Default for TrueStrengthIndex
impl Default for TrueStrengthIndex
source§impl<'de> Deserialize<'de> for TrueStrengthIndex
impl<'de> Deserialize<'de> for TrueStrengthIndex
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 TrueStrengthIndex
impl IndicatorConfig for TrueStrengthIndex
§type Instance = TrueStrengthIndexInstance
type Instance = TrueStrengthIndexInstance
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 TrueStrengthIndex
impl Serialize for TrueStrengthIndex
impl Copy for TrueStrengthIndex
Auto Trait Implementations§
impl RefUnwindSafe for TrueStrengthIndex
impl Send for TrueStrengthIndex
impl Sync for TrueStrengthIndex
impl Unpin for TrueStrengthIndex
impl UnwindSafe for TrueStrengthIndex
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