pub struct KlineEvent {}Expand description
OHLCV candlestick/kline data
Fields§
§exchange: Exchange§symbol: Symbol§interval: StringInterval (e.g., “1m”, “5m”, “1h”)
open_time: i64Candle open time (Unix microseconds)
close_time: i64Candle close time (Unix microseconds)
open: DecimalOpening price
high: DecimalHighest price
low: DecimalLowest price
close: DecimalClosing price
volume: DecimalVolume in base currency
quote_volume: Option<Decimal>Quote volume (volume * price)
trades: Option<u64>Number of trades in this candle
is_closed: boolWhether this candle is closed/complete
Implementations§
Source§impl KlineEvent
impl KlineEvent
Sourcepub fn typical_price(&self) -> Decimal
pub fn typical_price(&self) -> Decimal
Get the typical price (HLC/3)
Sourcepub fn price_change(&self) -> Decimal
pub fn price_change(&self) -> Decimal
Get the price change for this candle
Sourcepub fn price_change_pct(&self) -> Decimal
pub fn price_change_pct(&self) -> Decimal
Get the price change percentage
Trait Implementations§
Source§impl Clone for KlineEvent
impl Clone for KlineEvent
Source§fn clone(&self) -> KlineEvent
fn clone(&self) -> KlineEvent
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 KlineEvent
impl Debug for KlineEvent
Source§impl<'de> Deserialize<'de> for KlineEvent
impl<'de> Deserialize<'de> for KlineEvent
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 KlineEvent
impl RefUnwindSafe for KlineEvent
impl Send for KlineEvent
impl Sync for KlineEvent
impl Unpin for KlineEvent
impl UnsafeUnpin for KlineEvent
impl UnwindSafe for KlineEvent
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