pub enum TimeFrame {
M1,
M5,
M15,
M30,
H1,
H4,
D,
W,
MN,
}Expand description
Candle time frame, in the names of the broker.
The names are serialized as written (M1, H4, D, MN) and are exactly the list of the broker
docs: M1 M5 M15 M30 H1 H4 D W MN. There is no ten-minute frame at BCS. The request models of this
crate take the time frame as a string, so this enum is a convenience: TimeFrame::D.name() is the
string to send.
§Examples
use brokapi_bcs_protocol::models::enums::TimeFrame;
assert_eq!(serde_json::to_string(&TimeFrame::H1)?, "\"H1\"");
assert_eq!(TimeFrame::D.name(), "D");
// Names the broker does not know are refused when reading.
assert!(serde_json::from_str::<TimeFrame>("\"D1\"").is_err());Variants§
M1
One minute.
M5
Five minutes.
M15
Fifteen minutes.
M30
Thirty minutes.
H1
One hour.
H4
Four hours.
D
One day (D).
W
One week (W).
MN
One month.
Implementations§
Trait Implementations§
impl Copy for TimeFrame
Source§impl<'de> Deserialize<'de> for TimeFrame
impl<'de> Deserialize<'de> for TimeFrame
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
impl Eq for TimeFrame
impl StructuralPartialEq for TimeFrame
Auto Trait Implementations§
impl Freeze for TimeFrame
impl RefUnwindSafe for TimeFrame
impl Send for TimeFrame
impl Sync for TimeFrame
impl Unpin for TimeFrame
impl UnsafeUnpin for TimeFrame
impl UnwindSafe for TimeFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.