短路预计算rolling因子读取
This commit is contained in:
@@ -2149,12 +2149,15 @@ impl PlatformExprStrategy {
|
||||
lookback: usize,
|
||||
) -> Option<f64> {
|
||||
let precomputed = precomputed_stock_rolling_mean(extra_factors, field, lookback);
|
||||
let computed = ctx
|
||||
.data
|
||||
.market_decision_numeric_moving_average(date, symbol, field, lookback);
|
||||
if self.config.prefer_precomputed_rolling_factors {
|
||||
precomputed.or(computed)
|
||||
precomputed.or_else(|| {
|
||||
ctx.data
|
||||
.market_decision_numeric_moving_average(date, symbol, field, lookback)
|
||||
})
|
||||
} else {
|
||||
let computed = ctx
|
||||
.data
|
||||
.market_decision_numeric_moving_average(date, symbol, field, lookback);
|
||||
computed.or(precomputed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user