#[non_exhaustive]pub struct TimeBarReplayRequest {
pub symbol: String,
pub exchange: String,
pub bar_type: Option<TimeBarType>,
pub bar_type_period: i32,
pub start_time_sec: i32,
pub end_time_sec: i32,
pub user_max_count: Option<i32>,
pub resume_bars: Option<bool>,
}Expand description
A time bar replay request, passed to load_time_bars and its siblings.
A time bar covers a fixed span: bar_type picks the unit
and bar_type_period how many of them per bar.
§Example
use rithmic_rs::{TimeBarReplayRequest, rti::request_time_bar_replay::BarType};
let request = TimeBarReplayRequest::new()
.symbol("ESU6")
.exchange("CME")
.bar_type(BarType::MinuteBar)
.bar_type_period(5)
.start_time_sec(1_750_000_000)
.end_time_sec(1_750_003_600)
.build()?;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbol: StringThe trading symbol, e.g. "ESU6".
exchange: StringThe exchange code, e.g. "CME".
bar_type: Option<TimeBarType>Second, minute, day or week. Required.
bar_type_period: i32How many of those units each bar covers.
start_time_sec: i32Start of the window as a Unix timestamp in seconds.
end_time_sec: i32End of the window as a Unix timestamp in seconds.
user_max_count: Option<i32>Cap on records returned. Leaving this unset lets the server apply its own cap of 10,000, silently.
resume_bars: Option<bool>Some(true) lifts the server’s 10,000 record cap, so the whole window
replays on this one request.
Implementations§
Source§impl TimeBarReplayRequest
impl TimeBarReplayRequest
Sourcepub fn bar_type(self, bar_type: TimeBarType) -> Self
pub fn bar_type(self, bar_type: TimeBarType) -> Self
Second, minute, day or week.
Sourcepub fn bar_type_period(self, bar_type_period: i32) -> Self
pub fn bar_type_period(self, bar_type_period: i32) -> Self
How many of those units each bar covers.
Sourcepub fn start_time_sec(self, start_time_sec: i32) -> Self
pub fn start_time_sec(self, start_time_sec: i32) -> Self
Start of the window as a Unix timestamp in seconds.
Sourcepub fn end_time_sec(self, end_time_sec: i32) -> Self
pub fn end_time_sec(self, end_time_sec: i32) -> Self
End of the window as a Unix timestamp in seconds.
Sourcepub fn user_max_count(self, user_max_count: i32) -> Self
pub fn user_max_count(self, user_max_count: i32) -> Self
Cap the records returned.
Sourcepub fn resume_bars(self, resume_bars: bool) -> Self
pub fn resume_bars(self, resume_bars: bool) -> Self
Lift the server’s 10,000 record cap so the whole window replays at once.
Sourcepub fn validate(&self) -> Result<(), RithmicError>
pub fn validate(&self) -> Result<(), RithmicError>
Requires a symbol, an exchange, a bar type, a bar period, and an ordered time window.
Sourcepub fn build(self) -> Result<Self, RithmicError>
pub fn build(self) -> Result<Self, RithmicError>
Requires a symbol, an exchange, a bar type, a bar period, and an ordered time window.
Trait Implementations§
Source§impl Clone for TimeBarReplayRequest
impl Clone for TimeBarReplayRequest
Source§fn clone(&self) -> TimeBarReplayRequest
fn clone(&self) -> TimeBarReplayRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more