pub struct BarClock { /* private fields */ }Expand description
Bar boundaries for one timeframe, around the clock in UTC by default.
Implementations§
Source§impl BarClock
impl BarClock
Sourcepub fn with_timezone(self, timezone: TimezoneId) -> Self
pub fn with_timezone(self, timezone: TimezoneId) -> Self
Align time windows to the local calendar of timezone. Repeated clock hours remain
separate; a boundary skipped by a clock change starts at the first valid local instant.
Sourcepub fn with_local_timezone(self) -> Self
pub fn with_local_timezone(self) -> Self
Align time windows to the system’s local calendar.
Sourcepub fn with_session(
self,
zone: TimezoneId,
session: Session,
extended_hours: bool,
) -> Self
pub fn with_session( self, zone: TimezoneId, session: Session, extended_hours: bool, ) -> Self
Align intraday buckets to the first selected exchange-session window. Calendar bars
keep their trading-date labels; use data::resample_with_session to derive those labels
from intraday history. Extended windows participate only when requested.
Sourcepub fn bar_open(&self, t: DateTime<Utc>) -> DateTime<Utc>
pub fn bar_open(&self, t: DateTime<Utc>) -> DateTime<Utc>
Open time of the bar containing t. Bars shorter than a day align to local midnight,
weekly bars to Monday, monthly bars to the first day of the month, and other bars to the
Unix epoch. Trade-based bars retain their exact opening timestamp.
Sourcepub fn has_session(&self) -> bool
pub fn has_session(&self) -> bool
Whether this clock restricts bars to exchange trading windows.
Trait Implementations§
impl Eq for BarClock
impl StructuralPartialEq for BarClock
Auto Trait Implementations§
impl Freeze for BarClock
impl RefUnwindSafe for BarClock
impl Send for BarClock
impl Sync for BarClock
impl Unpin for BarClock
impl UnsafeUnpin for BarClock
impl UnwindSafe for BarClock
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
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<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
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> ⓘ
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> ⓘ
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