#[non_exhaustive]pub struct Tick {
pub ts: DateTime<Utc>,
pub price: f64,
pub size: f64,
pub side: Option<OrderSide>,
pub id: Option<u64>,
pub conditions: TradeConditions,
pub aggressor_order_id: Option<u64>,
pub resting_order_id: Option<u64>,
}Expand description
A single trade execution (time & sales entry).
Each tick represents one matched trade on the exchange, recording the
price, size, and aggressor side. Ticks are the finest-grained market
data and can be aggregated into bars, footprint charts, or volume
profiles. Build it with Tick::new. A trade names no symbol: the
Sink it is pushed into stands for one instrument, so a
trade holds no heap data.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ts: DateTime<Utc>Ts of the trade
price: f64Trade price
size: f64Trade size/volume
side: Option<OrderSide>Aggressor side, None when the feed does not classify the trade.
id: Option<u64>Exchange trade id or sequence number, unique per symbol and never reused: a number that restarts each session, such as a daily sequence number, is not an id unless combined with the session date. With it, history and live trades join without losing or repeating a trade, and a live trade whose id was already taken is dropped.
conditions: TradeConditionsSale conditions the exchange reported, so studies and overlays can leave out prints such as off-exchange or auction trades.
aggressor_order_id: Option<u64>Exchange aggressor order id, unique per symbol. Only explicit matching ids combine fills.
resting_order_id: Option<u64>Resting order filled by this execution, when supplied by an order-level feed.
Implementations§
Source§impl Tick
impl Tick
Sourcepub fn new(
ts: DateTime<Utc>,
price: f64,
size: f64,
side: Option<OrderSide>,
) -> Self
pub fn new( ts: DateTime<Utc>, price: f64, size: f64, side: Option<OrderSide>, ) -> Self
A trade without an id.
Sourcepub fn with_resting_order_id(self, id: u64) -> Self
pub fn with_resting_order_id(self, id: u64) -> Self
Sets resting_order_id.
Sourcepub fn with_aggressor_order_id(self, id: u64) -> Self
pub fn with_aggressor_order_id(self, id: u64) -> Self
Sets aggressor_order_id.
Sourcepub fn with_conditions(self, conditions: TradeConditions) -> Self
pub fn with_conditions(self, conditions: TradeConditions) -> Self
Sets conditions.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tick
impl<'de> Deserialize<'de> for Tick
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>,
impl StructuralPartialEq for Tick
Auto Trait Implementations§
impl Freeze for Tick
impl RefUnwindSafe for Tick
impl Send for Tick
impl Sync for Tick
impl Unpin for Tick
impl UnsafeUnpin for Tick
impl UnwindSafe for Tick
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