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

Function freq_step

crates/openquant/src/hrp.rs:117–128  ·  view source on GitHub ↗
(resample_by: Option<&str>)

Source from the content-addressed store, hash-verified

115}
116
117fn freq_step(resample_by: Option<&str>) -> usize {
118 resample_by
119 .map(|f| f.to_ascii_lowercase())
120 .as_deref()
121 .map(|freq| match freq {
122 "w" | "week" | "weekly" => 5,
123 "m" | "month" | "monthly" => 21,
124 "b" | "d" | "day" | "daily" => 1,
125 _ => 1,
126 })
127 .unwrap_or(1)
128}
129
130fn resample_prices(prices: &DMatrix<f64>, step: usize) -> DMatrix<f64> {
131 if step <= 1 {

Callers 1

allocateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected