use crate::indicators::instantaneous_trendline::InstantaneousTrendline;
use crate::traits::Next;
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct InstantaneousTrendlineFeatures {
pub trend: f64,
pub strength: f64,
}
#[derive(Debug, Clone)]
pub struct InstantaneousTrendlineFeatureExtractor {
inner: InstantaneousTrendline,
}
impl InstantaneousTrendlineFeatureExtractor {
pub fn new() -> Self {
Self {
inner: InstantaneousTrendline::new(),
}
}
}
impl Next<f64> for InstantaneousTrendlineFeatureExtractor {
type Output = InstantaneousTrendlineFeatures;
fn next(&mut self, input: f64) -> Self::Output {
let trend = self.inner.next(input);
InstantaneousTrendlineFeatures { trend, strength: 0.0 }
}
}