pub trait HistoryProvider {
type Error: Display + Debug + 'static;
// Required method
fn history_bars_before<'life0, 'async_trait>(
&'life0 self,
symbol: String,
timeframe: TimeFrame,
before_time: i64,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candlestick>, DataProviderError<Self::Error>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Supplies older historical bars for incremental history extension.
Implement alongside DataProvider to enable efficient extend_history:
only the bars older than the current cache are fetched, then merged with
cached bars before scripts are re-executed.
Required Associated Types§
Sourcetype Error: Display + Debug + 'static
type Error: Display + Debug + 'static
The error payload type; should match DataProvider::Error on the
same implementing type.
Required Methods§
Sourcefn history_bars_before<'life0, 'async_trait>(
&'life0 self,
symbol: String,
timeframe: TimeFrame,
before_time: i64,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candlestick>, DataProviderError<Self::Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn history_bars_before<'life0, 'async_trait>(
&'life0 self,
symbol: String,
timeframe: TimeFrame,
before_time: i64,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candlestick>, DataProviderError<Self::Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch up to count bars for symbol/timeframe where
bar.time < before_time, returned in strict ascending time order
(oldest first).
Returning an empty Vec signals that no older data is available
(history exhausted).