pub struct VolatilityIndexCandle {
pub timestamp: i64,
pub open: f64,
pub high: f64,
pub low: f64,
pub close: f64,
}Expand description
Volatility index OHLC candle
Represents a single volatility index candle with OHLC data,
returned by /public/get_volatility_index_data.
Fields§
§timestamp: i64Timestamp in milliseconds since Unix epoch
open: f64Open volatility value
high: f64High volatility value
low: f64Low volatility value
close: f64Close volatility value
Implementations§
Source§impl VolatilityIndexCandle
impl VolatilityIndexCandle
Sourcepub fn new(timestamp: i64, open: f64, high: f64, low: f64, close: f64) -> Self
pub fn new(timestamp: i64, open: f64, high: f64, low: f64, close: f64) -> Self
Create a new volatility index candle
Sourcepub fn from_tuple(data: (i64, f64, f64, f64, f64)) -> Self
pub fn from_tuple(data: (i64, f64, f64, f64, f64)) -> Self
Create from raw API response tuple [timestamp, open, high, low, close]
Sourcepub fn is_increasing(&self) -> bool
pub fn is_increasing(&self) -> bool
Check if volatility increased (close > open)
Sourcepub fn is_decreasing(&self) -> bool
pub fn is_decreasing(&self) -> bool
Check if volatility decreased (close < open)
Trait Implementations§
Source§impl Clone for VolatilityIndexCandle
impl Clone for VolatilityIndexCandle
Source§fn clone(&self) -> VolatilityIndexCandle
fn clone(&self) -> VolatilityIndexCandle
Returns a duplicate of the value. Read more
1.0.0 · 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 VolatilityIndexCandle
impl Debug for VolatilityIndexCandle
Source§impl<'de> Deserialize<'de> for VolatilityIndexCandle
impl<'de> Deserialize<'de> for VolatilityIndexCandle
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
Source§impl Display for VolatilityIndexCandle
impl Display for VolatilityIndexCandle
Source§impl PartialEq for VolatilityIndexCandle
impl PartialEq for VolatilityIndexCandle
Source§impl Serialize for VolatilityIndexCandle
impl Serialize for VolatilityIndexCandle
impl StructuralPartialEq for VolatilityIndexCandle
Auto Trait Implementations§
impl Freeze for VolatilityIndexCandle
impl RefUnwindSafe for VolatilityIndexCandle
impl Send for VolatilityIndexCandle
impl Sync for VolatilityIndexCandle
impl Unpin for VolatilityIndexCandle
impl UnsafeUnpin for VolatilityIndexCandle
impl UnwindSafe for VolatilityIndexCandle
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