Struct yata::indicators::AwesomeOscillator
source · pub struct AwesomeOscillator<M: MovingAverageConstructor = MA> {
pub ma1: M,
pub ma2: M,
pub source: Source,
pub left: PeriodType,
pub right: PeriodType,
pub conseq_peaks: u8,
}
Expand description
Awesome Oscillator
§Links
§1 value
- Absolute difference between fast and slow periods MA
Range in (-inf
; +inf
)
§2 signals
- “Twin Peaks”. When
value
is below zero line and we gotconseq_peaks
lower peaks, then returns full positive signal Whenvalue
is above zero line and we gotconseq_peaks
higher peaks, then returns full negative signal. Otherwise gives no signal. - Gives signal when
values
crosses zero line
Fields§
§ma1: M
Default is SMA(34)
Period range in (ma2’s period; PeriodType::MAX
).
ma2: M
Default is SMA(5)
Period range in [3
; ma1’s period).
source: Source
Default is HL2
.
left: PeriodType
Default is 1
.
Range in [1
; PeriodType::MAX
-right
).
right: PeriodType
Default is 1
.
Range in [1
; PeriodType::MAX
-left
).
conseq_peaks: u8
Default is 2
.
Range in [1
; PeriodType::MAX
].
Trait Implementations§
source§impl<M: Clone + MovingAverageConstructor> Clone for AwesomeOscillator<M>
impl<M: Clone + MovingAverageConstructor> Clone for AwesomeOscillator<M>
source§fn clone(&self) -> AwesomeOscillator<M>
fn clone(&self) -> AwesomeOscillator<M>
Returns a copy 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 AwesomeOscillator<M>
impl<M: Debug + MovingAverageConstructor> Debug for AwesomeOscillator<M>
source§impl Default for AwesomeOscillator<MA>
impl Default for AwesomeOscillator<MA>
source§impl<'de, M> Deserialize<'de> for AwesomeOscillator<M>where
M: Deserialize<'de> + MovingAverageConstructor,
impl<'de, M> Deserialize<'de> for AwesomeOscillator<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 AwesomeOscillator<M>
impl<M: MovingAverageConstructor> IndicatorConfig for AwesomeOscillator<M>
§type Instance = AwesomeOscillatorInstance<M>
type Instance = AwesomeOscillatorInstance<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 AwesomeOscillator<M>where
M: Serialize + MovingAverageConstructor,
impl<M> Serialize for AwesomeOscillator<M>where
M: Serialize + MovingAverageConstructor,
impl<M: Copy + MovingAverageConstructor> Copy for AwesomeOscillator<M>
Auto Trait Implementations§
impl<M> RefUnwindSafe for AwesomeOscillator<M>where
M: RefUnwindSafe,
impl<M> Send for AwesomeOscillator<M>where
M: Send,
impl<M> Sync for AwesomeOscillator<M>where
M: Sync,
impl<M> Unpin for AwesomeOscillator<M>where
M: Unpin,
impl<M> UnwindSafe for AwesomeOscillator<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, 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