pub struct TimeAndSalesPanel {
pub config: TimeAndSalesConfig,
pub filters: Vec<TradeSizeFilter>,
pub combine_fills: bool,
pub show_milliseconds: bool,
/* private fields */
}Expand description
The latest trades of one symbol, newest first, fed by the host.
Push each trade of the stream once with push, and clear when
the symbol changes. Prices and sizes take the aggressor colour: buys rising, sells falling, and
trades of unknown side neutral. The user adds, edits and removes size filters
in the panel: with any filter, only trades matching one are listed, and each filter can ask
for a sound.
Fields§
§config: TimeAndSalesConfigDisplay and layout options for this component.
filters: Vec<TradeSizeFilter>A row is listed when its size reaches the min_size of any filter, or always when there
are none.
combine_fills: boolCombine consecutive fills with the same explicit aggressor id, or, without ids, the same exchange timestamp and known side. Off by default; raw fills stay retained. Size filters then apply to the combined row.
show_milliseconds: boolShow three fractional-second digits in the time column. Off by default. Every row’s hover retains the full timestamp regardless of this setting.
Implementations§
Source§impl TimeAndSalesPanel
impl TimeAndSalesPanel
Sourcepub fn new(config: TimeAndSalesConfig) -> Self
pub fn new(config: TimeAndSalesConfig) -> Self
A panel without trades or filters.
Sourcepub fn push(&mut self, trade: Tick) -> Option<usize>
pub fn push(&mut self, trade: Tick) -> Option<usize>
Adds the next trade of the stream, keeping the latest 10,000. A trade without a finite
price and a finite, non-negative size is ignored. Returns the index of the matching filter
with sound that has the largest min_size, for the host to play that filter’s sound.
With combine_fills, reports only thresholds first reached by
this fill in its consecutive run; later fills and toggling the option do not replay them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeAndSalesPanel
impl RefUnwindSafe for TimeAndSalesPanel
impl Send for TimeAndSalesPanel
impl Sync for TimeAndSalesPanel
impl Unpin for TimeAndSalesPanel
impl UnsafeUnpin for TimeAndSalesPanel
impl UnwindSafe for TimeAndSalesPanel
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