修正下一交易日信号时点字段可见性
This commit is contained in:
@@ -3041,7 +3041,9 @@ impl PlatformExprStrategy {
|
|||||||
|
|
||||||
let market = ctx.data.require_market(date, symbol)?;
|
let market = ctx.data.require_market(date, symbol)?;
|
||||||
let feature_market = ctx.data.market(factor_date, symbol).unwrap_or(market);
|
let feature_market = ctx.data.market(factor_date, symbol).unwrap_or(market);
|
||||||
let intraday_same_day_factor = self.config.aiquant_transaction_cost && factor_date == date;
|
let intraday_same_day_factor = self.config.aiquant_transaction_cost
|
||||||
|
&& factor_date == date
|
||||||
|
&& !ctx.is_lagged_execution();
|
||||||
let decision_quote = if use_intraday_quote {
|
let decision_quote = if use_intraday_quote {
|
||||||
self.aiquant_scheduled_quote_at_time(ctx, date, symbol, execution_time)
|
self.aiquant_scheduled_quote_at_time(ctx, date, symbol, execution_time)
|
||||||
} else {
|
} else {
|
||||||
@@ -18234,7 +18236,7 @@ mod tests {
|
|||||||
pe_ttm: 8.0,
|
pe_ttm: 8.0,
|
||||||
turnover_ratio: Some(1.0),
|
turnover_ratio: Some(1.0),
|
||||||
effective_turnover_ratio: Some(1.0),
|
effective_turnover_ratio: Some(1.0),
|
||||||
extra_factors: BTreeMap::new(),
|
extra_factors: BTreeMap::from([("amount".to_string(), 30_000_000.0)]),
|
||||||
},
|
},
|
||||||
DailyFactorSnapshot {
|
DailyFactorSnapshot {
|
||||||
date: decision_date,
|
date: decision_date,
|
||||||
@@ -18368,6 +18370,11 @@ mod tests {
|
|||||||
cfg.exposure_expr = "1.0".to_string();
|
cfg.exposure_expr = "1.0".to_string();
|
||||||
let mut strategy = PlatformExprStrategy::new(cfg);
|
let mut strategy = PlatformExprStrategy::new(cfg);
|
||||||
|
|
||||||
|
let decision_day_state = strategy
|
||||||
|
.stock_state_with_factor_date(&ctx, decision_date, decision_date, limit_symbol)
|
||||||
|
.expect("next-open decision state");
|
||||||
|
assert_eq!(decision_day_state.amount, 30_000_000.0);
|
||||||
|
|
||||||
let decision = strategy.on_day(&ctx).expect("platform decision");
|
let decision = strategy.on_day(&ctx).expect("platform decision");
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
|
|||||||
Reference in New Issue
Block a user