pub struct Bar {
pub timestamp: i64,
pub open: f64,
pub high: f64,
pub low: f64,
pub close: f64,
pub volume: Option<u64>,
}
Expand description
A single ‘bar’ of information for OHLC (+volume) pricing data over a unit of time.
- Bars are ordered by the timestamp.
- The unit of time is defined by whatever function returns the Bar, but is generally one day.
Fields§
§timestamp: i64
A time during the unit of time - usually the time at open.
open: f64
The price at the start of the unit of time
high: f64
The highest price seen during the unit of time
low: f64
The lowest price seen during the unit of time
close: f64
The price at the end of the unit of time
volume: Option<u64>
The optional volume traded during the unit of time
Trait Implementations§
Source§impl Ord for Bar
impl Ord for Bar
Source§impl PartialOrd for Bar
impl PartialOrd for Bar
Source§impl Timestamped for Bar
impl Timestamped for Bar
Source§fn timestamp_millis(&self) -> i64
fn timestamp_millis(&self) -> i64
Gets the timestamp in millisecond accuracy
Source§fn datetime(&self) -> DateTime<Utc>
fn datetime(&self) -> DateTime<Utc>
Converts the timestamp into a chrono DateTime structure for easier date / time formatting
Source§fn timestamp_seconds(&self) -> i64
fn timestamp_seconds(&self) -> i64
Gets the timestamp as the number of seconds that have elapsed since the EPOCH
impl Copy for Bar
impl Eq for Bar
Auto Trait Implementations§
impl Freeze for Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin 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