Function hydra_dx_math::ema::iterated_price_ema
source · pub fn iterated_price_ema(
iterations: u32,
prev: EmaPrice,
incoming: EmaPrice,
smoothing: Fraction
) -> EmaPrice
Expand description
Calculate the iterated exponential moving average for the given prices.
iterations
is the number of iterations of the EMA to calculate.
prev
is the previous oracle value, incoming
is the new value to integrate.
smoothing
is the smoothing factor of the EMA.