Add bar and tick strategy lifecycle
This commit is contained in:
@@ -810,6 +810,21 @@ impl DataSet {
|
||||
.unwrap_or(&[])
|
||||
}
|
||||
|
||||
pub fn execution_quotes_on_date(&self, date: NaiveDate) -> Vec<IntradayExecutionQuote> {
|
||||
let mut quotes = self
|
||||
.execution_quotes_index
|
||||
.iter()
|
||||
.filter(|((quote_date, _), _)| *quote_date == date)
|
||||
.flat_map(|(_, rows)| rows.iter().cloned())
|
||||
.collect::<Vec<_>>();
|
||||
quotes.sort_by(|left, right| {
|
||||
left.timestamp
|
||||
.cmp(&right.timestamp)
|
||||
.then_with(|| left.symbol.cmp(&right.symbol))
|
||||
});
|
||||
quotes
|
||||
}
|
||||
|
||||
pub fn benchmark_series(&self) -> Vec<BenchmarkSnapshot> {
|
||||
self.benchmark_by_date.values().cloned().collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user