修正next-open信号日选股风控语义
This commit is contained in:
@@ -526,14 +526,17 @@ impl StrategyContext<'_> {
|
||||
&self,
|
||||
date: NaiveDate,
|
||||
) -> Vec<crate::data::EligibleUniverseSnapshot> {
|
||||
let eligible = self.data.eligible_universe_on(date);
|
||||
let eligible = if self.is_lagged_execution() && date == self.decision_date {
|
||||
self.data.fundamental_universe_on(date)
|
||||
} else {
|
||||
self.data.eligible_universe_on(date).to_vec()
|
||||
};
|
||||
match self.dynamic_universe {
|
||||
Some(symbols) if !symbols.is_empty() => eligible
|
||||
.iter()
|
||||
.into_iter()
|
||||
.filter(|row| symbols.contains(&row.symbol))
|
||||
.cloned()
|
||||
.collect(),
|
||||
_ => eligible.to_vec(),
|
||||
_ => eligible,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,9 +545,12 @@ impl StrategyContext<'_> {
|
||||
date: NaiveDate,
|
||||
risk_config: &crate::risk_control::FidcRiskControlConfig,
|
||||
) -> Vec<crate::data::EligibleUniverseSnapshot> {
|
||||
let eligible = self
|
||||
.data
|
||||
.eligible_universe_on_with_risk_config(date, risk_config);
|
||||
let eligible = if self.is_lagged_execution() && date == self.decision_date {
|
||||
self.data.fundamental_universe_on(date)
|
||||
} else {
|
||||
self.data
|
||||
.eligible_universe_on_with_risk_config(date, risk_config)
|
||||
};
|
||||
match self.dynamic_universe {
|
||||
Some(symbols) if !symbols.is_empty() => eligible
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user