pub struct Candle {
pub timestamp: i64,
pub open: f64,
pub high: f64,
pub low: f64,
pub close: f64,
pub volume: f64,
pub trades: Option<u64>,
}Expand description
Candlestick/OHLCV data
Fields§
§timestamp: i64Timestamp
open: f64Open price
high: f64High price
low: f64Low price
close: f64Close price
volume: f64Volume
trades: Option<u64>Number of trades
Implementations§
Source§impl Candle
impl Candle
Sourcepub fn is_bullish(&self) -> bool
pub fn is_bullish(&self) -> bool
Check if this is a bullish candle
Sourcepub fn is_bearish(&self) -> bool
pub fn is_bearish(&self) -> bool
Check if this is a bearish candle
Sourcepub fn upper_shadow(&self) -> f64
pub fn upper_shadow(&self) -> f64
Calculate the upper shadow
Sourcepub fn lower_shadow(&self) -> f64
pub fn lower_shadow(&self) -> f64
Calculate the lower shadow
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Candle
impl<'de> Deserialize<'de> for Candle
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 Candle
impl RefUnwindSafe for Candle
impl Send for Candle
impl Sync for Candle
impl Unpin for Candle
impl UnwindSafe for Candle
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