支持显式止盈止损参考价口径

This commit is contained in:
boris
2026-07-17 12:07:07 +08:00
parent 8f098e4da1
commit 60457389a3
4 changed files with 249 additions and 46 deletions
+17
View File
@@ -554,6 +554,18 @@ impl AdjustedCloseSeries {
12,
))
}
fn latest_back_adjusted_close(&self, date: NaiveDate) -> Option<f64> {
let index = match self.dates.binary_search(&date) {
Ok(index) => index,
Err(0) => return None,
Err(index) => index - 1,
};
self.back_adjusted_closes
.get(index)
.copied()
.filter(|value| value.is_finite() && *value > 0.0)
}
}
impl SymbolPriceSeries {
@@ -2429,6 +2441,11 @@ impl DataSet {
}
}
pub fn market_latest_back_adjusted_close(&self, date: NaiveDate, symbol: &str) -> Option<f64> {
self.adjusted_close_series(symbol)
.and_then(|series| series.latest_back_adjusted_close(date))
}
pub fn market_decision_numeric_values(
&self,
date: NaiveDate,