pub fn dema(data: &[f64], period: usize) -> Result<Vec<Option<f64>>>Expand description
Calculate Double Exponential Moving Average (DEMA).
DEMA = 2 * EMA - EMA(EMA) Reduces lag compared to simple EMA.
§Arguments
data- Price data (typically close prices)period- Number of periods
§Formula
DEMA = 2 * EMA - EMA(EMA)
§Example
use finance_query::indicators::dema;
let prices = vec![10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0];
let result = dema(&prices, 3).unwrap();