Use snapshot last price for jq intraday execution
This commit is contained in:
@@ -121,10 +121,8 @@ where
|
||||
if self.execution_price_field == PriceField::Last
|
||||
&& self.intraday_execution_start_time.is_some()
|
||||
{
|
||||
return match side {
|
||||
OrderSide::Buy => self.buy_price(snapshot),
|
||||
OrderSide::Sell => self.sell_price(snapshot),
|
||||
};
|
||||
let _ = side;
|
||||
return snapshot.price(PriceField::Last);
|
||||
}
|
||||
|
||||
match side {
|
||||
@@ -1079,23 +1077,6 @@ where
|
||||
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(
|
||||
quotes,
|
||||
side,
|
||||
start_cursor,
|
||||
requested_qty,
|
||||
round_lot,
|
||||
cash_limit,
|
||||
gross_limit,
|
||||
) {
|
||||
return Some(fill);
|
||||
}
|
||||
|
||||
if self.intraday_execution_start_time.is_some() {
|
||||
let execution_price = self.snapshot_execution_price(snapshot, side);
|
||||
let quantity = match side {
|
||||
@@ -1122,6 +1103,23 @@ 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(
|
||||
quotes,
|
||||
side,
|
||||
start_cursor,
|
||||
requested_qty,
|
||||
round_lot,
|
||||
cash_limit,
|
||||
gross_limit,
|
||||
) {
|
||||
return Some(fill);
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user