Files
brk/_src/structs/ohlc.rs
2025-02-23 01:25:15 +01:00

25 lines
602 B
Rust

use std::fmt::{self};
use allocative::Allocative;
use bincode::{Decode, Encode};
use serde::{Deserialize, Serialize};
#[allow(clippy::upper_case_acronyms)]
#[derive(Debug, Default, Deserialize, Serialize, Encode, Decode, Clone, Copy, Allocative)]
pub struct OHLC {
pub open: f32,
pub high: f32,
pub low: f32,
pub close: f32,
}
impl fmt::Display for OHLC {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"{{ open: {}, high: {}, low: {}, close: {} }}",
self.open, self.high, self.low, self.close
)
}
}