(&self, f: &mut fmt::Formatter<'_>)
| 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 | |
| 31 | use crate::util::log_price::log_price_ratio; |
nothing calls this directly
no outgoing calls
no test coverage detected