pub struct LastCandleData {
pub ticker: Option<String>,
pub class_code: Option<String>,
pub time_frame: Option<String>,
pub timestamp: Option<String>,
pub open: Option<Decimal>,
pub close: Option<Decimal>,
pub high: Option<Decimal>,
pub low: Option<Decimal>,
pub volume: Option<Decimal>,
}Expand description
An update of the last candle for a time frame.
§Examples
use brokapi_bcs_protocol::ws::models::LastCandleData;
let c: LastCandleData = serde_json::from_str(
r#"{"ticker":"SBER","classCode":"TQBR","timeFrame":"M1","open":244.2,"close":244.5,
"high":244.7,"low":243.9,"volume":3200,"dateTime":"2024-11-10T10:30:00.000Z"}"#,
)?;
assert_eq!(c.close, Some(dec!(244.5)));
assert_eq!(c.timestamp.as_deref(), Some("2024-11-10T10:30:00.000Z"));Fields§
§ticker: Option<String>Ticker.
class_code: Option<String>Class code (board).
time_frame: Option<String>Time frame of the candle: M1 M5 M15 M30 H1 H4 D W MN.
timestamp: Option<String>Time of the candle (UTC), kept as text (JSON field dateTime).
open: Option<Decimal>Opening price.
close: Option<Decimal>Closing price.
high: Option<Decimal>Highest price.
low: Option<Decimal>Lowest price.
volume: Option<Decimal>Traded volume of the candle, in the currency.
Trait Implementations§
Source§impl Clone for LastCandleData
impl Clone for LastCandleData
Source§fn clone(&self) -> LastCandleData
fn clone(&self) -> LastCandleData
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 LastCandleData
impl Debug for LastCandleData
Source§impl<'de> Deserialize<'de> for LastCandleData
impl<'de> Deserialize<'de> for LastCandleData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LastCandleData
impl RefUnwindSafe for LastCandleData
impl Send for LastCandleData
impl Sync for LastCandleData
impl Unpin for LastCandleData
impl UnsafeUnpin for LastCandleData
impl UnwindSafe for LastCandleData
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