pub trait DataProvider {
// Required method
fn request(
&self,
symbol: &str,
timeframe: Timeframe,
) -> Result<Data, Box<dyn Error + Send + Sync>>;
// Provided methods
fn footprint(
&self,
_ticks_per_row: f64,
_va_percent: f64,
_imbalance_percent: f64,
) -> Option<Vec<FootprintRow>> { ... }
fn financial(&self, _symbol: &str, _id: &str, _period: &str) -> Option<f64> { ... }
fn dividends(&self, _ticker: &str, _field: &str) -> Option<f64> { ... }
fn earnings(&self, _ticker: &str, _field: &str) -> Option<f64> { ... }
fn splits(&self, _ticker: &str, _field: &str) -> Option<f64> { ... }
fn economic(&self, _country: &str, _field: &str) -> Option<f64> { ... }
fn currency_rate(&self, _from: &str, _to: &str) -> Option<f64> { ... }
}Required Methods§
fn request( &self, symbol: &str, timeframe: Timeframe, ) -> Result<Data, Box<dyn Error + Send + Sync>>
Provided Methods§
Sourcefn footprint(
&self,
_ticks_per_row: f64,
_va_percent: f64,
_imbalance_percent: f64,
) -> Option<Vec<FootprintRow>>
fn footprint( &self, _ticks_per_row: f64, _va_percent: f64, _imbalance_percent: f64, ) -> Option<Vec<FootprintRow>>
The volume footprint rows for the current bar (request.footprint),
lowest price first. None — the default — means the host has no order-flow
feed, so the script reads na.
Sourcefn financial(&self, _symbol: &str, _id: &str, _period: &str) -> Option<f64>
fn financial(&self, _symbol: &str, _id: &str, _period: &str) -> Option<f64>
A fundamental financial metric (request.financial), e.g. id = "TOTAL_REVENUE", period = "FY"/"FQ". None — the default — means the
host has no such feed, so the script reads na.
Sourcefn dividends(&self, _ticker: &str, _field: &str) -> Option<f64>
fn dividends(&self, _ticker: &str, _field: &str) -> Option<f64>
A dividend field (request.dividends), e.g. "gross"/"net".
Sourcefn earnings(&self, _ticker: &str, _field: &str) -> Option<f64>
fn earnings(&self, _ticker: &str, _field: &str) -> Option<f64>
An earnings field (request.earnings), e.g. "actual"/"estimate".
Sourcefn splits(&self, _ticker: &str, _field: &str) -> Option<f64>
fn splits(&self, _ticker: &str, _field: &str) -> Option<f64>
A splits field (request.splits), e.g. "numerator"/"denominator".
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".