indexes_rs/v1/stochastic/
types.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#[derive(Debug, Clone, PartialEq)]
pub enum StochSignal {
    Buy,
    Sell,
    Overbought,
    Oversold,
    Neutral,
}

#[derive(Debug, Clone, PartialEq)]
pub enum StochCondition {
    Overbought,
    Oversold,
    Strong,
    Weak,
    Neutral,
}

#[derive(Debug, Clone, PartialEq)]
pub enum StochCrossover {
    Bullish,
    Bearish,
    None,
}

pub struct StochResult {
    pub k_value: f64,
    pub d_value: f64,
    pub signal: StochSignal,
    pub condition: StochCondition,
    pub crossover: StochCrossover,
    pub strength: f64,
}