pub enum Interval {
Show 20 variants
OneSecond = 0,
FiveSeconds = 1,
TenSeconds = 2,
FifteenSeconds = 3,
ThirtySeconds = 4,
OneMinute = 5,
ThreeMinutes = 6,
FiveMinutes = 7,
FifteenMinutes = 8,
ThirtyMinutes = 9,
FortyFiveMinutes = 10,
OneHour = 11,
TwoHours = 12,
FourHours = 13,
OneDay = 14,
OneWeek = 15,
OneMonth = 16,
OneQuarter = 17,
SixMonths = 18,
Yearly = 19,
}Expand description
Time interval (granularity) for OHLCV/candle bars.
This is one of the most-used types in the crate. Every historical and
real-time data request specifies an interval. The default is OneDay.
§Conversion
From<&str>parses common string representations ("1h","1D","1W", etc.).From<u8>maps TradingView’s numeric interval codes.From<Interval> for chrono::Durationprovides an approximate duration.Displayoutputs the TradingView wire format.
§Navigation
Interval::longer() steps up to the next coarser interval.
Variants§
OneSecond = 0
1 second.
FiveSeconds = 1
5 seconds.
TenSeconds = 2
10 seconds.
FifteenSeconds = 3
15 seconds.
ThirtySeconds = 4
30 seconds.
OneMinute = 5
1 minute.
ThreeMinutes = 6
3 minutes.
FiveMinutes = 7
5 minutes.
FifteenMinutes = 8
15 minutes.
ThirtyMinutes = 9
30 minutes.
FortyFiveMinutes = 10
45 minutes.
OneHour = 11
1 hour.
TwoHours = 12
2 hours.
FourHours = 13
4 hours.
OneDay = 14
1 day (default).
OneWeek = 15
1 week.
OneMonth = 16
1 month.
OneQuarter = 17
1 quarter (~3 months).
SixMonths = 18
6 months.
Yearly = 19
1 year.
Implementations§
Trait Implementations§
impl Copy for Interval
Source§impl<'de> Deserialize<'de> for Interval
impl<'de> Deserialize<'de> for Interval
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 Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnsafeUnpin for Interval
impl UnwindSafe for Interval
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