GetRangeParams
The parameter struct and builder for HistoricalClient::timeseries::get_range.
The builder can be instantiated with the associated function builder(), and the struct is created from the builder with the build() method.
For every field, there is an identically named setter method on the builder.
This struct can also be created from a GetRangeToFileParams struct via the From trait.
Fields
| Parameter | Type | Description |
|---|---|---|
dataset | String | The dataset code (string identifier). Must be one of the values from list_datasets. |
symbols | Symbols | The product symbols to filter for. Takes up to 2,000 symbols per request. If Symbols::All then will select all symbols. |
schema | Schema | The data record schema. Must be one of the values from list_schemas. |
date_time_range | DateTimeRange | The request range with an inclusive start and an exclusive end. Filters on ts_recv if it exists in the schema, otherwise ts_event. |
stype_in | SType | |
stype_out | SType | The symbology type of output symbols. Defaults to InstrumentId. Must be a valid symbology combination with stype_in. See symbology combinations. |
limit | Option<NonZeroU64> | The maximum number of records to return. If None then no limit. Defaults to None. |
API method
pub struct GetRangeParams {
pub dataset: String,
pub symbols: Symbols,
pub schema: Schema,
pub date_time_range: DateTimeRange,
pub stype_in: SType,
pub stype_out: SType,
pub limit: Option<NonZeroU64>,
} Example usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
use databento::{
dbn::{Dataset, SType, Schema, VersionUpgradePolicy},
historical::timeseries::GetRangeParams,
};
use time::macros::datetime;
assert_eq!(
GetRangeParams {
dataset: "XNAS.ITCH".to_owned(),
date_time_range: (datetime!(2023-11-03 14:00 -4)
..datetime!(2023-11-03 16:00 -4))
.into(),
symbols: "NVDA".into(),
schema: Schema::Trades,
stype_in: SType::RawSymbol,
stype_out: SType::InstrumentId,
limit: None,
#[expect(deprecated)]
upgrade_policy: None,
},
GetRangeParams::builder()
.dataset(Dataset::XnasItch)
.symbols("NVDA")
.date_time_range(
datetime!(2023-11-03 14:00 -4)
..datetime!(2023-11-03 16:00 -4)
)
.schema(Schema::Trades)
.build()
);