Use intraday quotes before snapshot fallback

This commit is contained in:
boris
2026-04-23 01:26:58 -07:00
parent a076e8d0ff
commit 452eb3324d
2 changed files with 23 additions and 22 deletions

View File

@@ -1829,6 +1829,27 @@ where
return None; return None;
} }
let start_cursor = self
.intraday_execution_start_time
.map(|start_time| date.and_time(start_time));
let quotes = data.execution_quotes_on(date, symbol);
if let Some(fill) = self.select_execution_fill(
snapshot,
quotes,
side,
start_cursor,
requested_qty,
round_lot,
minimum_order_quantity,
order_step_size,
allow_odd_lot_sell,
cash_limit,
gross_limit,
) {
return Some(fill);
}
if self.intraday_execution_start_time.is_some() { if self.intraday_execution_start_time.is_some() {
let execution_price = self.snapshot_execution_price(snapshot, side); let execution_price = self.snapshot_execution_price(snapshot, side);
let quantity = match side { let quantity = match side {
@@ -1867,27 +1888,6 @@ where
}); });
} }
let start_cursor = self
.intraday_execution_start_time
.map(|start_time| date.and_time(start_time));
let quotes = data.execution_quotes_on(date, symbol);
if let Some(fill) = self.select_execution_fill(
snapshot,
quotes,
side,
start_cursor,
requested_qty,
round_lot,
minimum_order_quantity,
order_step_size,
allow_odd_lot_sell,
cash_limit,
gross_limit,
) {
return Some(fill);
}
None None
} }

View File

@@ -703,7 +703,8 @@ fn broker_cancels_market_order_remainder_when_intraday_quote_liquidity_exhausted
ChinaAShareCostModel::default(), ChinaAShareCostModel::default(),
ChinaEquityRuleHooks::default(), ChinaEquityRuleHooks::default(),
PriceField::Last, PriceField::Last,
); )
.with_intraday_execution_start_time(chrono::NaiveTime::from_hms_opt(10, 18, 0).unwrap());
let report = broker let report = broker
.execute( .execute(