pub struct OrderBookView {
pub filter: OrderFilter,
pub profile: BookProfile,
pub quantity_unit: Option<String>,
pub tiers: Option<OrderSizeTiers>,
pub tier_colors: Option<[Color32; 2]>,
}Expand description
How the live book is shown by the heatmap’s profile and by a depth ladder: which individual orders count, what a bar measures, and which orders are highlighted. Its tiers also mark the heatmap’s cells. The defaults show the aggregate book as the feed sends it. Serializable, so a host can keep it with its chart settings; fields missing from older documents take their defaults.
Fields§
§filter: OrderFilterThe orders that count. Anything but the default needs a feed that sends order events,
see Sink::push_order_event.
profile: BookProfileWhat a bar of the profile measures.
quantity_unit: Option<String>Quantity unit supplied by the host, such as “lots”, “shares” or “BTC”. Labels use “feed units” when absent or blank. This describes the supplied sizes, without conversion; it is independent of the instrument’s price unit.
tiers: Option<OrderSizeTiers>Highlights a price whose largest known individual order reaches a tier. A price without
order data, as with an aggregate feed, is not highlighted and not reported as small. The
liquidity heatmap marks its cells by the largest order its history recorded in the row, see
DepthColumn::largest_bid_orders.
tier_colors: Option<[Color32; 2]>Colours of the notable and the large tier, or None, the default, for the
ChartColors::order_notable and order_large of the theme
the view is drawn with, so the marks follow a change of theme.
Implementations§
Source§impl OrderBookView
impl OrderBookView
Sourcepub fn tier_color(&self, tier: OrderSizeTier, colors: &ChartColors) -> Color32
pub fn tier_color(&self, tier: OrderSizeTier, colors: &ChartColors) -> Color32
The colour of a tier: from tier_colors when set, otherwise from
colors, the chart colours of the theme the view is drawn with.
Trait Implementations§
Source§impl Clone for OrderBookView
impl Clone for OrderBookView
Source§fn clone(&self) -> OrderBookView
fn clone(&self) -> OrderBookView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderBookView
impl Debug for OrderBookView
Source§impl Default for OrderBookView
impl Default for OrderBookView
Source§fn default() -> OrderBookView
fn default() -> OrderBookView
Source§impl<'de> Deserialize<'de> for OrderBookViewwhere
OrderBookView: Default,
impl<'de> Deserialize<'de> for OrderBookViewwhere
OrderBookView: Default,
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>,
Source§impl PartialEq for OrderBookView
impl PartialEq for OrderBookView
Source§impl Serialize for OrderBookView
impl Serialize for OrderBookView
impl StructuralPartialEq for OrderBookView
Auto Trait Implementations§
impl Freeze for OrderBookView
impl RefUnwindSafe for OrderBookView
impl Send for OrderBookView
impl Sync for OrderBookView
impl Unpin for OrderBookView
impl UnsafeUnpin for OrderBookView
impl UnwindSafe for OrderBookView
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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