Struct yata::indicators::Kaufman
source · pub struct Kaufman {
pub period1: PeriodType,
pub period2: PeriodType,
pub period3: PeriodType,
pub filter_period: PeriodType,
pub square_smooth: bool,
pub k: ValueType,
pub source: Source,
}
Expand description
Kaufman Adaptive Moving Average (KAMA)
§Links
- https://corporatefinanceinstitute.com/resources/knowledge/trading-investing/kaufmans-adaptive-moving-average-kama/
- https://ru.wikipedia.org/wiki/%D0%90%D0%B4%D0%B0%D0%BF%D1%82%D0%B8%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D0%BA%D0%BE%D0%BB%D1%8C%D0%B7%D1%8F%D1%89%D0%B0%D1%8F_%D1%81%D1%80%D0%B5%D0%B4%D0%BD%D1%8F%D1%8F_%D0%9A%D0%B0%D1%83%D1%84%D0%BC%D0%B0%D0%BD%D0%B0
- https://www.marketvolume.com/technicalanalysis/kama.asp
§1 value
KAMA
value
Range of KAMA
values is the same as the range of the source
values.
§1 signal
-
if
filter_period
is less or equal than0
, then returns signal whenKAMA
crossessource
value. Whensource
crossesKAMA
upwards, returns full buy signal. Whensource
crossesKAMA
downwards, returns full sell signal. Otherwise returns no signal. -
if
filter_period
is greater than1
, it uses same cross betweensource
andKAMA
, but with additional filtering using standard deviation.
Fields§
§period1: PeriodType
Volatility calculation period. Default is 10
.
Range in [1
; PeriodType::MAX
).
period2: PeriodType
Fast period. Default is 2
.
Range in [1
; period3
).
period3: PeriodType
Slow period. Default is 30
.
Range in (period2
; PeriodType::MAX
).
filter_period: PeriodType
Filter period. Default is 10
.
Range in [0
; PeriodType::MAX
)
square_smooth: bool
Apply double smoothing. Default is true
.
k: ValueType
Standard deviation multiplier. Default is 0.3
.
Range in (0.0
; +inf
)
source: Source
Source type. Default is Close
Trait Implementations§
source§impl<'de> Deserialize<'de> for Kaufman
impl<'de> Deserialize<'de> for Kaufman
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 IndicatorConfig for Kaufman
impl IndicatorConfig for Kaufman
§type Instance = KaufmanInstance
type Instance = KaufmanInstance
source§fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
fn init<T: OHLCV>(self, candle: &T) -> Result<Self::Instance, Error>
source§fn set(&mut self, name: &str, value: String) -> Result<(), Error>
fn set(&mut self, name: &str, value: String) -> Result<(), Error>
source§fn size(&self) -> (u8, u8)
fn size(&self) -> (u8, u8)
IndicatorResult
size processing by the indicator (count of raw values, count of signals)
impl Copy for Kaufman
Auto Trait Implementations§
impl RefUnwindSafe for Kaufman
impl Send for Kaufman
impl Sync for Kaufman
impl Unpin for Kaufman
impl UnwindSafe for Kaufman
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
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>
source§fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
fn over(&self, inputs: &dyn AsRef<[T]>) -> Result<Vec<IndicatorResult>, Error>
IndicatorConfig
over series of OHLC and returns series of IndicatorResult
s Read more