pub struct IndicatorRef {
pub name: String,
}Expand description
Reference to an indicator within a strategy, with convenience methods for building conditions.
Fields§
§name: StringImplementations§
Source§impl IndicatorRef
impl IndicatorRef
Sourcepub fn macd_signal(fast: usize, slow: usize, signal: usize) -> Self
pub fn macd_signal(fast: usize, slow: usize, signal: usize) -> Self
MACD signal line convenience constructor.
Sourcepub fn stoch_k(k_period: usize, d_period: usize) -> Self
pub fn stoch_k(k_period: usize, d_period: usize) -> Self
Stochastic %K convenience constructor.
Sourcepub fn stoch_d(k_period: usize, d_period: usize) -> Self
pub fn stoch_d(k_period: usize, d_period: usize) -> Self
Stochastic %D convenience constructor.
Sourcepub fn bb_upper(period: usize, std_dev: f64) -> Self
pub fn bb_upper(period: usize, std_dev: f64) -> Self
Bollinger Bands upper convenience constructor.
Sourcepub fn bb_middle(period: usize, std_dev: f64) -> Self
pub fn bb_middle(period: usize, std_dev: f64) -> Self
Bollinger Bands middle convenience constructor.
Sourcepub fn bb_lower(period: usize, std_dev: f64) -> Self
pub fn bb_lower(period: usize, std_dev: f64) -> Self
Bollinger Bands lower convenience constructor.
Sourcepub fn volume_sma(period: usize) -> Self
pub fn volume_sma(period: usize) -> Self
Volume SMA convenience constructor.
Sourcepub fn pivot_points() -> Self
pub fn pivot_points() -> Self
Pivot Points convenience constructor.
Sourcepub fn williams_r(period: usize) -> Self
pub fn williams_r(period: usize) -> Self
Williams %R convenience constructor.
Sourcepub fn crosses_above(self, value: f64) -> ConditionNode
pub fn crosses_above(self, value: f64) -> ConditionNode
Create a condition: this indicator crosses above a value.
Sourcepub fn crosses_above_indicator(self, other: IndicatorRef) -> ConditionNode
pub fn crosses_above_indicator(self, other: IndicatorRef) -> ConditionNode
Create a condition: this indicator crosses above another indicator.
Sourcepub fn crosses_below(self, value: f64) -> ConditionNode
pub fn crosses_below(self, value: f64) -> ConditionNode
Create a condition: this indicator crosses below a value.
Sourcepub fn crosses_below_indicator(self, other: IndicatorRef) -> ConditionNode
pub fn crosses_below_indicator(self, other: IndicatorRef) -> ConditionNode
Create a condition: this indicator crosses below another indicator.
Sourcepub fn is_above(self, value: f64) -> ConditionNode
pub fn is_above(self, value: f64) -> ConditionNode
Create a condition: this indicator is above a value.
Sourcepub fn is_above_indicator(self, other: IndicatorRef) -> ConditionNode
pub fn is_above_indicator(self, other: IndicatorRef) -> ConditionNode
Create a condition: this indicator is above another indicator.
Sourcepub fn is_below(self, value: f64) -> ConditionNode
pub fn is_below(self, value: f64) -> ConditionNode
Create a condition: this indicator is below a value.
Sourcepub fn is_below_indicator(self, other: IndicatorRef) -> ConditionNode
pub fn is_below_indicator(self, other: IndicatorRef) -> ConditionNode
Create a condition: this indicator is below another indicator.
Sourcepub fn equals(self, value: f64) -> ConditionNode
pub fn equals(self, value: f64) -> ConditionNode
Create a condition: this indicator equals a value (within epsilon).
Sourcepub fn equals_indicator(self, other: IndicatorRef) -> ConditionNode
pub fn equals_indicator(self, other: IndicatorRef) -> ConditionNode
Create a condition: this indicator equals another indicator (within epsilon).
Sourcepub fn is_between(self, lower: f64, upper: f64) -> ConditionNode
pub fn is_between(self, lower: f64, upper: f64) -> ConditionNode
Create a condition: this indicator is between two values.
Sourcepub fn is_rising(self, bars: u32) -> ConditionNode
pub fn is_rising(self, bars: u32) -> ConditionNode
Create a condition: this indicator is rising over bars bars.
Sourcepub fn is_falling(self, bars: u32) -> ConditionNode
pub fn is_falling(self, bars: u32) -> ConditionNode
Create a condition: this indicator is falling over bars bars.
Sourcepub fn scaled(self, multiplier: f64) -> ScaledIndicatorRef
pub fn scaled(self, multiplier: f64) -> ScaledIndicatorRef
Create a condition: this indicator scaled by a multiplier is above a value.
Trait Implementations§
Source§impl Clone for IndicatorRef
impl Clone for IndicatorRef
Source§fn clone(&self) -> IndicatorRef
fn clone(&self) -> IndicatorRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndicatorRef
impl Debug for IndicatorRef
Source§impl<'de> Deserialize<'de> for IndicatorRef
impl<'de> Deserialize<'de> for IndicatorRef
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 PartialEq for IndicatorRef
impl PartialEq for IndicatorRef
Source§fn eq(&self, other: &IndicatorRef) -> bool
fn eq(&self, other: &IndicatorRef) -> bool
self and other values to be equal, and is used by ==.