pub struct Bar {Show 18 fields
pub high: String,
pub low: String,
pub open: String,
pub close: String,
pub time_stamp: String,
pub total_volume: String,
pub down_ticks: Option<Value>,
pub down_volume: Option<Value>,
pub open_interest: Option<Value>,
pub total_ticks: Option<Value>,
pub unchanged_ticks: Option<Value>,
pub unchanged_volume: Option<Value>,
pub up_ticks: Option<Value>,
pub up_volume: Option<Value>,
pub is_realtime: Option<bool>,
pub is_end_of_history: Option<bool>,
pub epoch: Option<u64>,
pub bar_status: Option<String>,
}Expand description
OHLCV bar from the barcharts endpoint.
All numeric fields are returned as strings by the API. Use Bar::ohlcv
to parse them into native types.
§Example
if let Some((o, h, l, c, v)) = bar.ohlcv() {
println!("close={c}, volume={v}");
}Fields§
§high: StringHighest price during the bar period.
low: StringLowest price during the bar period.
open: StringOpening price.
close: StringClosing price.
time_stamp: StringBar timestamp (RFC 3339).
total_volume: StringTotal volume traded during the bar period.
down_ticks: Option<Value>Number of down ticks.
down_volume: Option<Value>Volume on down ticks.
open_interest: Option<Value>Open interest (futures/options).
total_ticks: Option<Value>Total number of ticks.
unchanged_ticks: Option<Value>Number of unchanged ticks.
unchanged_volume: Option<Value>Volume on unchanged ticks.
up_ticks: Option<Value>Number of up ticks.
up_volume: Option<Value>Volume on up ticks.
is_realtime: Option<bool>Whether this bar is from real-time data.
is_end_of_history: Option<bool>Whether this is the last bar in the history.
epoch: Option<u64>Unix epoch timestamp in milliseconds.
bar_status: Option<String>Bar status (e.g., “Closed”, “Open”).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Bar
impl<'de> Deserialize<'de> for Bar
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 Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnsafeUnpin for Bar
impl UnwindSafe for Bar
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