pub struct CandlesRequest {
pub ticker: String,
pub class_code: String,
pub start_date: DateTime<Utc>,
pub end_date: DateTime<Utc>,
pub time_frame: String,
}Expand description
Parameters of BcsHttpClient::get_candles.
Sent as a query string. The broker allows at most 1440 bars per request.
§Examples
use brokapi_bcs_protocol::http::models::CandlesRequest;
use chrono::{TimeZone, Utc};
let req = CandlesRequest {
ticker: "SBER".into(),
class_code: "TQBR".into(),
start_date: Utc.with_ymd_and_hms(2026, 10, 19, 7, 0, 0).unwrap(),
end_date: Utc.with_ymd_and_hms(2026, 10, 19, 8, 0, 0).unwrap(),
time_frame: "M5".into(),
};
assert_eq!(
serde_urlencoded::to_string(&req)?,
"ticker=SBER&classCode=TQBR&startDate=2026-10-19T07%3A00%3A00.000Z&endDate=2026-10-19T08%3A00%3A00.000Z&timeFrame=M5"
);Fields§
§ticker: StringTicker.
class_code: StringClass code (board).
start_date: DateTime<Utc>Start of the period (UTC).
end_date: DateTime<Utc>End of the period (UTC).
time_frame: StringTime frame of a bar: M1, M5, M15, M30, H1, H4, D, W or MN. A string, so what you send is what the broker gets.
Trait Implementations§
Source§impl Clone for CandlesRequest
impl Clone for CandlesRequest
Source§fn clone(&self) -> CandlesRequest
fn clone(&self) -> CandlesRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CandlesRequest
impl Debug for CandlesRequest
Auto Trait Implementations§
impl Freeze for CandlesRequest
impl RefUnwindSafe for CandlesRequest
impl Send for CandlesRequest
impl Sync for CandlesRequest
impl Unpin for CandlesRequest
impl UnsafeUnpin for CandlesRequest
impl UnwindSafe for CandlesRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more