pub struct TwapAlgorithm {
pub core: ExecutionAlgorithmCore,
/* private fields */
}Expand description
Time-Weighted Average Price (TWAP) execution algorithm.
Executes orders by evenly spreading them over a specified time horizon, at regular intervals. The algorithm receives a primary order and spawns smaller child orders that are executed at regular intervals.
Fields§
§core: ExecutionAlgorithmCoreThe algorithm core.
Implementations§
Source§impl TwapAlgorithm
impl TwapAlgorithm
Sourcepub fn new(config: TwapAlgorithmConfig) -> Self
pub fn new(config: TwapAlgorithmConfig) -> Self
Creates a new TwapAlgorithm instance.
Trait Implementations§
Source§impl DataActor for TwapAlgorithm
impl DataActor for TwapAlgorithm
Source§fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>
fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>
Actions to be performed when receiving a time event. Read more
Source§fn actor_id(&self) -> ActorIdwhere
Self: DataActorNative,
fn actor_id(&self) -> ActorIdwhere
Self: DataActorNative,
Returns the actor ID.
Source§fn trader_id(&self) -> Option<TraderId>where
Self: DataActorNative,
fn trader_id(&self) -> Option<TraderId>where
Self: DataActorNative,
Returns the trader ID this actor is registered to.
Source§fn is_registered(&self) -> boolwhere
Self: DataActorNative,
fn is_registered(&self) -> boolwhere
Self: DataActorNative,
Returns whether the actor is registered with a trader.
Source§fn config(&self) -> &DataActorConfigwhere
Self: DataActorNative,
fn config(&self) -> &DataActorConfigwhere
Self: DataActorNative,
Returns the actor configuration.
Source§fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>, Error>
fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>, Error>
Actions to be performed when the actor state is saved. Read more
Source§fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<(), Error>
fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<(), Error>
Actions to be performed when the actor state is loaded. Read more
Source§fn on_data(&mut self, data: &CustomData) -> Result<(), Error>
fn on_data(&mut self, data: &CustomData) -> Result<(), Error>
Actions to be performed when receiving custom data. Read more
Source§fn on_signal(&mut self, signal: &Signal) -> Result<(), Error>
fn on_signal(&mut self, signal: &Signal) -> Result<(), Error>
Actions to be performed when receiving a signal. Read more
Source§fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<(), Error>
fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<(), Error>
Actions to be performed when receiving an instrument. Read more
Source§fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<(), Error>
fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<(), Error>
Actions to be performed when receiving order book deltas. Read more
Source§fn on_book(&mut self, order_book: &OrderBook) -> Result<(), Error>
fn on_book(&mut self, order_book: &OrderBook) -> Result<(), Error>
Actions to be performed when receiving an order book. Read more
Source§fn on_quote(&mut self, quote: &QuoteTick) -> Result<(), Error>
fn on_quote(&mut self, quote: &QuoteTick) -> Result<(), Error>
Actions to be performed when receiving a quote. Read more
Source§fn on_trade(&mut self, tick: &TradeTick) -> Result<(), Error>
fn on_trade(&mut self, tick: &TradeTick) -> Result<(), Error>
Actions to be performed when receiving a trade. Read more
Source§fn on_bar(&mut self, bar: &Bar) -> Result<(), Error>
fn on_bar(&mut self, bar: &Bar) -> Result<(), Error>
Actions to be performed when receiving a bar. Read more
Source§fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<(), Error>
fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<(), Error>
Actions to be performed when receiving a mark price update. Read more
Source§fn on_index_price(
&mut self,
index_price: &IndexPriceUpdate,
) -> Result<(), Error>
fn on_index_price( &mut self, index_price: &IndexPriceUpdate, ) -> Result<(), Error>
Actions to be performed when receiving an index price update. Read more
Source§fn on_funding_rate(
&mut self,
funding_rate: &FundingRateUpdate,
) -> Result<(), Error>
fn on_funding_rate( &mut self, funding_rate: &FundingRateUpdate, ) -> Result<(), Error>
Actions to be performed when receiving a funding rate update. Read more
Source§fn on_option_greeks(&mut self, greeks: &OptionGreeks) -> Result<(), Error>
fn on_option_greeks(&mut self, greeks: &OptionGreeks) -> Result<(), Error>
Actions to be performed when receiving exchange-provided option greeks. Read more
Source§fn on_option_chain(&mut self, slice: &OptionChainSlice) -> Result<(), Error>
fn on_option_chain(&mut self, slice: &OptionChainSlice) -> Result<(), Error>
Actions to be performed when receiving an option chain slice snapshot. Read more
Source§fn on_instrument_status(&mut self, data: &InstrumentStatus) -> Result<(), Error>
fn on_instrument_status(&mut self, data: &InstrumentStatus) -> Result<(), Error>
Actions to be performed when receiving an instrument status update. Read more
Source§fn on_instrument_close(&mut self, update: &InstrumentClose) -> Result<(), Error>
fn on_instrument_close(&mut self, update: &InstrumentClose) -> Result<(), Error>
Actions to be performed when receiving an instrument close update. Read more
Source§fn on_order_filled(&mut self, event: &OrderFilled) -> Result<(), Error>
fn on_order_filled(&mut self, event: &OrderFilled) -> Result<(), Error>
Actions to be performed when receiving an order filled event. Read more
Source§fn on_order_canceled(&mut self, event: &OrderCanceled) -> Result<(), Error>
fn on_order_canceled(&mut self, event: &OrderCanceled) -> Result<(), Error>
Actions to be performed when receiving an order canceled event. Read more
Source§fn on_historical_data(
&mut self,
data: &(dyn Any + 'static),
) -> Result<(), Error>
fn on_historical_data( &mut self, data: &(dyn Any + 'static), ) -> Result<(), Error>
Actions to be performed when receiving historical data. Read more
Source§fn on_historical_book_deltas(
&mut self,
deltas: &[OrderBookDelta],
) -> Result<(), Error>
fn on_historical_book_deltas( &mut self, deltas: &[OrderBookDelta], ) -> Result<(), Error>
Actions to be performed when receiving historical book deltas. Read more
Source§fn on_historical_book_depth(
&mut self,
depths: &[OrderBookDepth10],
) -> Result<(), Error>
fn on_historical_book_depth( &mut self, depths: &[OrderBookDepth10], ) -> Result<(), Error>
Actions to be performed when receiving historical book depth. Read more
Source§fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<(), Error>
fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<(), Error>
Actions to be performed when receiving historical quotes. Read more
Source§fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<(), Error>
fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<(), Error>
Actions to be performed when receiving historical trades. Read more
Source§fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<(), Error>
fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<(), Error>
Actions to be performed when receiving historical bars. Read more
Source§fn on_historical_mark_prices(
&mut self,
mark_prices: &[MarkPriceUpdate],
) -> Result<(), Error>
fn on_historical_mark_prices( &mut self, mark_prices: &[MarkPriceUpdate], ) -> Result<(), Error>
Actions to be performed when receiving historical mark prices. Read more
Source§fn on_historical_index_prices(
&mut self,
index_prices: &[IndexPriceUpdate],
) -> Result<(), Error>
fn on_historical_index_prices( &mut self, index_prices: &[IndexPriceUpdate], ) -> Result<(), Error>
Actions to be performed when receiving historical index prices. Read more
Source§fn on_historical_funding_rates(
&mut self,
funding_rates: &[FundingRateUpdate],
) -> Result<(), Error>
fn on_historical_funding_rates( &mut self, funding_rates: &[FundingRateUpdate], ) -> Result<(), Error>
Actions to be performed when receiving historical funding rates. Read more
Source§fn clock(&self) -> ClockApi<'_>where
Self: DataActorNative,
fn clock(&self) -> ClockApi<'_>where
Self: DataActorNative,
Returns the user-facing clock API.
Source§fn cache(&self) -> CacheApi<'_>where
Self: DataActorNative,
fn cache(&self) -> CacheApi<'_>where
Self: DataActorNative,
Returns the user-facing cache API.
Source§fn shutdown_system(&self, reason: Option<String>)where
Self: DataActorNative,
fn shutdown_system(&self, reason: Option<String>)where
Self: DataActorNative,
Sends a shutdown command to the system with an optional reason. Read more
Source§fn publish_data(&self, data_type: &DataType, data: &CustomData)where
Self: DataActorNative,
fn publish_data(&self, data_type: &DataType, data: &CustomData)where
Self: DataActorNative,
Source§fn publish_signal(&self, name: &str, value: String, ts_event: UnixNanos)where
Self: DataActorNative,
fn publish_signal(&self, name: &str, value: String, ts_event: UnixNanos)where
Self: DataActorNative,
Source§fn add_synthetic(&self, synthetic: SyntheticInstrument) -> Result<(), Error>where
Self: DataActorNative,
fn add_synthetic(&self, synthetic: SyntheticInstrument) -> Result<(), Error>where
Self: DataActorNative,
Adds the
synthetic instrument to the cache. Read moreSource§fn update_synthetic(&self, synthetic: SyntheticInstrument) -> Result<(), Error>where
Self: DataActorNative,
fn update_synthetic(&self, synthetic: SyntheticInstrument) -> Result<(), Error>where
Self: DataActorNative,
Updates the
synthetic instrument in the cache, replacing the existing entry. Read moreSource§fn handle_time_event(&mut self, event: &TimeEvent)
fn handle_time_event(&mut self, event: &TimeEvent)
Handles a received time event.
Source§fn handle_data(&mut self, data: &CustomData)
fn handle_data(&mut self, data: &CustomData)
Handles a received custom data point.
Source§fn handle_signal(&mut self, signal: &Signal)
fn handle_signal(&mut self, signal: &Signal)
Handles a received signal.
Source§fn handle_instrument(&mut self, instrument: &InstrumentAny)
fn handle_instrument(&mut self, instrument: &InstrumentAny)
Handles a received instrument.
Source§fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)
fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)
Handles received order book deltas.
Source§fn handle_book(&mut self, book: &OrderBook)
fn handle_book(&mut self, book: &OrderBook)
Handles a received order book reference.
Source§fn handle_quote(&mut self, quote: &QuoteTick)where
Self: DataActorNative,
fn handle_quote(&mut self, quote: &QuoteTick)where
Self: DataActorNative,
Handles a received quote.
Source§fn handle_trade(&mut self, trade: &TradeTick)where
Self: DataActorNative,
fn handle_trade(&mut self, trade: &TradeTick)where
Self: DataActorNative,
Handles a received trade.
Source§fn handle_bar(&mut self, bar: &Bar)where
Self: DataActorNative,
fn handle_bar(&mut self, bar: &Bar)where
Self: DataActorNative,
Handles a receiving bar.
Source§fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)
fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)
Handles a received mark price update.
Source§fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)
fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)
Handles a received index price update.
Source§fn handle_funding_rate(&mut self, funding_rate: &FundingRateUpdate)
fn handle_funding_rate(&mut self, funding_rate: &FundingRateUpdate)
Handles a received funding rate update.
Source§fn handle_option_greeks(&mut self, greeks: &OptionGreeks)
fn handle_option_greeks(&mut self, greeks: &OptionGreeks)
Handles a received option greeks update.
Source§fn handle_option_chain(&mut self, slice: &OptionChainSlice)
fn handle_option_chain(&mut self, slice: &OptionChainSlice)
Handles a received option chain slice snapshot.
Source§fn handle_instrument_status(&mut self, status: &InstrumentStatus)
fn handle_instrument_status(&mut self, status: &InstrumentStatus)
Handles a received instrument status.
Source§fn handle_instrument_close(&mut self, close: &InstrumentClose)
fn handle_instrument_close(&mut self, close: &InstrumentClose)
Handles a received instrument close.
Source§fn handle_order_filled(&mut self, event: &OrderFilled)where
Self: DataActorNative,
fn handle_order_filled(&mut self, event: &OrderFilled)where
Self: DataActorNative,
Handles a received order filled event.
Source§fn handle_order_canceled(&mut self, event: &OrderCanceled)where
Self: DataActorNative,
fn handle_order_canceled(&mut self, event: &OrderCanceled)where
Self: DataActorNative,
Handles a received order canceled event.
Source§fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
Handles received historical data.
Source§fn handle_data_response(&mut self, resp: &CustomDataResponse)
fn handle_data_response(&mut self, resp: &CustomDataResponse)
Handles a data response.
Source§fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
Handles an instrument response.
Source§fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
Handles an instruments response.
Source§fn handle_book_response(&mut self, resp: &BookResponse)
fn handle_book_response(&mut self, resp: &BookResponse)
Handles a book response.
Source§fn handle_book_deltas_response(&mut self, resp: &BookDeltasResponse)
fn handle_book_deltas_response(&mut self, resp: &BookDeltasResponse)
Handles a book deltas response.
Source§fn handle_book_depth_response(&mut self, resp: &BookDepthResponse)
fn handle_book_depth_response(&mut self, resp: &BookDepthResponse)
Handles a book depth response.
Source§fn handle_quotes_response(&mut self, resp: &QuotesResponse)where
Self: DataActorNative,
fn handle_quotes_response(&mut self, resp: &QuotesResponse)where
Self: DataActorNative,
Handles a quotes response.
Source§fn handle_trades_response(&mut self, resp: &TradesResponse)where
Self: DataActorNative,
fn handle_trades_response(&mut self, resp: &TradesResponse)where
Self: DataActorNative,
Handles a trades response.
Source§fn handle_bars_response(&mut self, resp: &BarsResponse)where
Self: DataActorNative,
fn handle_bars_response(&mut self, resp: &BarsResponse)where
Self: DataActorNative,
Handles a bars response.
Source§fn handle_funding_rates_response(&mut self, resp: &FundingRatesResponse)
fn handle_funding_rates_response(&mut self, resp: &FundingRatesResponse)
Handles a funding rates response.
Source§fn subscribe_data(
&mut self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_data( &mut self, data_type: DataType, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
data_type data.Source§fn subscribe_quotes(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_quotes( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
QuoteTick data for the instrument_id.Source§fn subscribe_instruments(
&mut self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_instruments( &mut self, venue: Venue, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
InstrumentAny data for the venue.Source§fn subscribe_instrument(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_instrument( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
InstrumentAny data for the instrument_id.Source§fn subscribe_book_deltas(
&mut self,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
managed: bool,
params: Option<Params>,
)
fn subscribe_book_deltas( &mut self, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, managed: bool, params: Option<Params>, )
Subscribe to streaming
OrderBookDeltas data for the instrument_id.Source§fn subscribe_book_at_interval(
&mut self,
instrument_id: InstrumentId,
book_type: BookType,
depth: Option<NonZero<usize>>,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_book_at_interval( &mut self, instrument_id: InstrumentId, book_type: BookType, depth: Option<NonZero<usize>>, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to
OrderBook snapshots at a specified interval for the instrument_id.Source§fn subscribe_trades(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_trades( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
TradeTick data for the instrument_id.Source§fn subscribe_bars(
&mut self,
bar_type: BarType,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_bars( &mut self, bar_type: BarType, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
Bar data for the bar_type.Source§fn subscribe_mark_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_mark_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
MarkPriceUpdate data for the instrument_id.Source§fn subscribe_index_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_index_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
IndexPriceUpdate data for the instrument_id.Source§fn subscribe_funding_rates(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_funding_rates( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
FundingRateUpdate data for the instrument_id.Source§fn subscribe_option_greeks(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_option_greeks( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
OptionGreeks data for the instrument_id.Source§fn subscribe_instrument_status(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_instrument_status( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
InstrumentStatus data for the instrument_id.Source§fn subscribe_instrument_close(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_instrument_close( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming
InstrumentClose data for the instrument_id.Source§fn subscribe_option_chain(
&mut self,
series_id: OptionSeriesId,
strike_range: StrikeRange,
snapshot_interval_ms: Option<u64>,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_option_chain( &mut self, series_id: OptionSeriesId, strike_range: StrikeRange, snapshot_interval_ms: Option<u64>, client_id: Option<ClientId>, params: Option<Params>, )
Source§fn subscribe_order_fills(&mut self, instrument_id: InstrumentId)
fn subscribe_order_fills(&mut self, instrument_id: InstrumentId)
Subscribe to
OrderFilled events for the instrument_id.Source§fn subscribe_order_cancels(&mut self, instrument_id: InstrumentId)
fn subscribe_order_cancels(&mut self, instrument_id: InstrumentId)
Subscribe to
OrderCanceled events for the instrument_id.Source§fn unsubscribe_data(
&mut self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_data( &mut self, data_type: DataType, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
data_type data.Source§fn unsubscribe_signal(&mut self, name: &str)
fn unsubscribe_signal(&mut self, name: &str)
Unsubscribe from
Signal data by name.Source§fn unsubscribe_instruments(
&mut self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_instruments( &mut self, venue: Venue, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
InstrumentAny data for the venue.Source§fn unsubscribe_instrument(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_instrument( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
InstrumentAny data for the instrument_id.Source§fn unsubscribe_book_deltas(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_book_deltas( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
OrderBookDeltas data for the instrument_id.Source§fn unsubscribe_book_at_interval(
&mut self,
instrument_id: InstrumentId,
interval_ms: NonZero<usize>,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_book_at_interval( &mut self, instrument_id: InstrumentId, interval_ms: NonZero<usize>, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from
OrderBook snapshots at a specified interval for the instrument_id.Source§fn unsubscribe_quotes(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_quotes( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
QuoteTick data for the instrument_id.Source§fn unsubscribe_trades(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_trades( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
TradeTick data for the instrument_id.Source§fn unsubscribe_bars(
&mut self,
bar_type: BarType,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_bars( &mut self, bar_type: BarType, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
Bar data for the bar_type.Source§fn unsubscribe_mark_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_mark_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
MarkPriceUpdate data for the instrument_id.Source§fn unsubscribe_index_prices(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_index_prices( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
IndexPriceUpdate data for the instrument_id.Source§fn unsubscribe_funding_rates(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_funding_rates( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
FundingRateUpdate data for the instrument_id.Source§fn unsubscribe_option_greeks(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_option_greeks( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
OptionGreeks data for the instrument_id.Source§fn unsubscribe_instrument_status(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_instrument_status( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
InstrumentStatus data for the instrument_id.Source§fn unsubscribe_instrument_close(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_instrument_close( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming
InstrumentClose data for the instrument_id.Source§fn unsubscribe_option_chain(
&mut self,
series_id: OptionSeriesId,
client_id: Option<ClientId>,
)
fn unsubscribe_option_chain( &mut self, series_id: OptionSeriesId, client_id: Option<ClientId>, )
Unsubscribe from streaming
OptionChainSlice snapshots for the option series_id.Source§fn unsubscribe_order_fills(&mut self, instrument_id: InstrumentId)
fn unsubscribe_order_fills(&mut self, instrument_id: InstrumentId)
Unsubscribe from
OrderFilled events for the instrument_id.Source§fn unsubscribe_order_cancels(&mut self, instrument_id: InstrumentId)
fn unsubscribe_order_cancels(&mut self, instrument_id: InstrumentId)
Unsubscribe from
OrderCanceled events for the instrument_id.Source§fn request_data(
&mut self,
data_type: DataType,
client_id: ClientId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_data( &mut self, data_type: DataType, client_id: ClientId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, params: Option<Params>, ) -> Result<UUID4, Error>
Request historical custom data of the given
data_type. Read moreSource§fn request_instrument(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_instrument( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_instruments(
&mut self,
venue: Option<Venue>,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_instruments( &mut self, venue: Option<Venue>, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_book_snapshot(
&mut self,
instrument_id: InstrumentId,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_book_snapshot( &mut self, instrument_id: InstrumentId, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_book_deltas(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_book_deltas( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_book_depth(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
depth: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_book_depth( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_quotes(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_quotes( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_trades(
&mut self,
instrument_id: InstrumentId,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_trades( &mut self, instrument_id: InstrumentId, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§fn request_bars(
&mut self,
bar_type: BarType,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_bars( &mut self, bar_type: BarType, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§impl DataActorNative for TwapAlgorithm
impl DataActorNative for TwapAlgorithm
Source§fn core(&self) -> &DataActorCore
fn core(&self) -> &DataActorCore
Returns the actor core.
Source§fn core_mut(&mut self) -> &mut DataActorCore
fn core_mut(&mut self) -> &mut DataActorCore
Returns the mutable actor core.
Source§fn clock_mut(&mut self) -> RefMut<'_, dyn Clock + 'static>
fn clock_mut(&mut self) -> RefMut<'_, dyn Clock + 'static>
Returns the mutable clock borrow for the actor. Read more
Source§impl Debug for TwapAlgorithm
impl Debug for TwapAlgorithm
Source§impl ExecutionAlgorithm for TwapAlgorithm
impl ExecutionAlgorithm for TwapAlgorithm
Source§fn on_order(&mut self, order: OrderAny) -> Result<()>
fn on_order(&mut self, order: OrderAny) -> Result<()>
Called when a primary order is received for execution. Read more
Source§fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>
fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>
Called when a time event is received. Read more
Source§fn id(&self) -> ExecAlgorithmIdwhere
Self: ExecutionAlgorithmNative,
fn id(&self) -> ExecAlgorithmIdwhere
Self: ExecutionAlgorithmNative,
Returns the execution algorithm ID.
Source§fn execute(&mut self, command: TradingCommand) -> Result<()>
fn execute(&mut self, command: TradingCommand) -> Result<()>
Executes a trading command. Read more
Source§fn on_order_list(
&mut self,
_order_list: OrderList,
orders: Vec<OrderAny>,
) -> Result<()>
fn on_order_list( &mut self, _order_list: OrderList, orders: Vec<OrderAny>, ) -> Result<()>
Called when an order list is received for execution. Read more
Source§fn handle_cancel_order(&mut self, command: CancelOrder) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn handle_cancel_order(&mut self, command: CancelOrder) -> Result<()>where
Self: ExecutionAlgorithmNative,
Handles a cancel order command for algorithm-managed orders. Read more
Source§fn generate_order_canceled(&mut self, order: &OrderAny) -> OrderCanceledwhere
Self: ExecutionAlgorithmNative,
fn generate_order_canceled(&mut self, order: &OrderAny) -> OrderCanceledwhere
Self: ExecutionAlgorithmNative,
Generates an
OrderCanceled event for an order.Source§fn generate_order_pending_update(
&mut self,
order: &OrderAny,
) -> OrderPendingUpdatewhere
Self: ExecutionAlgorithmNative,
fn generate_order_pending_update(
&mut self,
order: &OrderAny,
) -> OrderPendingUpdatewhere
Self: ExecutionAlgorithmNative,
Generates an
OrderPendingUpdate event for an order.Source§fn generate_order_pending_cancel(
&mut self,
order: &OrderAny,
) -> OrderPendingCancelwhere
Self: ExecutionAlgorithmNative,
fn generate_order_pending_cancel(
&mut self,
order: &OrderAny,
) -> OrderPendingCancelwhere
Self: ExecutionAlgorithmNative,
Generates an
OrderPendingCancel event for an order.Source§fn spawn_market(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
time_in_force: TimeInForce,
reduce_only: bool,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> MarketOrderwhere
Self: ExecutionAlgorithmNative,
fn spawn_market(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
time_in_force: TimeInForce,
reduce_only: bool,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> MarketOrderwhere
Self: ExecutionAlgorithmNative,
Spawns a market order from a primary order. Read more
Source§fn spawn_limit(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
price: Price,
time_in_force: TimeInForce,
expire_time: Option<UnixNanos>,
post_only: bool,
reduce_only: bool,
display_qty: Option<Quantity>,
emulation_trigger: Option<TriggerType>,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> LimitOrderwhere
Self: ExecutionAlgorithmNative,
fn spawn_limit(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
price: Price,
time_in_force: TimeInForce,
expire_time: Option<UnixNanos>,
post_only: bool,
reduce_only: bool,
display_qty: Option<Quantity>,
emulation_trigger: Option<TriggerType>,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> LimitOrderwhere
Self: ExecutionAlgorithmNative,
Spawns a limit order from a primary order. Read more
Source§fn spawn_market_to_limit(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
time_in_force: TimeInForce,
expire_time: Option<UnixNanos>,
reduce_only: bool,
display_qty: Option<Quantity>,
emulation_trigger: Option<TriggerType>,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> MarketToLimitOrderwhere
Self: ExecutionAlgorithmNative,
fn spawn_market_to_limit(
&mut self,
primary: &mut OrderAny,
quantity: Quantity,
time_in_force: TimeInForce,
expire_time: Option<UnixNanos>,
reduce_only: bool,
display_qty: Option<Quantity>,
emulation_trigger: Option<TriggerType>,
tags: Option<Vec<Ustr>>,
reduce_primary: bool,
) -> MarketToLimitOrderwhere
Self: ExecutionAlgorithmNative,
Spawns a market-to-limit order from a primary order. Read more
Source§fn reduce_primary_order(&mut self, primary: &mut OrderAny, spawn_qty: Quantity)where
Self: ExecutionAlgorithmNative,
fn reduce_primary_order(&mut self, primary: &mut OrderAny, spawn_qty: Quantity)where
Self: ExecutionAlgorithmNative,
Reduces the primary order’s quantity by the spawn quantity. Read more
Source§fn restore_primary_order_quantity(&mut self, order: &OrderAny)where
Self: ExecutionAlgorithmNative,
fn restore_primary_order_quantity(&mut self, order: &OrderAny)where
Self: ExecutionAlgorithmNative,
Restores the primary order quantity after a spawned order is denied or rejected. Read more
Source§fn submit_order(
&mut self,
order: OrderAny,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn submit_order(
&mut self,
order: OrderAny,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
Submits an order to the execution engine via the risk engine. Read more
Source§fn modify_order(
&mut self,
order: &mut OrderAny,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn modify_order(
&mut self,
order: &mut OrderAny,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
Modifies an order. Read more
Source§fn modify_order_in_place(
&mut self,
order: &mut OrderAny,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn modify_order_in_place(
&mut self,
order: &mut OrderAny,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
Modifies an INITIALIZED or RELEASED order in place without sending a command. Read more
Source§fn cancel_order(
&mut self,
order: &mut OrderAny,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn cancel_order(
&mut self,
order: &mut OrderAny,
client_id: Option<ClientId>,
) -> Result<()>where
Self: ExecutionAlgorithmNative,
Cancels an order. Read more
Source§fn subscribe_to_strategy_events(&mut self, strategy_id: StrategyId)
fn subscribe_to_strategy_events(&mut self, strategy_id: StrategyId)
Subscribes to events from a strategy. Read more
Source§fn unsubscribe_all_strategy_events(&mut self)where
Self: ExecutionAlgorithmNative,
fn unsubscribe_all_strategy_events(&mut self)where
Self: ExecutionAlgorithmNative,
Unsubscribes from all strategy event handlers. Read more
Source§fn handle_order_event(&mut self, event: OrderEventAny)where
Self: ExecutionAlgorithmNative,
fn handle_order_event(&mut self, event: OrderEventAny)where
Self: ExecutionAlgorithmNative,
Handles an order event, filtering for algorithm-owned orders.
Source§fn handle_position_event(&mut self, event: PositionEvent)where
Self: ExecutionAlgorithmNative,
fn handle_position_event(&mut self, event: PositionEvent)where
Self: ExecutionAlgorithmNative,
Handles a position event.
Source§fn on_start(&mut self) -> Result<()>where
Self: ExecutionAlgorithmNative,
fn on_start(&mut self) -> Result<()>where
Self: ExecutionAlgorithmNative,
Called when the algorithm is started. Read more
Source§fn on_order_initialized(&mut self, event: OrderInitialized)
fn on_order_initialized(&mut self, event: OrderInitialized)
Called when an order is initialized.
Source§fn on_order_denied(&mut self, event: OrderDenied)
fn on_order_denied(&mut self, event: OrderDenied)
Called when an order is denied.
Source§fn on_order_emulated(&mut self, event: OrderEmulated)
fn on_order_emulated(&mut self, event: OrderEmulated)
Called when an order is emulated.
Source§fn on_order_released(&mut self, event: OrderReleased)
fn on_order_released(&mut self, event: OrderReleased)
Called when an order is released from emulation.
Source§fn on_order_submitted(&mut self, event: OrderSubmitted)
fn on_order_submitted(&mut self, event: OrderSubmitted)
Called when an order is submitted.
Source§fn on_order_rejected(&mut self, event: OrderRejected)
fn on_order_rejected(&mut self, event: OrderRejected)
Called when an order is rejected.
Source§fn on_order_accepted(&mut self, event: OrderAccepted)
fn on_order_accepted(&mut self, event: OrderAccepted)
Called when an order is accepted.
Source§fn on_algo_order_canceled(&mut self, event: OrderCanceled)
fn on_algo_order_canceled(&mut self, event: OrderCanceled)
Called when an order is canceled.
Source§fn on_order_expired(&mut self, event: OrderExpired)
fn on_order_expired(&mut self, event: OrderExpired)
Called when an order expires.
Source§fn on_order_triggered(&mut self, event: OrderTriggered)
fn on_order_triggered(&mut self, event: OrderTriggered)
Called when an order is triggered.
Source§fn on_order_pending_update(&mut self, event: OrderPendingUpdate)
fn on_order_pending_update(&mut self, event: OrderPendingUpdate)
Called when an order modification is pending.
Source§fn on_order_pending_cancel(&mut self, event: OrderPendingCancel)
fn on_order_pending_cancel(&mut self, event: OrderPendingCancel)
Called when an order cancellation is pending.
Source§fn on_order_modify_rejected(&mut self, event: OrderModifyRejected)
fn on_order_modify_rejected(&mut self, event: OrderModifyRejected)
Called when an order modification is rejected.
Source§fn on_order_cancel_rejected(&mut self, event: OrderCancelRejected)
fn on_order_cancel_rejected(&mut self, event: OrderCancelRejected)
Called when an order cancellation is rejected.
Source§fn on_order_updated(&mut self, event: OrderUpdated)
fn on_order_updated(&mut self, event: OrderUpdated)
Called when an order is updated.
Source§fn on_algo_order_filled(&mut self, event: OrderFilled)
fn on_algo_order_filled(&mut self, event: OrderFilled)
Called when an order is filled.
Source§fn on_order_event(&mut self, event: OrderEventAny)
fn on_order_event(&mut self, event: OrderEventAny)
Called for any order event (after specific handler).
Source§fn on_position_opened(&mut self, event: PositionOpened)
fn on_position_opened(&mut self, event: PositionOpened)
Called when a position is opened.
Source§fn on_position_changed(&mut self, event: PositionChanged)
fn on_position_changed(&mut self, event: PositionChanged)
Called when a position is changed.
Source§fn on_position_closed(&mut self, event: PositionClosed)
fn on_position_closed(&mut self, event: PositionClosed)
Called when a position is closed.
Source§fn on_position_event(&mut self, event: PositionEvent)
fn on_position_event(&mut self, event: PositionEvent)
Called for any position event (after specific handler).
Source§impl ExecutionAlgorithmNative for TwapAlgorithm
impl ExecutionAlgorithmNative for TwapAlgorithm
Source§fn exec_algorithm_core(&self) -> &ExecutionAlgorithmCore
fn exec_algorithm_core(&self) -> &ExecutionAlgorithmCore
Returns the execution algorithm core.
Source§fn exec_algorithm_core_mut(&mut self) -> &mut ExecutionAlgorithmCore
fn exec_algorithm_core_mut(&mut self) -> &mut ExecutionAlgorithmCore
Returns the mutable execution algorithm core.
Auto Trait Implementations§
impl !RefUnwindSafe for TwapAlgorithm
impl !Send for TwapAlgorithm
impl !Sync for TwapAlgorithm
impl !UnwindSafe for TwapAlgorithm
impl Freeze for TwapAlgorithm
impl Unpin for TwapAlgorithm
impl UnsafeUnpin for TwapAlgorithm
Blanket Implementations§
Source§impl<T> Actor for T
impl<T> Actor for T
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Component for T
impl<T> Component for T
Source§fn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
Returns the unique identifier for this component.
Source§fn state(&self) -> ComponentState
fn state(&self) -> ComponentState
Returns the current state of the component.
Source§fn transition_state(&mut self, trigger: ComponentTrigger) -> Result<(), Error>
fn transition_state(&mut self, trigger: ComponentTrigger) -> Result<(), Error>
Transition the component with the state trigger. Read more
Source§fn register(
&mut self,
trader_id: TraderId,
clock: Rc<RefCell<dyn Clock>>,
cache: Rc<RefCell<Cache>>,
) -> Result<(), Error>
fn register( &mut self, trader_id: TraderId, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, ) -> Result<(), Error>
Registers the component with a system. Read more
Source§fn not_running(&self) -> bool
fn not_running(&self) -> bool
Returns whether the component is not running.
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Returns whether the component is running.
Source§fn is_stopped(&self) -> bool
fn is_stopped(&self) -> bool
Returns whether the component is stopped.
Source§fn is_degraded(&self) -> bool
fn is_degraded(&self) -> bool
Returns whether the component has been degraded.
Source§fn is_faulted(&self) -> bool
fn is_faulted(&self) -> bool
Returns whether the component has been faulted.
Source§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
Returns whether the component has been disposed.