pub struct BarExecutionPrices {
pub symbol: String,
pub ts: NaiveDateTime,
pub open: f64,
pub high: f64,
pub low: f64,
pub close: f64,
pub half_spread: f64,
pub timeframe_seconds: Option<u64>,
}Expand description
Prices a FutureQuote replay executes a bar against, read as midpoints with a symmetric half spread.
A bar is replayed in three steps stamped at its bucket open: a quote at open, a walk through the bar’s range, and a quote at close used only for marking. The walk visits the adverse extreme first for each side, so long exposure sees low before high and short exposure sees high before low, which is the pessimistic order when the bar alone cannot say which came first.
Fields§
§symbol: String§ts: NaiveDateTime§open: f64§high: f64§low: f64§close: f64§half_spread: f64§timeframe_seconds: Option<u64>Implementations§
Source§impl BarExecutionPrices
impl BarExecutionPrices
Sourcepub fn executable(self) -> Option<Self>
pub fn executable(self) -> Option<Self>
The bar ready for execution, or None when a price is not finite or a quote at its lowest price would not be positive.
A range that does not contain the open and close is widened to contain them, because the bar did trade at both.
Sourcepub fn quote_at_mid(&self, mid: f64) -> PriceQuote
pub fn quote_at_mid(&self, mid: f64) -> PriceQuote
Quote whose midpoint is mid, with the bar’s spread.
Sourcepub fn open_quote(&self) -> PriceQuote
pub fn open_quote(&self) -> PriceQuote
Quote at the bar’s open, where fills waiting for the bar execute.
Sourcepub fn close_quote(&self) -> PriceQuote
pub fn close_quote(&self) -> PriceQuote
Quote at the bar’s close, which marks positions after the bar settled.