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

Method fmt

crates/openquant/src/filters.rs:16–28  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

14//! has no reset; it is not from AFML.
15//!
16//! Each decision uses prices up to bar `t`; a caller-supplied dynamic threshold must also
17//! use only information available at that bar to avoid look-ahead.
18//!
19//! ```
20//! use openquant::filters::{cusum_filter_indices, Threshold};
21//!
22//! # fn main() -> Result<(), openquant::filters::FilterError> {
23//! let close = vec![100.0, 100.4, 100.9, 101.3, 101.0, 100.2, 99.6, 99.9];
24//! // A 1% threshold: one upward event, then one downward.
25//! let events = cusum_filter_indices(&close, Threshold::Scalar(0.01))?;
26//! assert_eq!(events, vec![3, 5]);
27//! # Ok(())
28//! # }
29//! ```
30
31use crate::util::log_price::log_price_ratio;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected