MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _get_gamma

Function _get_gamma

crates/openquant/src/microstructural_features.rs:121–137  ·  view source on GitHub ↗
(high: &[f64], low: &[f64])

Source from the content-addressed store, hash-verified

119}
120
121fn _get_gamma(high: &[f64], low: &[f64]) -> Vec<f64> {
122 let high_max = rolling_max(high, 2);
123 let low_min = rolling_min(low, 2);
124 high_max
125 .iter()
126 .zip(low_min.iter())
127 .map(
128 |(h, l)| {
129 if h.is_nan() || l.is_nan() || *l == 0.0 {
130 NAN
131 } else {
132 (h / l).ln().powi(2)
133 }
134 },
135 )
136 .collect()
137}
138
139fn _get_alpha(beta: &[f64], gamma: &[f64]) -> Vec<f64> {
140 let den = 3.0 - 2.0 * 2.0_f64.sqrt();

Callers 2

get_bekker_parkinson_volFunction · 0.85

Calls 2

rolling_maxFunction · 0.85
rolling_minFunction · 0.85

Tested by

no test coverage detected