pub struct Trix<M: MovingAverageConstructor = MA> {
pub period1: PeriodType,
pub signal: M,
pub source: Source,
}
Expand description
TRIX (extended)
§Links
§2 values
main
value
Range is (-inf
; +inf
)
signal line
value
Range is (-inf
; +inf
)
§3 signals
-
When
main
value changes direction upwards, returns full buy signal. Whenmain
value changes direction downwards, returns full sell signal. Otherwise returns no signal. -
When
main
value crossessignal line
value upwards, returns full buy signal. Whenmain
value crossessignal line
value downwards, returns full sell signal. Otherwise returns no signal. -
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.
Fields§
§period1: PeriodType
TRIX period. Default is 18
.
Range in [3
; PeriodType::MAX
)
signal: M
§source: Source
Source type. Default is Close
Trait Implementations§
Source§impl<'de, M> Deserialize<'de> for Trix<M>where
M: Deserialize<'de> + MovingAverageConstructor,
impl<'de, M> Deserialize<'de> for Trix<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 Trix<M>
impl<M: MovingAverageConstructor> IndicatorConfig for Trix<M>
Source§type Instance = TRIXInstance<M>
type Instance = TRIXInstance<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)
impl<M: Copy + MovingAverageConstructor> Copy for Trix<M>
Auto Trait Implementations§
impl<M> Freeze for Trix<M>where
M: Freeze,
impl<M> RefUnwindSafe for Trix<M>where
M: RefUnwindSafe,
impl<M> Send for Trix<M>where
M: Send,
impl<M> Sync for Trix<M>where
M: Sync,
impl<M> Unpin for Trix<M>where
M: Unpin,
impl<M> UnwindSafe for Trix<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 IndicatorResult
s Read more