/// Moving average type selector.
///
/// Used by strategies to configure which MA algorithm to use
/// for trend line computation. Each variant trades off between
/// lag reduction and noise sensitivity.
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum MaType {
/// Exponential Moving Average — standard, moderate lag.
Ema,
/// Hull Moving Average — minimal lag, can overshoot.
Hull,
/// Simple Moving Average — maximum smoothing, most lag.
Sma,
}
impl std::fmt::Display for MaType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
MaType::Ema => write!(f, "EMA"),
MaType::Hull => write!(f, "Hull"),
MaType::Sma => write!(f, "SMA"),
}
}
}