[−][src]Trait yata::core::IndicatorConfig
Each indicator has it's own Configuration with parameters
Each that config should implement IndicatorConfig
trait
See example with Example Indicator
Associated Types
type Instance: IndicatorInstance<Config = Self>
[src]
Type of State
Associated Constants
Loading content...Required methods
pub fn validate(&self) -> bool
[src]
Validates if Configuration is OK
pub fn set(&mut self, name: &str, value: String) -> Result<(), Error>
[src]
Dynamically sets Configuration parameters
pub fn size(&self) -> (u8, u8)
[src]
Returns an IndicatorResult
size processing by the indicator (count of raw values, count of signals)
pub fn init<T: OHLCV>(self, initial_value: &T) -> Result<Self::Instance, Error>
[src]
Initializes the State based on current Configuration
Provided methods
pub fn name(&self) -> &'static str
[src]
Returns a name of the indicator
pub fn init_fn<'a, T: OHLCV>(
self,
initial_value: &'a T
) -> Result<Box<dyn FnMut(&'a T) -> IndicatorResult>, Error> where
Self: 'static,
[src]
self,
initial_value: &'a T
) -> Result<Box<dyn FnMut(&'a T) -> IndicatorResult>, Error> where
Self: 'static,
Creates an IndicatorInstance
function from this IndicatorConfig
.
pub fn over<T, S>(self, inputs: S) -> Result<Vec<IndicatorResult>, Error> where
T: OHLCV,
S: AsRef<[T]>,
Self: Sized,
[src]
T: OHLCV,
S: AsRef<[T]>,
Self: Sized,
Evaluates indicator config over sequence of OHLC and returns sequence of IndicatorResult
s
use yata::prelude::*; use yata::helpers::{RandomCandles}; use yata::indicators::Trix; let candles: Vec<_> = RandomCandles::new().take(10).collect(); let trix = Trix::default(); let results = trix.over(&candles).unwrap(); println!("{:?}", results);
Implementors
impl IndicatorConfig for Example
[src]
Implementing IndicatorConfig
trait
type Instance = ExampleInstance
pub const NAME: &'static str
[src]
pub fn init<T: OHLCV>(self, _candle: &T) -> Result<Self::Instance, Error>
[src]
pub fn validate(&self) -> bool
[src]
Validates config values to be consistent
pub fn set(&mut self, name: &str, value: String) -> Result<(), Error>
[src]
Sets attributes of config by given name and value by String
pub fn size(&self) -> (u8, u8)
[src]
Our indicator will return single raw value and two signals