pub struct DailySessionProvider {
pub break_hour: u32,
pub break_minute: u32,
pub time_zone: TimezoneId,
}Expand description
Daily session provider with a configurable break hour.
Detects day boundaries at the break hour and minute, in its zone (UTC by default). Use nyse (with timezones) for a preset
matching NYSE regular-session close in exchange time, or continuous
for 24/7 markets (midnight UTC).
Fields§
§break_hour: u32Hour of day for session break (0-23)
break_minute: u32Minute of hour for session break (0-59)
time_zone: TimezoneIdZone in which the daily break is defined.
Implementations§
Trait Implementations§
Source§impl Clone for DailySessionProvider
impl Clone for DailySessionProvider
Source§fn clone(&self) -> DailySessionProvider
fn clone(&self) -> DailySessionProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DailySessionProvider
impl Debug for DailySessionProvider
Source§impl Default for DailySessionProvider
impl Default for DailySessionProvider
Source§impl SessionProvider for DailySessionProvider
impl SessionProvider for DailySessionProvider
Source§fn session_break_between(
&self,
from: &DateTime<Utc>,
to: &DateTime<Utc>,
) -> Option<SessionBreak>
fn session_break_between( &self, from: &DateTime<Utc>, to: &DateTime<Utc>, ) -> Option<SessionBreak>
Check if a session break occurs between two ts
Returns Some(SessionBreak) if there’s a break, None otherwise
Source§fn session_breaks_in_range(
&self,
start: &DateTime<Utc>,
end: &DateTime<Utc>,
) -> Vec<SessionBreak>
fn session_breaks_in_range( &self, start: &DateTime<Utc>, end: &DateTime<Utc>, ) -> Vec<SessionBreak>
Get all session breaks within a time range, checking at most one minute at a time.
The final check stops at
end; an empty or reversed range has no breaks.Source§fn session_breaks(&self, bars: &[Bar]) -> Vec<(usize, SessionBreak)>
fn session_breaks(&self, bars: &[Bar]) -> Vec<(usize, SessionBreak)>
The breaks between consecutive
bars, as find_session_breaks returns them. The
default asks session_break_between for each pair; a
provider can find them in one pass instead.Auto Trait Implementations§
impl Freeze for DailySessionProvider
impl RefUnwindSafe for DailySessionProvider
impl Send for DailySessionProvider
impl Sync for DailySessionProvider
impl Unpin for DailySessionProvider
impl UnsafeUnpin for DailySessionProvider
impl UnwindSafe for DailySessionProvider
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more