diff --git a/crates/brk_computer/src/vecs/cointime.rs b/crates/brk_computer/src/vecs/cointime.rs index da42e5a1b..c98e410e7 100644 --- a/crates/brk_computer/src/vecs/cointime.rs +++ b/crates/brk_computer/src/vecs/cointime.rs @@ -189,6 +189,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_active_price: ComputedVecsFromHeight::forced_import( path, @@ -208,6 +209,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_true_market_mean: ComputedVecsFromHeight::forced_import( path, @@ -227,6 +229,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_cointime_value_destroyed: ComputedVecsFromHeight::forced_import( path, @@ -286,6 +289,7 @@ impl Vecs { format, computation, indexes, + true, )?, }) } diff --git a/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs index 306189c27..1bc7f6f77 100644 --- a/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs +++ b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs @@ -20,47 +20,48 @@ pub struct ComputedRatioVecsFromDateIndex { pub price: Option>, pub ratio: ComputedVecsFromDateIndex, - pub ratio_sma: ComputedVecsFromDateIndex, - pub ratio_1w_sma: ComputedVecsFromDateIndex, - pub ratio_1m_sma: ComputedVecsFromDateIndex, - pub ratio_1y_sma: ComputedVecsFromDateIndex, - pub ratio_4y_sma: ComputedVecsFromDateIndex, - pub ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex, - pub ratio_sd: ComputedVecsFromDateIndex, - pub ratio_4y_sd: ComputedVecsFromDateIndex, - pub ratio_1y_sd: ComputedVecsFromDateIndex, - pub ratio_p99_9: ComputedVecsFromDateIndex, - pub ratio_p99_5: ComputedVecsFromDateIndex, - pub ratio_p99: ComputedVecsFromDateIndex, - pub ratio_p1: ComputedVecsFromDateIndex, - pub ratio_p0_5: ComputedVecsFromDateIndex, - pub ratio_p0_1: ComputedVecsFromDateIndex, - pub ratio_p1sd: ComputedVecsFromDateIndex, - pub ratio_p2sd: ComputedVecsFromDateIndex, - pub ratio_p3sd: ComputedVecsFromDateIndex, - pub ratio_m1sd: ComputedVecsFromDateIndex, - pub ratio_m2sd: ComputedVecsFromDateIndex, - pub ratio_m3sd: ComputedVecsFromDateIndex, - pub ratio_p99_9_as_price: ComputedVecsFromDateIndex, - pub ratio_p99_5_as_price: ComputedVecsFromDateIndex, - pub ratio_p99_as_price: ComputedVecsFromDateIndex, - pub ratio_p1_as_price: ComputedVecsFromDateIndex, - pub ratio_p0_5_as_price: ComputedVecsFromDateIndex, - pub ratio_p0_1_as_price: ComputedVecsFromDateIndex, - pub ratio_p1sd_as_price: ComputedVecsFromDateIndex, - pub ratio_p2sd_as_price: ComputedVecsFromDateIndex, - pub ratio_p3sd_as_price: ComputedVecsFromDateIndex, - pub ratio_m1sd_as_price: ComputedVecsFromDateIndex, - pub ratio_m2sd_as_price: ComputedVecsFromDateIndex, - pub ratio_m3sd_as_price: ComputedVecsFromDateIndex, - pub ratio_zscore: ComputedVecsFromDateIndex, - pub ratio_4y_zscore: ComputedVecsFromDateIndex, - pub ratio_1y_zscore: ComputedVecsFromDateIndex, + pub ratio_sma: Option>, + pub ratio_1w_sma: Option>, + pub ratio_1m_sma: Option>, + pub ratio_1y_sma: Option>, + pub ratio_4y_sma: Option>, + pub ratio_1y_sma_momentum_oscillator: Option>, + pub ratio_sd: Option>, + pub ratio_4y_sd: Option>, + pub ratio_1y_sd: Option>, + pub ratio_p99_9: Option>, + pub ratio_p99_5: Option>, + pub ratio_p99: Option>, + pub ratio_p1: Option>, + pub ratio_p0_5: Option>, + pub ratio_p0_1: Option>, + pub ratio_p1sd: Option>, + pub ratio_p2sd: Option>, + pub ratio_p3sd: Option>, + pub ratio_m1sd: Option>, + pub ratio_m2sd: Option>, + pub ratio_m3sd: Option>, + pub ratio_p99_9_as_price: Option>, + pub ratio_p99_5_as_price: Option>, + pub ratio_p99_as_price: Option>, + pub ratio_p1_as_price: Option>, + pub ratio_p0_5_as_price: Option>, + pub ratio_p0_1_as_price: Option>, + pub ratio_p1sd_as_price: Option>, + pub ratio_p2sd_as_price: Option>, + pub ratio_p3sd_as_price: Option>, + pub ratio_m1sd_as_price: Option>, + pub ratio_m2sd_as_price: Option>, + pub ratio_m3sd_as_price: Option>, + pub ratio_zscore: Option>, + pub ratio_4y_zscore: Option>, + pub ratio_1y_zscore: Option>, } const VERSION: Version = Version::ZERO; impl ComputedRatioVecsFromDateIndex { + #[allow(clippy::too_many_arguments)] pub fn forced_import( path: &Path, name: &str, @@ -69,6 +70,7 @@ impl ComputedRatioVecsFromDateIndex { format: Format, computation: Computation, indexes: &indexes::Vecs, + extended: bool, ) -> color_eyre::Result { let options = VecBuilderOptions::default().add_last(); @@ -96,366 +98,474 @@ impl ComputedRatioVecsFromDateIndex { indexes, options, )?, - ratio_sma: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_sma"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1w_sma: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1w_sma"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1m_sma: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1m_sma"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1y_sma: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1y_sma"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_4y_sma: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_4y_sma"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1y_sma_momentum_oscillator"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_4y_sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_4y_sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1y_sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1y_sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99_9: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99_9"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99_5: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99_5"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p1: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p1"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p0_5: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p0_5"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p0_1: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p0_1"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p1sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p1sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p2sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p2sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p3sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p3sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m1sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m1sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m2sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m2sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m3sd: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m3sd"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99_9_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99_9_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99_5_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99_5_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p99_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p99_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p1_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p1_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p0_5_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p0_5_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p0_1_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p0_1_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p1sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p1sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p2sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p2sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_p3sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_p3sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m1sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m1sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m2sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m2sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_m3sd_as_price: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_m3sd_as_price"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_zscore: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_zscore"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_4y_zscore: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_4y_zscore"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, - ratio_1y_zscore: ComputedVecsFromDateIndex::forced_import( - path, - &format!("{name}_ratio_1y_zscore"), - Source::Compute, - version + VERSION + Version::ZERO, - format, - computation, - indexes, - options, - )?, + ratio_sma: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_sma"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1w_sma: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1w_sma"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1m_sma: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1m_sma"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1y_sma: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1y_sma"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_4y_sma: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_4y_sma"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1y_sma_momentum_oscillator: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1y_sma_momentum_oscillator"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_4y_sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_4y_sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1y_sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1y_sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99_9: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99_9"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99_5: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99_5"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p1: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p1"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p0_5: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p0_5"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p0_1: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p0_1"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p1sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p1sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p2sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p2sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p3sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p3sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m1sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m1sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m2sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m2sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m3sd: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m3sd"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99_9_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99_9_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99_5_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99_5_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p99_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p99_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p1_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p1_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p0_5_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p0_5_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p0_1_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p0_1_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p1sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p1sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p2sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p2sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_p3sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_p3sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m1sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m1sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m2sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m2sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_m3sd_as_price: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_m3sd_as_price"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_zscore: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_zscore"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_4y_zscore: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_4y_zscore"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), + ratio_1y_zscore: extended.then(|| { + ComputedVecsFromDateIndex::forced_import( + path, + &format!("{name}_ratio_1y_zscore"), + Source::Compute, + version + VERSION + Version::ZERO, + format, + computation, + indexes, + options, + ) + .unwrap() + }), }) } @@ -534,9 +644,13 @@ impl ComputedRatioVecsFromDateIndex { }, )?; + if self.ratio_sma.is_none() { + return Ok(()); + } + let min_ratio_date = DateIndex::try_from(Date::MIN_RATIO).unwrap(); - self.ratio_sma.compute_all( + self.ratio_sma.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -552,7 +666,7 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_1w_sma.compute_all( + self.ratio_1w_sma.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -568,7 +682,7 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_1m_sma.compute_all( + self.ratio_1m_sma.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -584,7 +698,7 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_1y_sma.compute_all( + self.ratio_1y_sma.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -600,7 +714,7 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_4y_sma.compute_all( + self.ratio_4y_sma.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -616,27 +730,38 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_1y_sma_momentum_oscillator.compute_all( - indexer, - indexes, - starting_indexes, - exit, - |v, _, _, starting_indexes, exit| { - let mut ratio_1y_sma_iter = - self.ratio_1y_sma.dateindex.as_ref().unwrap().into_iter(); - v.compute_transform( - starting_indexes.dateindex, - self.ratio.dateindex.as_ref().unwrap(), - |(i, ratio, ..)| { - ( - i, - StoredF32::from(*ratio / *ratio_1y_sma_iter.unwrap_get_inner(i) - 1.0), - ) - }, - exit, - ) - }, - )?; + self.ratio_1y_sma_momentum_oscillator + .as_mut() + .unwrap() + .compute_all( + indexer, + indexes, + starting_indexes, + exit, + |v, _, _, starting_indexes, exit| { + let mut ratio_1y_sma_iter = self + .ratio_1y_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); + v.compute_transform( + starting_indexes.dateindex, + self.ratio.dateindex.as_ref().unwrap(), + |(i, ratio, ..)| { + ( + i, + StoredF32::from( + *ratio / *ratio_1y_sma_iter.unwrap_get_inner(i) - 1.0, + ), + ) + }, + exit, + ) + }, + )?; let ratio_version = self.ratio.dateindex.as_ref().unwrap().version(); self.mut_ratio_vecs() @@ -666,9 +791,30 @@ impl ComputedRatioVecsFromDateIndex { // unreachable!(); // } - let mut sma_iter = self.ratio_sma.dateindex.as_ref().unwrap().into_iter(); - let mut _4y_sma_iter = self.ratio_4y_sma.dateindex.as_ref().unwrap().into_iter(); - let mut _1y_sma_iter = self.ratio_1y_sma.dateindex.as_ref().unwrap().into_iter(); + let mut sma_iter = self + .ratio_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); + let mut _4y_sma_iter = self + .ratio_4y_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); + let mut _1y_sma_iter = self + .ratio_1y_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); let nan = StoredF32::from(f32::NAN); self.ratio @@ -679,77 +825,107 @@ impl ComputedRatioVecsFromDateIndex { .try_for_each(|(index, ratio)| -> Result<()> { if index < min_ratio_date { self.ratio_p0_1 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p0_5 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p1 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p99 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p99_5 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p99_9 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_4y_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_1y_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p1sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p2sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_p3sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_m1sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_m2sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, nan, exit)?; self.ratio_m3sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() @@ -758,32 +934,44 @@ impl ComputedRatioVecsFromDateIndex { let ratio = ratio.into_owned(); let pos = sorted.binary_search(&ratio).unwrap_or_else(|pos| pos); sorted.insert(pos, ratio); - self.ratio_p0_1.dateindex.as_mut().unwrap().forced_push_at( - index, - get_percentile(&sorted, 0.001), - exit, - )?; - self.ratio_p0_5.dateindex.as_mut().unwrap().forced_push_at( - index, - get_percentile(&sorted, 0.005), - exit, - )?; - self.ratio_p1.dateindex.as_mut().unwrap().forced_push_at( - index, - get_percentile(&sorted, 0.01), - exit, - )?; - self.ratio_p99.dateindex.as_mut().unwrap().forced_push_at( - index, - get_percentile(&sorted, 0.99), - exit, - )?; + self.ratio_p0_1 + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, get_percentile(&sorted, 0.001), exit)?; + self.ratio_p0_5 + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, get_percentile(&sorted, 0.005), exit)?; + self.ratio_p1 + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, get_percentile(&sorted, 0.01), exit)?; + self.ratio_p99 + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, get_percentile(&sorted, 0.99), exit)?; self.ratio_p99_5 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, get_percentile(&sorted, 0.995), exit)?; self.ratio_p99_9 + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() @@ -798,6 +986,8 @@ impl ComputedRatioVecsFromDateIndex { ); self.ratio_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() @@ -812,6 +1002,8 @@ impl ComputedRatioVecsFromDateIndex { ); self.ratio_4y_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() @@ -826,41 +1018,55 @@ impl ComputedRatioVecsFromDateIndex { ); self.ratio_1y_sd + .as_mut() + .unwrap() .dateindex .as_mut() .unwrap() .forced_push_at(index, _1y_sd, exit)?; - self.ratio_p1sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg + sd, - exit, - )?; - self.ratio_p2sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg + 2 * sd, - exit, - )?; - self.ratio_p3sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg + 3 * sd, - exit, - )?; - self.ratio_m1sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg - sd, - exit, - )?; - self.ratio_m2sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg - 2 * sd, - exit, - )?; - self.ratio_m3sd.dateindex.as_mut().unwrap().forced_push_at( - index, - avg - 3 * sd, - exit, - )?; + self.ratio_p1sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg + sd, exit)?; + self.ratio_p2sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg + 2 * sd, exit)?; + self.ratio_p3sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg + 3 * sd, exit)?; + self.ratio_m1sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg - sd, exit)?; + self.ratio_m2sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg - 2 * sd, exit)?; + self.ratio_m3sd + .as_mut() + .unwrap() + .dateindex + .as_mut() + .unwrap() + .forced_push_at(index, avg - 3 * sd, exit)?; } Ok(()) @@ -870,91 +1076,91 @@ impl ComputedRatioVecsFromDateIndex { .into_iter() .try_for_each(|v| v.safe_flush(exit))?; - self.ratio_p99_9.compute_rest( + self.ratio_p99_9.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p99_5.compute_rest( + self.ratio_p99_5.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p99.compute_rest( + self.ratio_p99.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p1.compute_rest( + self.ratio_p1.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p0_5.compute_rest( + self.ratio_p0_5.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p0_1.compute_rest( + self.ratio_p0_1.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_sd.compute_rest( + self.ratio_sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_4y_sd.compute_rest( + self.ratio_4y_sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_1y_sd.compute_rest( + self.ratio_1y_sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p1sd.compute_rest( + self.ratio_p1sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p2sd.compute_rest( + self.ratio_p2sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_p3sd.compute_rest( + self.ratio_p3sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_m1sd.compute_rest( + self.ratio_m1sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_m2sd.compute_rest( + self.ratio_m2sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, None as Option<&EagerVec<_, _>>, )?; - self.ratio_m3sd.compute_rest( + self.ratio_m3sd.as_mut().unwrap().compute_rest( indexes, starting_indexes, exit, @@ -965,13 +1171,20 @@ impl ComputedRatioVecsFromDateIndex { std::mem::transmute(&self.price.as_ref().unwrap().dateindex) }); - self.ratio_p99_as_price.compute_all( + self.ratio_p99_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p99.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p99 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -984,13 +1197,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p99_5_as_price.compute_all( + self.ratio_p99_5_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p99_5.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p99_5 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1003,13 +1223,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p99_9_as_price.compute_all( + self.ratio_p99_9_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p99_9.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p99_9 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1022,13 +1249,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p1_as_price.compute_all( + self.ratio_p1_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p1.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p1 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1041,13 +1275,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p0_5_as_price.compute_all( + self.ratio_p0_5_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p0_5.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p0_5 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1060,13 +1301,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p0_1_as_price.compute_all( + self.ratio_p0_1_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p0_1.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p0_1 + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1079,13 +1327,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p1sd_as_price.compute_all( + self.ratio_p1sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p1sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p1sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1098,13 +1353,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p2sd_as_price.compute_all( + self.ratio_p2sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p2sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p2sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1117,13 +1379,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_p3sd_as_price.compute_all( + self.ratio_p3sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_p3sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_p3sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1136,13 +1405,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_m1sd_as_price.compute_all( + self.ratio_m1sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_m1sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_m1sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1155,13 +1431,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_m2sd_as_price.compute_all( + self.ratio_m2sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_m2sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_m2sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1174,13 +1457,20 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_m3sd_as_price.compute_all( + self.ratio_m3sd_as_price.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, exit, |vec, _, _, starting_indexes, exit| { - let mut iter = self.ratio_m3sd.dateindex.as_ref().unwrap().into_iter(); + let mut iter = self + .ratio_m3sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap() + .into_iter(); vec.compute_transform( starting_indexes.dateindex, date_to_price, @@ -1193,7 +1483,7 @@ impl ComputedRatioVecsFromDateIndex { }, )?; - self.ratio_zscore.compute_all( + self.ratio_zscore.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -1202,14 +1492,14 @@ impl ComputedRatioVecsFromDateIndex { vec.compute_zscore( starting_indexes.dateindex, self.ratio.dateindex.as_ref().unwrap(), - self.ratio_sma.dateindex.as_ref().unwrap(), - self.ratio_sd.dateindex.as_ref().unwrap(), + self.ratio_sma.as_ref().unwrap().dateindex.as_ref().unwrap(), + self.ratio_sd.as_ref().unwrap().dateindex.as_ref().unwrap(), exit, ) }, )?; - self.ratio_4y_zscore.compute_all( + self.ratio_4y_zscore.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -1218,14 +1508,24 @@ impl ComputedRatioVecsFromDateIndex { vec.compute_zscore( starting_indexes.dateindex, self.ratio.dateindex.as_ref().unwrap(), - self.ratio_4y_sma.dateindex.as_ref().unwrap(), - self.ratio_4y_sd.dateindex.as_ref().unwrap(), + self.ratio_4y_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap(), + self.ratio_4y_sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap(), exit, ) }, )?; - self.ratio_1y_zscore.compute_all( + self.ratio_1y_zscore.as_mut().unwrap().compute_all( indexer, indexes, starting_indexes, @@ -1234,8 +1534,18 @@ impl ComputedRatioVecsFromDateIndex { vec.compute_zscore( starting_indexes.dateindex, self.ratio.dateindex.as_ref().unwrap(), - self.ratio_1y_sma.dateindex.as_ref().unwrap(), - self.ratio_1y_sd.dateindex.as_ref().unwrap(), + self.ratio_1y_sma + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap(), + self.ratio_1y_sd + .as_ref() + .unwrap() + .dateindex + .as_ref() + .unwrap(), exit, ) }, @@ -1245,65 +1555,122 @@ impl ComputedRatioVecsFromDateIndex { } fn mut_ratio_vecs(&mut self) -> Vec<&mut EagerVec> { - vec![ - self.ratio_sd.dateindex.as_mut().unwrap(), - self.ratio_4y_sd.dateindex.as_mut().unwrap(), - self.ratio_1y_sd.dateindex.as_mut().unwrap(), - self.ratio_p99_9.dateindex.as_mut().unwrap(), - self.ratio_p99_5.dateindex.as_mut().unwrap(), - self.ratio_p99.dateindex.as_mut().unwrap(), - self.ratio_p1.dateindex.as_mut().unwrap(), - self.ratio_p0_5.dateindex.as_mut().unwrap(), - self.ratio_p0_1.dateindex.as_mut().unwrap(), - self.ratio_p1sd.dateindex.as_mut().unwrap(), - self.ratio_p2sd.dateindex.as_mut().unwrap(), - self.ratio_p3sd.dateindex.as_mut().unwrap(), - self.ratio_m1sd.dateindex.as_mut().unwrap(), - self.ratio_m2sd.dateindex.as_mut().unwrap(), - self.ratio_m3sd.dateindex.as_mut().unwrap(), + [ + self.ratio_sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_4y_sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_1y_sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p99_9 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p99_5 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p99 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p1 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p0_5 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p0_1 + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p1sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p2sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_p3sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_m1sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_m2sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), + self.ratio_m3sd + .as_mut() + .map_or(vec![], |v| vec![v.dateindex.as_mut().unwrap()]), ] + .into_iter() + .flatten() + .collect::>() } pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> { [ self.price.as_ref().map_or(vec![], |v| v.vecs()), self.ratio.vecs(), - self.ratio_sma.vecs(), - self.ratio_1w_sma.vecs(), - self.ratio_1m_sma.vecs(), - self.ratio_1y_sma.vecs(), - self.ratio_4y_sma.vecs(), - self.ratio_1y_sma_momentum_oscillator.vecs(), - self.ratio_sd.vecs(), - self.ratio_1y_sd.vecs(), - self.ratio_4y_sd.vecs(), - self.ratio_p99_9.vecs(), - self.ratio_p99_5.vecs(), - self.ratio_p99.vecs(), - self.ratio_p1.vecs(), - self.ratio_p0_5.vecs(), - self.ratio_p0_1.vecs(), - self.ratio_p1sd.vecs(), - self.ratio_p2sd.vecs(), - self.ratio_p3sd.vecs(), - self.ratio_m1sd.vecs(), - self.ratio_m2sd.vecs(), - self.ratio_m3sd.vecs(), - self.ratio_p99_9_as_price.vecs(), - self.ratio_p99_5_as_price.vecs(), - self.ratio_p99_as_price.vecs(), - self.ratio_p1_as_price.vecs(), - self.ratio_p0_5_as_price.vecs(), - self.ratio_p0_1_as_price.vecs(), - self.ratio_p1sd_as_price.vecs(), - self.ratio_p2sd_as_price.vecs(), - self.ratio_p3sd_as_price.vecs(), - self.ratio_m1sd_as_price.vecs(), - self.ratio_m2sd_as_price.vecs(), - self.ratio_m3sd_as_price.vecs(), - self.ratio_zscore.vecs(), - self.ratio_1y_zscore.vecs(), - self.ratio_4y_zscore.vecs(), + self.ratio_sma.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1w_sma.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1m_sma.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1y_sma.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_4y_sma.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1y_sma_momentum_oscillator + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1y_sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_4y_sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p99_9.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p99_5.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p99.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p1.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p0_5.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p0_1.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p1sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p2sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p3sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_m1sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_m2sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_m3sd.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p99_9_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p99_5_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p99_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p1_as_price.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_p0_5_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p0_1_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p1sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p2sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_p3sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_m1sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_m2sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_m3sd_as_price + .as_ref() + .map_or(vec![], |v| v.vecs()), + self.ratio_zscore.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_1y_zscore.as_ref().map_or(vec![], |v| v.vecs()), + self.ratio_4y_zscore.as_ref().map_or(vec![], |v| v.vecs()), ] .into_iter() .flatten() diff --git a/crates/brk_computer/src/vecs/market.rs b/crates/brk_computer/src/vecs/market.rs index 2a6c2d519..db1fcf27e 100644 --- a/crates/brk_computer/src/vecs/market.rs +++ b/crates/brk_computer/src/vecs/market.rs @@ -257,6 +257,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_8d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -266,6 +267,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_13d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -275,6 +277,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_21d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -284,6 +287,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_1m_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -293,6 +297,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_34d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -302,6 +307,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_55d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -311,6 +317,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_89d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -320,6 +327,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_144d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -329,6 +337,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_200d_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -338,6 +347,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_1y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -347,6 +357,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_2y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -356,6 +367,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_200w_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -365,6 +377,7 @@ impl Vecs { format, computation, indexes, + true, )?, indexes_to_4y_sma: ComputedRatioVecsFromDateIndex::forced_import( path, @@ -374,6 +387,7 @@ impl Vecs { format, computation, indexes, + true, )?, _1d_returns: ComputedVecsFromDateIndex::forced_import( diff --git a/crates/brk_computer/src/vecs/stateful/address_cohort.rs b/crates/brk_computer/src/vecs/stateful/address_cohort.rs index 29a8309a2..68df3badd 100644 --- a/crates/brk_computer/src/vecs/stateful/address_cohort.rs +++ b/crates/brk_computer/src/vecs/stateful/address_cohort.rs @@ -83,6 +83,7 @@ impl Vecs { indexes, fetched, compute_relative_to_all, + false, )?, }) } diff --git a/crates/brk_computer/src/vecs/stateful/common.rs b/crates/brk_computer/src/vecs/stateful/common.rs index 7c4fda9cb..98b7d15a9 100644 --- a/crates/brk_computer/src/vecs/stateful/common.rs +++ b/crates/brk_computer/src/vecs/stateful/common.rs @@ -139,6 +139,7 @@ impl Vecs { indexes: &indexes::Vecs, fetched: Option<&fetched::Vecs>, compute_relative_to_all: bool, + ratio_extended: bool, ) -> color_eyre::Result { let compute_dollars = fetched.is_some(); @@ -444,6 +445,7 @@ impl Vecs { format, computation, indexes, + ratio_extended, ) .unwrap() }), diff --git a/crates/brk_computer/src/vecs/stateful/mod.rs b/crates/brk_computer/src/vecs/stateful/mod.rs index 1f30cc44c..6a0f32f75 100644 --- a/crates/brk_computer/src/vecs/stateful/mod.rs +++ b/crates/brk_computer/src/vecs/stateful/mod.rs @@ -1422,12 +1422,12 @@ impl AddressTypeToVec<(TypeIndex, Sats)> { || vecs.amount_range.get_mut(amount).0.clone() != vecs.amount_range.get_mut(prev_amount).0.clone() { - // dbg!((prev_amount, amount, is_new)); - if !is_new && !from_any_empty { - let state = &mut vecs.amount_range.get_mut(prev_amount).1.state; - // dbg!((prev_amount, &state.address_count, &addressdata)); - state.subtract(addressdata); + vecs.amount_range + .get_mut(prev_amount) + .1 + .state + .subtract(addressdata); } addressdata.receive(value, price); @@ -1509,8 +1509,6 @@ impl HeightToAddressTypeToVec<(TypeIndex, Sats)> { let will_be_empty = addressdata.outputs_len - 1 == 0; - // dbg!((prev_amount, amount, will_be_empty)); - if will_be_empty || vecs.amount_range.get_mut(amount).0.clone() != vecs.amount_range.get_mut(prev_amount).0.clone() diff --git a/crates/brk_computer/src/vecs/stateful/utxo_cohort.rs b/crates/brk_computer/src/vecs/stateful/utxo_cohort.rs index 6ca76545e..4058b5906 100644 --- a/crates/brk_computer/src/vecs/stateful/utxo_cohort.rs +++ b/crates/brk_computer/src/vecs/stateful/utxo_cohort.rs @@ -37,6 +37,7 @@ impl Vecs { fetched: Option<&fetched::Vecs>, states_path: &Path, compute_relative_to_all: bool, + ratio_extended: bool, ) -> color_eyre::Result { let compute_dollars = fetched.is_some(); @@ -58,6 +59,7 @@ impl Vecs { indexes, fetched, compute_relative_to_all, + ratio_extended, )?, }) } diff --git a/crates/brk_computer/src/vecs/stateful/utxo_cohorts.rs b/crates/brk_computer/src/vecs/stateful/utxo_cohorts.rs index 03555b234..e2e816fa5 100644 --- a/crates/brk_computer/src/vecs/stateful/utxo_cohorts.rs +++ b/crates/brk_computer/src/vecs/stateful/utxo_cohorts.rs @@ -44,6 +44,7 @@ impl Vecs { fetched, states_path, false, + true, )?, term: ByTerm { short: utxo_cohort::Vecs::forced_import( @@ -56,6 +57,7 @@ impl Vecs { fetched, states_path, true, + true, )?, long: utxo_cohort::Vecs::forced_import( path, @@ -67,6 +69,7 @@ impl Vecs { fetched, states_path, true, + true, )?, }, epoch: ByEpoch { @@ -80,6 +83,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1: utxo_cohort::Vecs::forced_import( path, @@ -91,6 +95,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2: utxo_cohort::Vecs::forced_import( path, @@ -102,6 +107,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3: utxo_cohort::Vecs::forced_import( path, @@ -113,6 +119,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4: utxo_cohort::Vecs::forced_import( path, @@ -124,6 +131,7 @@ impl Vecs { fetched, states_path, true, + true, )?, }, _type: BySpendableType { @@ -137,6 +145,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2pk33: utxo_cohort::Vecs::forced_import( path, @@ -148,6 +157,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2pkh: utxo_cohort::Vecs::forced_import( path, @@ -159,6 +169,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2sh: utxo_cohort::Vecs::forced_import( path, @@ -170,6 +181,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2wpkh: utxo_cohort::Vecs::forced_import( path, @@ -181,6 +193,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2wsh: utxo_cohort::Vecs::forced_import( path, @@ -192,6 +205,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2tr: utxo_cohort::Vecs::forced_import( path, @@ -203,6 +217,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2a: utxo_cohort::Vecs::forced_import( path, @@ -214,6 +229,7 @@ impl Vecs { fetched, states_path, true, + false, )?, p2ms: utxo_cohort::Vecs::forced_import( path, @@ -225,6 +241,7 @@ impl Vecs { fetched, states_path, true, + false, )?, empty: utxo_cohort::Vecs::forced_import( path, @@ -236,6 +253,7 @@ impl Vecs { fetched, states_path, true, + false, )?, unknown: utxo_cohort::Vecs::forced_import( path, @@ -247,6 +265,7 @@ impl Vecs { fetched, states_path, true, + false, )?, }, max_age: ByMaxAge { @@ -260,6 +279,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1m: utxo_cohort::Vecs::forced_import( path, @@ -271,6 +291,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2m: utxo_cohort::Vecs::forced_import( path, @@ -282,6 +303,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3m: utxo_cohort::Vecs::forced_import( path, @@ -293,6 +315,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4m: utxo_cohort::Vecs::forced_import( path, @@ -304,6 +327,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5m: utxo_cohort::Vecs::forced_import( path, @@ -315,6 +339,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6m: utxo_cohort::Vecs::forced_import( path, @@ -326,6 +351,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1y: utxo_cohort::Vecs::forced_import( path, @@ -337,6 +363,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2y: utxo_cohort::Vecs::forced_import( path, @@ -348,6 +375,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3y: utxo_cohort::Vecs::forced_import( path, @@ -359,6 +387,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4y: utxo_cohort::Vecs::forced_import( path, @@ -370,6 +399,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5y: utxo_cohort::Vecs::forced_import( path, @@ -381,6 +411,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6y: utxo_cohort::Vecs::forced_import( path, @@ -392,6 +423,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _7y: utxo_cohort::Vecs::forced_import( path, @@ -403,6 +435,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _8y: utxo_cohort::Vecs::forced_import( path, @@ -414,6 +447,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _10y: utxo_cohort::Vecs::forced_import( path, @@ -425,6 +459,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _12y: utxo_cohort::Vecs::forced_import( path, @@ -436,6 +471,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _15y: utxo_cohort::Vecs::forced_import( path, @@ -447,6 +483,7 @@ impl Vecs { fetched, states_path, true, + true, )?, }, min_age: ByMinAge { @@ -460,6 +497,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1w: utxo_cohort::Vecs::forced_import( path, @@ -471,6 +509,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1m: utxo_cohort::Vecs::forced_import( path, @@ -482,6 +521,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2m: utxo_cohort::Vecs::forced_import( path, @@ -493,6 +533,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3m: utxo_cohort::Vecs::forced_import( path, @@ -504,6 +545,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4m: utxo_cohort::Vecs::forced_import( path, @@ -515,6 +557,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5m: utxo_cohort::Vecs::forced_import( path, @@ -526,6 +569,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6m: utxo_cohort::Vecs::forced_import( path, @@ -537,6 +581,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1y: utxo_cohort::Vecs::forced_import( path, @@ -548,6 +593,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2y: utxo_cohort::Vecs::forced_import( path, @@ -559,6 +605,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3y: utxo_cohort::Vecs::forced_import( path, @@ -570,6 +617,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4y: utxo_cohort::Vecs::forced_import( path, @@ -581,6 +629,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5y: utxo_cohort::Vecs::forced_import( path, @@ -592,6 +641,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6y: utxo_cohort::Vecs::forced_import( path, @@ -603,6 +653,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _7y: utxo_cohort::Vecs::forced_import( path, @@ -614,6 +665,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _8y: utxo_cohort::Vecs::forced_import( path, @@ -625,6 +677,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _10y: utxo_cohort::Vecs::forced_import( path, @@ -636,6 +689,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _12y: utxo_cohort::Vecs::forced_import( path, @@ -647,6 +701,7 @@ impl Vecs { fetched, states_path, true, + true, )?, }, age_range: ByAgeRange { @@ -660,6 +715,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1d_to_1w: utxo_cohort::Vecs::forced_import( path, @@ -671,6 +727,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1w_to_1m: utxo_cohort::Vecs::forced_import( path, @@ -682,6 +739,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1m_to_2m: utxo_cohort::Vecs::forced_import( path, @@ -693,6 +751,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2m_to_3m: utxo_cohort::Vecs::forced_import( path, @@ -704,6 +763,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3m_to_4m: utxo_cohort::Vecs::forced_import( path, @@ -715,6 +775,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4m_to_5m: utxo_cohort::Vecs::forced_import( path, @@ -726,6 +787,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5m_to_6m: utxo_cohort::Vecs::forced_import( path, @@ -737,6 +799,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6m_to_1y: utxo_cohort::Vecs::forced_import( path, @@ -748,6 +811,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _1y_to_2y: utxo_cohort::Vecs::forced_import( path, @@ -759,6 +823,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _2y_to_3y: utxo_cohort::Vecs::forced_import( path, @@ -770,6 +835,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _3y_to_4y: utxo_cohort::Vecs::forced_import( path, @@ -781,6 +847,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _4y_to_5y: utxo_cohort::Vecs::forced_import( path, @@ -792,6 +859,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _5y_to_6y: utxo_cohort::Vecs::forced_import( path, @@ -803,6 +871,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _6y_to_7y: utxo_cohort::Vecs::forced_import( path, @@ -814,6 +883,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _7y_to_8y: utxo_cohort::Vecs::forced_import( path, @@ -825,6 +895,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _8y_to_10y: utxo_cohort::Vecs::forced_import( path, @@ -836,6 +907,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _10y_to_12y: utxo_cohort::Vecs::forced_import( path, @@ -847,6 +919,7 @@ impl Vecs { fetched, states_path, true, + true, )?, _12y_to_15y: utxo_cohort::Vecs::forced_import( path, @@ -858,6 +931,7 @@ impl Vecs { fetched, states_path, true, + true, )?, from_15y: utxo_cohort::Vecs::forced_import( path, @@ -869,6 +943,7 @@ impl Vecs { fetched, states_path, true, + true, )?, }, amount_range: ByAmountRange { @@ -882,6 +957,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1sat_to_10sats: utxo_cohort::Vecs::forced_import( path, @@ -893,6 +969,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10sats_to_100sats: utxo_cohort::Vecs::forced_import( path, @@ -904,6 +981,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100sats_to_1k_sats: utxo_cohort::Vecs::forced_import( path, @@ -915,6 +993,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_sats_to_10k_sats: utxo_cohort::Vecs::forced_import( path, @@ -926,6 +1005,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_sats_to_100k_sats: utxo_cohort::Vecs::forced_import( path, @@ -937,6 +1017,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100k_sats_to_1m_sats: utxo_cohort::Vecs::forced_import( path, @@ -948,6 +1029,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1m_sats_to_10m_sats: utxo_cohort::Vecs::forced_import( path, @@ -959,6 +1041,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10m_sats_to_1btc: utxo_cohort::Vecs::forced_import( path, @@ -970,6 +1053,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1btc_to_10btc: utxo_cohort::Vecs::forced_import( path, @@ -981,6 +1065,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10btc_to_100btc: utxo_cohort::Vecs::forced_import( path, @@ -992,6 +1077,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100btc_to_1k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1003,6 +1089,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_btc_to_10k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1014,6 +1101,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_btc_to_100k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1025,6 +1113,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100k_btc_or_more: utxo_cohort::Vecs::forced_import( path, @@ -1036,6 +1125,7 @@ impl Vecs { fetched, states_path, true, + false, )?, }, lt_amount: ByLowerThanAmount { @@ -1049,6 +1139,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100sats: utxo_cohort::Vecs::forced_import( path, @@ -1060,6 +1151,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1071,6 +1163,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1082,6 +1175,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1093,6 +1187,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1m_sats: utxo_cohort::Vecs::forced_import( path, @@ -1104,6 +1199,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10m_sats: utxo_cohort::Vecs::forced_import( path, @@ -1115,6 +1211,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1btc: utxo_cohort::Vecs::forced_import( path, @@ -1126,6 +1223,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10btc: utxo_cohort::Vecs::forced_import( path, @@ -1137,6 +1235,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100btc: utxo_cohort::Vecs::forced_import( path, @@ -1148,6 +1247,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1159,6 +1259,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1170,6 +1271,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1181,6 +1283,7 @@ impl Vecs { fetched, states_path, true, + false, )?, }, ge_amount: ByGreatEqualAmount { @@ -1194,6 +1297,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10sats: utxo_cohort::Vecs::forced_import( path, @@ -1205,6 +1309,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100sats: utxo_cohort::Vecs::forced_import( path, @@ -1216,6 +1321,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1227,6 +1333,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1238,6 +1345,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100k_sats: utxo_cohort::Vecs::forced_import( path, @@ -1249,6 +1357,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1m_sats: utxo_cohort::Vecs::forced_import( path, @@ -1260,6 +1369,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10m_sats: utxo_cohort::Vecs::forced_import( path, @@ -1271,6 +1381,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1btc: utxo_cohort::Vecs::forced_import( path, @@ -1282,6 +1393,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10btc: utxo_cohort::Vecs::forced_import( path, @@ -1293,6 +1405,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _100btc: utxo_cohort::Vecs::forced_import( path, @@ -1304,6 +1417,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _1k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1315,6 +1429,7 @@ impl Vecs { fetched, states_path, true, + false, )?, _10k_btc: utxo_cohort::Vecs::forced_import( path, @@ -1326,6 +1441,7 @@ impl Vecs { fetched, states_path, true, + false, )?, }, }