pub struct Envelopes<M: MovingAverageConstructor = MA> {
pub ma: M,
pub k: ValueType,
pub source: Source,
pub source2: Source,
}Expand description
Envelopes
§Links
§3 values
Upper bound
Range of values is the same as the range of the source values.
Lower bound
Range of values is the same as the range of the source values.Action
- Raw
Source2value
§1 signal
- Signal 1 appears when
Source2value crosses bounds. WhenSource2value crossesupper boundupwards, returns full sell signal. WhenSource2value crosseslower bounddownwards, returns full buy signal.
Fields§
§ma: M§k: ValueTypeBound relative size. Default is 0.1.
Range in (0.0; +inf).
source: SourceSource value type for bounds. Default is Close.
source2: SourceSource2 value type for actual price. Default is Close.
Trait Implementations§
Source§impl<'de, M> Deserialize<'de> for Envelopes<M>where
M: Deserialize<'de> + MovingAverageConstructor,
impl<'de, M> Deserialize<'de> for Envelopes<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 Envelopes<M>
impl<M: MovingAverageConstructor> IndicatorConfig for Envelopes<M>
Source§type Instance = EnvelopesInstance<M>
type Instance = EnvelopesInstance<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 Envelopes<M>
Auto Trait Implementations§
impl<M> Freeze for Envelopes<M>where
M: Freeze,
impl<M> RefUnwindSafe for Envelopes<M>where
M: RefUnwindSafe,
impl<M> Send for Envelopes<M>where
M: Send,
impl<M> Sync for Envelopes<M>where
M: Sync,
impl<M> Unpin for Envelopes<M>where
M: Unpin,
impl<M> UnwindSafe for Envelopes<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 IndicatorResults Read more