pub struct QuoteOneSide;Expand description
An advanced algorithm that quotes one side of a market by joining the passive side within a specified number of ticks, with the option to improve the market by one tick to gain queue priority.
The primary intended use is in the context of spread trading, where it can be used to work the passive side of a spread while maintaining price competitiveness.
§Key Functionality
-
max_ticks_outsidedetermines the range of ticks from the best same-side price to quote. This is the maximum number of ticks outside (less aggressive than) the BBO that the algo will quote. -
This algo will always put out a limit order with a price that is equal to or less aggressive than the set limit price. It will attempt to only post liquidity, so it will not cross the market unless the market moves toward the order in the midst of sending the order.
-
The algorithm can improve the market by one tick when:
improve_or_joinis set toImprove- The opposite side is at least one tick away
- Improving would not violate the limit price
-
This algorithm will always have at most one order at a time out.
§Quote Positioning Strategy
The algorithm uses a sophisticated positioning strategy:
-
Join Mode: Places orders at the current best bid/ask on the same side
- IMPORTANT: The algo joins at the BBO which INCLUDES its own order once placed
- Once at the BBO, the order maintains that price level even if other orders cancel
- This means the algo won’t automatically back off to less aggressive prices
- This behavior is a side effect of only using L1 data to determine the BBO
- However, it may result in the algo being alone at a price level if others cancel
- The order will only move to MORE aggressive prices (never less aggressive in Join mode)
-
Improve Mode: Places orders one tick better than the current best bid/ask if there’s room
- Attempts to gain queue priority by improving the market by exactly one tick
- Will not cross the spread (checks opposite side before improving)
-
This algorithm will behave differently in PAPER_TRADING than on the real exchange, because PAPER_TRADING does not affect the order book
The algorithm continuously monitors the market and repositions the quote as needed to maintain competitiveness while respecting the specified constraints.
§Use Cases
- Market Making: Providing liquidity on one side of the market
- Spread Trading: Working the passive leg of a spread trade
- Passive Execution: Getting filled at favorable prices without crossing the spread
Trait Implementations§
Source§impl Algo for QuoteOneSide
impl Algo for QuoteOneSide
Source§impl Clone for QuoteOneSide
impl Clone for QuoteOneSide
Source§fn clone(&self) -> QuoteOneSide
fn clone(&self) -> QuoteOneSide
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuoteOneSide
impl Debug for QuoteOneSide
Source§impl<'de> Deserialize<'de> for QuoteOneSide
impl<'de> Deserialize<'de> for QuoteOneSide
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 JsonSchema for QuoteOneSide
impl JsonSchema for QuoteOneSide
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more