pub struct AlertFeed { /* private fields */ }Expand description
Historical and streaming inputs for an alert without a rendered chart. Uses the same
validation, trade aggregation and history/live merge rules as a chart. Dropping it stops
its subscription and discards late replies. Available with alert-engine.
Implementations§
Source§impl AlertFeed
impl AlertFeed
Sourcepub fn history_request(
symbol: impl Into<String>,
timeframe: Timeframe,
) -> HistoryRequest
pub fn history_request( symbol: impl Into<String>, timeframe: Timeframe, ) -> HistoryRequest
A latest-history request for 1,000 bars. Set its public calendar, session, conversion
and count fields before passing it to new to match the source chart.
Sourcepub fn new(
feed: Arc<dyn Datafeed>,
request: HistoryRequest,
metric: Option<String>,
) -> Self
pub fn new( feed: Arc<dyn Datafeed>, request: HistoryRequest, metric: Option<String>, ) -> Self
Requests the symbol’s metadata, then its history and updates. metric selects a study’s
metric series; None selects price bars. Calls return promptly as Datafeed requires.
Sourcepub fn set_storage(&mut self, storage: Arc<dyn Storage>)
pub fn set_storage(&mut self, storage: Arc<dyn Storage>)
Follows this symbol’s drawings in host storage, without writing to it.
Sourcepub fn bars(&self) -> &[Bar]
pub fn bars(&self) -> &[Bar]
Bars available once history reaches the requested count or its end. Live updates stay buffered until then so evaluation never mistakes an incomplete stream for history.
Sourcepub fn require_start(&mut self, start: DateTime<Utc>)
pub fn require_start(&mut self, start: DateTime<Utc>)
Extend coverage to start, even when it needs more than the initial bar count.
Sourcepub fn clock(&self) -> &BarClock
pub fn clock(&self) -> &BarClock
Calendar shared by history, streaming aggregation and study calculation.
Sourcepub fn instrument(&self) -> Option<&Instrument>
pub fn instrument(&self) -> Option<&Instrument>
Metadata resolved by the host.
Sourcepub fn drawing_value(
&self,
source: &AlertSource,
at: usize,
scale: PriceScaleMode,
) -> Option<f64>
pub fn drawing_value( &self, source: &AlertSource, at: usize, scale: PriceScaleMode, ) -> Option<f64>
A stored drawing’s level on the evaluated bar, using the chart’s interpolation and
price-scale geometry. None while drawings are loading or for an unavailable level.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AlertFeed
impl !UnwindSafe for AlertFeed
impl Freeze for AlertFeed
impl Send for AlertFeed
impl Sync for AlertFeed
impl Unpin for AlertFeed
impl UnsafeUnpin for AlertFeed
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> 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