pub fn analyze_ema(
candles: &[Candle],
short_p: usize,
long_p: usize,
short_type: MaType,
long_type: MaType,
) -> Vec<EmaAnalysis>Expand description
Analyze EMA/MA crossovers and patterns
§Arguments
candles- Slice of candle datashort_p- Short period for MAlong_p- Long period for MAshort_type- Type of MA for short periodlong_type- Type of MA for long period
§Returns
Vector of EmaAnalysis containing detailed analysis for each candle
§Example
use your_crate::{Candle, MaType, analyze_ema};
let candles = vec![
Candle { time: 1, open: 100.0, high: 105.0, low: 99.0, close: 103.0 },
// ... more candles
];
let analysis = analyze_ema(&candles, 10, 20, MaType::EMA, MaType::HMA);