pub struct StateStrategy { /* private fields */ }Expand description
Strategy with observable state lifecycle callbacks.
Implementations§
Source§impl StateStrategy
impl StateStrategy
Sourcepub fn new(
strategy_id: StrategyId,
control: TestCacheDatabaseControl,
state_save: IndexMap<String, Vec<u8>>,
) -> Self
pub fn new( strategy_id: StrategyId, control: TestCacheDatabaseControl, state_save: IndexMap<String, Vec<u8>>, ) -> Self
Creates a stateful strategy.
Sourcepub const fn with_fail_load(self) -> Self
pub const fn with_fail_load(self) -> Self
Configures the strategy load callback to fail.
Sourcepub const fn with_fail_save(self) -> Self
pub const fn with_fail_save(self) -> Self
Configures the strategy save callback to fail.
Sourcepub const fn with_fail_start(self) -> Self
pub const fn with_fail_start(self) -> Self
Configures the strategy start callback to fail.
Source§impl StateStrategy
impl StateStrategy
Trait Implementations§
Source§impl DataActor for StateStrategy
impl DataActor for StateStrategy
Source§fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<()>
fn on_load(&mut self, state: IndexMap<String, Vec<u8>>) -> Result<()>
Actions to be performed when the actor state is loaded. Read more
Source§fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>>
fn on_save(&self) -> Result<IndexMap<String, Vec<u8>>>
Actions to be performed when the actor state is saved. Read more
§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.
§fn is_registered(&self) -> boolwhere
Self: DataActorNative,
fn is_registered(&self) -> boolwhere
Self: DataActorNative,
Returns whether the actor is registered with a trader.
§fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>
fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>
Actions to be performed when receiving a time event. Read more
§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
§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
§fn on_queue_state(&mut self, event: &QueueStateChanged) -> Result<(), Error>
fn on_queue_state(&mut self, event: &QueueStateChanged) -> Result<(), Error>
Actions to be performed when receiving a queue state change. Read more
§fn on_socket_state(&mut self, event: &SocketStateChanged) -> Result<(), Error>
fn on_socket_state(&mut self, event: &SocketStateChanged) -> Result<(), Error>
Actions to be performed when receiving a socket state change. Read more
§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
§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
§fn on_book_depth(&mut self, depth: &OrderBookDepth10) -> Result<(), Error>
fn on_book_depth(&mut self, depth: &OrderBookDepth10) -> Result<(), Error>
Actions to be performed when receiving an order book depth10 snapshot. Read more
§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
§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
§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
§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
§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
§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
§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
§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
§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
§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
§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
§fn on_block(&mut self, block: &Block) -> Result<(), Error>
fn on_block(&mut self, block: &Block) -> Result<(), Error>
Actions to be performed when receiving a block. Read more
§fn on_pool(&mut self, pool: &Pool) -> Result<(), Error>
fn on_pool(&mut self, pool: &Pool) -> Result<(), Error>
Actions to be performed when receiving a pool. Read more
§fn on_pool_swap(&mut self, swap: &PoolSwap) -> Result<(), Error>
fn on_pool_swap(&mut self, swap: &PoolSwap) -> Result<(), Error>
Actions to be performed when receiving a pool swap. Read more
§fn on_pool_liquidity_update(
&mut self,
update: &PoolLiquidityUpdate,
) -> Result<(), Error>
fn on_pool_liquidity_update( &mut self, update: &PoolLiquidityUpdate, ) -> Result<(), Error>
Actions to be performed when receiving a pool liquidity update. Read more
§fn on_pool_fee_collect(&mut self, collect: &PoolFeeCollect) -> Result<(), Error>
fn on_pool_fee_collect(&mut self, collect: &PoolFeeCollect) -> Result<(), Error>
Actions to be performed when receiving a pool fee collect event. Read more
§fn on_pool_flash(&mut self, flash: &PoolFlash) -> Result<(), Error>
fn on_pool_flash(&mut self, flash: &PoolFlash) -> Result<(), Error>
Actions to be performed when receiving a pool flash event. Read more
§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 custom data. Read more
§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
§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
§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
§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
§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
§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
§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
§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
§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
§fn publish_data(&self, data_type: &DataType, data: &CustomData)where
Self: DataActorNative,
fn publish_data(&self, data_type: &DataType, data: &CustomData)where
Self: DataActorNative,
§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,
§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 more§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 more§fn handle_time_event(&mut self, event: &TimeEvent)where
Self: Component,
fn handle_time_event(&mut self, event: &TimeEvent)where
Self: Component,
Handles a received time event.
§fn handle_data(&mut self, data: &CustomData)where
Self: Component,
fn handle_data(&mut self, data: &CustomData)where
Self: Component,
Handles a received custom data point.
§fn handle_signal(&mut self, signal: &Signal)where
Self: Component,
fn handle_signal(&mut self, signal: &Signal)where
Self: Component,
Handles a received signal.
§fn handle_queue_state(&mut self, event: &QueueStateChanged)where
Self: Component,
fn handle_queue_state(&mut self, event: &QueueStateChanged)where
Self: Component,
Handles a received queue state change.
§fn handle_socket_state(&mut self, event: &SocketStateChanged)where
Self: Component,
fn handle_socket_state(&mut self, event: &SocketStateChanged)where
Self: Component,
Handles a received socket state change.
§fn handle_instrument(&mut self, instrument: &InstrumentAny)where
Self: Component,
fn handle_instrument(&mut self, instrument: &InstrumentAny)where
Self: Component,
Handles a received instrument.
§fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)where
Self: Component,
fn handle_book_deltas(&mut self, deltas: &OrderBookDeltas)where
Self: Component,
Handles received order book deltas.
§fn handle_book_depth(&mut self, depth: &OrderBookDepth10)where
Self: Component,
fn handle_book_depth(&mut self, depth: &OrderBookDepth10)where
Self: Component,
Handles a received order book depth10 snapshot.
§fn handle_book(&mut self, book: &OrderBook)where
Self: Component,
fn handle_book(&mut self, book: &OrderBook)where
Self: Component,
Handles a received order book reference.
§fn handle_quote(&mut self, quote: &QuoteTick)where
Self: DataActorNative + Component,
fn handle_quote(&mut self, quote: &QuoteTick)where
Self: DataActorNative + Component,
Handles a received quote.
§fn handle_trade(&mut self, trade: &TradeTick)where
Self: DataActorNative + Component,
fn handle_trade(&mut self, trade: &TradeTick)where
Self: DataActorNative + Component,
Handles a received trade.
§fn handle_bar(&mut self, bar: &Bar)where
Self: DataActorNative + Component,
fn handle_bar(&mut self, bar: &Bar)where
Self: DataActorNative + Component,
Handles a receiving bar.
§fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)where
Self: Component,
fn handle_mark_price(&mut self, mark_price: &MarkPriceUpdate)where
Self: Component,
Handles a received mark price update.
§fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)where
Self: Component,
fn handle_index_price(&mut self, index_price: &IndexPriceUpdate)where
Self: Component,
Handles a received index price update.
§fn handle_funding_rate(&mut self, funding_rate: &FundingRateUpdate)where
Self: Component,
fn handle_funding_rate(&mut self, funding_rate: &FundingRateUpdate)where
Self: Component,
Handles a received funding rate update.
§fn handle_option_greeks(&mut self, greeks: &OptionGreeks)where
Self: Component,
fn handle_option_greeks(&mut self, greeks: &OptionGreeks)where
Self: Component,
Handles a received option greeks update.
§fn handle_option_chain(&mut self, slice: &OptionChainSlice)where
Self: Component,
fn handle_option_chain(&mut self, slice: &OptionChainSlice)where
Self: Component,
Handles a received option chain slice snapshot.
§fn handle_instrument_status(&mut self, status: &InstrumentStatus)where
Self: Component,
fn handle_instrument_status(&mut self, status: &InstrumentStatus)where
Self: Component,
Handles a received instrument status.
§fn handle_instrument_close(&mut self, close: &InstrumentClose)where
Self: Component,
fn handle_instrument_close(&mut self, close: &InstrumentClose)where
Self: Component,
Handles a received instrument close.
§fn handle_block(&mut self, block: &Block)where
Self: Component,
fn handle_block(&mut self, block: &Block)where
Self: Component,
Handles a received block.
§fn handle_pool(&mut self, pool: &Pool)where
Self: Component,
fn handle_pool(&mut self, pool: &Pool)where
Self: Component,
Handles a received pool definition update.
§fn handle_pool_swap(&mut self, swap: &PoolSwap)where
Self: Component,
fn handle_pool_swap(&mut self, swap: &PoolSwap)where
Self: Component,
Handles a received pool swap.
§fn handle_pool_liquidity_update(&mut self, update: &PoolLiquidityUpdate)where
Self: Component,
fn handle_pool_liquidity_update(&mut self, update: &PoolLiquidityUpdate)where
Self: Component,
Handles a received pool liquidity update.
§fn handle_pool_fee_collect(&mut self, collect: &PoolFeeCollect)where
Self: Component,
fn handle_pool_fee_collect(&mut self, collect: &PoolFeeCollect)where
Self: Component,
Handles a received pool fee collect.
§fn handle_pool_flash(&mut self, flash: &PoolFlash)where
Self: Component,
fn handle_pool_flash(&mut self, flash: &PoolFlash)where
Self: Component,
Handles a received pool flash event.
§fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
fn handle_historical_data(&mut self, data: &(dyn Any + 'static))
Handles received historical data.
§fn handle_data_response(&mut self, resp: &CustomDataResponse)
fn handle_data_response(&mut self, resp: &CustomDataResponse)
Handles a data response.
§fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
fn handle_instrument_response(&mut self, resp: &InstrumentResponse)
Handles an instrument response.
§fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
fn handle_instruments_response(&mut self, resp: &InstrumentsResponse)
Handles an instruments response.
§fn handle_book_response(&mut self, resp: &BookResponse)
fn handle_book_response(&mut self, resp: &BookResponse)
Handles a book response.
§fn handle_book_deltas_response(&mut self, resp: &BookDeltasResponse)
fn handle_book_deltas_response(&mut self, resp: &BookDeltasResponse)
Handles a book deltas response.
§fn handle_book_depth_response(&mut self, resp: &BookDepthResponse)
fn handle_book_depth_response(&mut self, resp: &BookDepthResponse)
Handles a book depth response.
§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.
§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.
§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.
§fn handle_funding_rates_response(&mut self, resp: &FundingRatesResponse)
fn handle_funding_rates_response(&mut self, resp: &FundingRatesResponse)
Handles a funding rates response.
§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.§fn subscribe_signal(&mut self, name: &str, priority: Option<u32>)
fn subscribe_signal(&mut self, name: &str, priority: Option<u32>)
§fn subscribe_queue_state(&mut self, priority: Option<u32>)
fn subscribe_queue_state(&mut self, priority: Option<u32>)
Subscribes to [
QueueStateChanged] events. Read more§fn subscribe_socket_state(&mut self, priority: Option<u32>)
fn subscribe_socket_state(&mut self, priority: Option<u32>)
Subscribes to [
SocketStateChanged] events. Read more§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.§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.§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.§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>, )
§fn subscribe_book_depth10(
&mut self,
instrument_id: InstrumentId,
book_type: BookType,
client_id: Option<ClientId>,
managed: bool,
params: Option<Params>,
)
fn subscribe_book_depth10( &mut self, instrument_id: InstrumentId, book_type: BookType, client_id: Option<ClientId>, managed: bool, 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>,
)
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.§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.§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.§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.§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.§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.§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.§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.§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.§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>, )
§fn subscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
Block] data for the chain.§fn subscribe_pool(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_pool( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
Pool] definition updates for the AMM pool at the instrument_id.§fn subscribe_pool_swaps(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_pool_swaps( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
PoolSwap] data for the instrument_id.§fn subscribe_pool_liquidity_updates(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_pool_liquidity_updates( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
PoolLiquidityUpdate] data for the instrument_id.§fn subscribe_pool_fee_collects(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_pool_fee_collects( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
PoolFeeCollect] data for the instrument_id.§fn subscribe_pool_flash_events(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn subscribe_pool_flash_events( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribe to streaming [
PoolFlash] events for the given instrument_id.§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.§fn unsubscribe_signal(&mut self, name: &str)
fn unsubscribe_signal(&mut self, name: &str)
Unsubscribe from [
Signal] data by name.§fn unsubscribe_queue_state(&mut self)
fn unsubscribe_queue_state(&mut self)
Unsubscribes from [
QueueStateChanged] events.§fn unsubscribe_socket_state(&mut self)
fn unsubscribe_socket_state(&mut self)
Unsubscribes from [
SocketStateChanged] events.§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.§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.§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.§fn unsubscribe_book_depth10(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_book_depth10( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
OrderBookDepth10] data for the instrument_id.§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.§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.§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.§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.§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.§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.§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.§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.§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.§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.§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.§fn unsubscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
Block] data for the chain.§fn unsubscribe_pool(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_pool( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
Pool] definition updates for the AMM pool at the instrument_id.§fn unsubscribe_pool_swaps(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_pool_swaps( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
PoolSwap] data for the instrument_id.§fn unsubscribe_pool_liquidity_updates(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_pool_liquidity_updates( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
PoolLiquidityUpdate] data for the instrument_id.§fn unsubscribe_pool_fee_collects(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_pool_fee_collects( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
PoolFeeCollect] data for the instrument_id.§fn unsubscribe_pool_flash_events(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
fn unsubscribe_pool_flash_events( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribe from streaming [
PoolFlash] events for the given instrument_id.§fn request_data(
&mut self,
data_type: DataType,
client_id: ClientId,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZero<usize>>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_data( &mut self, data_type: DataType, client_id: ClientId, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, params: Option<Params>, ) -> Result<UUID4, Error>
Request historical custom data of the given
data_type. Read more§fn request_instrument(
&mut self,
instrument_id: InstrumentId,
start: Option<Timestamp>,
end: Option<Timestamp>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_instrument( &mut self, instrument_id: InstrumentId, start: Option<Timestamp>, end: Option<Timestamp>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
§fn request_instruments(
&mut self,
venue: Option<Venue>,
start: Option<Timestamp>,
end: Option<Timestamp>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_instruments( &mut self, venue: Option<Venue>, start: Option<Timestamp>, end: Option<Timestamp>, 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>
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_deltas(
&mut self,
instrument_id: InstrumentId,
start: Option<Timestamp>,
end: Option<Timestamp>,
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<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
§fn request_book_depth(
&mut self,
instrument_id: InstrumentId,
start: Option<Timestamp>,
end: Option<Timestamp>,
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<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, depth: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
§fn request_quotes(
&mut self,
instrument_id: InstrumentId,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_quotes( &mut self, instrument_id: InstrumentId, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
§fn request_trades(
&mut self,
instrument_id: InstrumentId,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_trades( &mut self, instrument_id: InstrumentId, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
§fn request_bars(
&mut self,
bar_type: BarType,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZero<usize>>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<UUID4, Error>
fn request_bars( &mut self, bar_type: BarType, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZero<usize>>, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<UUID4, Error>
Source§impl DataActorNative for StateStrategy
impl DataActorNative for StateStrategy
Source§impl Debug for StateStrategy
impl Debug for StateStrategy
Source§impl Strategy for StateStrategy
impl Strategy for StateStrategy
§fn external_order_claims(&self) -> Option<Vec<InstrumentId>>
fn external_order_claims(&self) -> Option<Vec<InstrumentId>>
Returns the external order claims for this strategy. Read more
§fn strategy_id(&self) -> Option<StrategyId>where
Self: StrategyNative,
fn strategy_id(&self) -> Option<StrategyId>where
Self: StrategyNative,
Returns the runtime strategy ID, when configured or registered.
§fn order(&self) -> OrderApi<'_>where
Self: StrategyNative,
fn order(&self) -> OrderApi<'_>where
Self: StrategyNative,
Returns the user-facing order creation API.
§fn portfolio(&self) -> PortfolioApi<'_>where
Self: StrategyNative,
fn portfolio(&self) -> PortfolioApi<'_>where
Self: StrategyNative,
Returns the user-facing portfolio read API.
§fn submit_order(
&mut self,
order: OrderAny,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn submit_order(
&mut self,
order: OrderAny,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Submits an order. Read more
§fn submit_order_list(
&mut self,
orders: Vec<OrderAny>,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn submit_order_list(
&mut self,
orders: Vec<OrderAny>,
position_id: Option<PositionId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Submits an order list. Read more
§fn modify_order(
&mut self,
client_order_id: ClientOrderId,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn modify_order(
&mut self,
client_order_id: ClientOrderId,
quantity: Option<Quantity>,
price: Option<Price>,
trigger_price: Option<Price>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Modifies an order. Read more
§fn modify_orders(
&mut self,
updates: Vec<(ClientOrderId, Option<Quantity>, Option<Price>, Option<Price>)>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn modify_orders(
&mut self,
updates: Vec<(ClientOrderId, Option<Quantity>, Option<Price>, Option<Price>)>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Batch modifies multiple orders for the same instrument. Read more
§fn cancel_order(
&mut self,
client_order_id: ClientOrderId,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn cancel_order(
&mut self,
client_order_id: ClientOrderId,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Cancels an order. Read more
§fn cancel_orders(
&mut self,
client_order_ids: Vec<ClientOrderId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn cancel_orders(
&mut self,
client_order_ids: Vec<ClientOrderId>,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Batch cancels multiple orders for the same instrument. Read more
§fn mark_order_pending_update(&mut self, order: &OrderAny) -> Result<bool, Error>where
Self: StrategyNative,
fn mark_order_pending_update(&mut self, order: &OrderAny) -> Result<bool, Error>where
Self: StrategyNative,
Marks an order as pending update locally before the modify command leaves the strategy. Read more
§fn mark_order_pending_cancel(&mut self, order: &OrderAny) -> Result<bool, Error>where
Self: StrategyNative,
fn mark_order_pending_cancel(&mut self, order: &OrderAny) -> Result<bool, Error>where
Self: StrategyNative,
Marks an order as pending cancel locally before the cancel command leaves the strategy. Read more
§fn generate_order_pending_update(
&mut self,
order: &OrderAny,
) -> OrderPendingUpdatewhere
Self: StrategyNative,
fn generate_order_pending_update(
&mut self,
order: &OrderAny,
) -> OrderPendingUpdatewhere
Self: StrategyNative,
Generates an
OrderPendingUpdate event for an order.§fn generate_order_pending_cancel(
&mut self,
order: &OrderAny,
) -> OrderPendingCancelwhere
Self: StrategyNative,
fn generate_order_pending_cancel(
&mut self,
order: &OrderAny,
) -> OrderPendingCancelwhere
Self: StrategyNative,
Generates an
OrderPendingCancel event for an order.§fn cancel_all_orders(
&mut self,
instrument_id: InstrumentId,
order_side: Option<OrderSide>,
client_id: Option<ClientId>,
strategy_only: bool,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn cancel_all_orders(
&mut self,
instrument_id: InstrumentId,
order_side: Option<OrderSide>,
client_id: Option<ClientId>,
strategy_only: bool,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Cancels all open orders for the given instrument. Read more
§fn close_position(
&mut self,
position: &Position,
client_id: Option<ClientId>,
tags: Option<Vec<Ustr>>,
time_in_force: Option<TimeInForce>,
reduce_only: Option<bool>,
quote_quantity: Option<bool>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn close_position(
&mut self,
position: &Position,
client_id: Option<ClientId>,
tags: Option<Vec<Ustr>>,
time_in_force: Option<TimeInForce>,
reduce_only: Option<bool>,
quote_quantity: Option<bool>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Closes a position by submitting a market order for the opposite side. Read more
§fn close_all_positions(
&mut self,
instrument_id: InstrumentId,
position_side: Option<PositionSide>,
client_id: Option<ClientId>,
tags: Option<Vec<Ustr>>,
time_in_force: Option<TimeInForce>,
reduce_only: Option<bool>,
quote_quantity: Option<bool>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn close_all_positions(
&mut self,
instrument_id: InstrumentId,
position_side: Option<PositionSide>,
client_id: Option<ClientId>,
tags: Option<Vec<Ustr>>,
time_in_force: Option<TimeInForce>,
reduce_only: Option<bool>,
quote_quantity: Option<bool>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Closes all open positions for the given instrument. Read more
§fn query_account(
&mut self,
account_id: AccountId,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn query_account(
&mut self,
account_id: AccountId,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Queries account state from the execution client. Read more
§fn query_order(
&mut self,
order: &OrderAny,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
fn query_order(
&mut self,
order: &OrderAny,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<(), Error>where
Self: StrategyNative,
Queries order state from the execution client. Read more
§fn handle_order_event(&mut self, event: OrderEventAny)where
Self: StrategyNative,
fn handle_order_event(&mut self, event: OrderEventAny)where
Self: StrategyNative,
Handles an order event, dispatching to the appropriate handler.
fn dispatch_manager_actions(&mut self, actions: Vec<OrderManagerAction>)where
Self: StrategyNative,
§fn handle_position_event(&mut self, event: PositionEvent)where
Self: StrategyNative,
fn handle_position_event(&mut self, event: PositionEvent)where
Self: StrategyNative,
Handles a position event, dispatching to the appropriate handler.
§fn on_start(&mut self) -> Result<(), Error>where
Self: StrategyNative,
fn on_start(&mut self) -> Result<(), Error>where
Self: StrategyNative,
Called when the strategy is started. Read more
§fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>where
Self: StrategyNative + Component,
fn on_time_event(&mut self, event: &TimeEvent) -> Result<(), Error>where
Self: StrategyNative + Component,
Routes a time event through the framework-managed strategy handlers when called directly. Read more
§fn on_order_initialized(&mut self, event: OrderInitialized)
fn on_order_initialized(&mut self, event: OrderInitialized)
Called when an order is initialized. Read more
§fn on_order_event(&mut self, event: OrderEventAny)
fn on_order_event(&mut self, event: OrderEventAny)
Called when any order event is received after the specific order handler runs. Read more
§fn on_order_denied(&mut self, event: OrderDenied)
fn on_order_denied(&mut self, event: OrderDenied)
Called when an order is denied by the system. Read more
§fn on_order_emulated(&mut self, event: OrderEmulated)
fn on_order_emulated(&mut self, event: OrderEmulated)
Called when an order is emulated. Read more
§fn on_order_released(&mut self, event: OrderReleased)
fn on_order_released(&mut self, event: OrderReleased)
Called when an order is released from emulation. Read more
§fn on_order_submitted(&mut self, event: OrderSubmitted)
fn on_order_submitted(&mut self, event: OrderSubmitted)
Called when an order is submitted to the venue. Read more
§fn on_order_rejected(&mut self, event: OrderRejected)
fn on_order_rejected(&mut self, event: OrderRejected)
Called when an order is rejected by the venue. Read more
§fn on_order_accepted(&mut self, event: OrderAccepted)
fn on_order_accepted(&mut self, event: OrderAccepted)
Called when an order is accepted by the venue. Read more
§fn on_order_expired(&mut self, event: OrderExpired)
fn on_order_expired(&mut self, event: OrderExpired)
Called when an order expires. Read more
§fn on_order_triggered(&mut self, event: OrderTriggered)
fn on_order_triggered(&mut self, event: OrderTriggered)
Called when an order is triggered. Read more
§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. Read more
§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. Read more
§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. Read more
§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. Read more
§fn on_order_updated(&mut self, event: OrderUpdated)
fn on_order_updated(&mut self, event: OrderUpdated)
Called when an order is updated. Read more
§fn on_order_canceled(&mut self, event: &OrderCanceled)
fn on_order_canceled(&mut self, event: &OrderCanceled)
Called when an order is canceled. Read more
§fn on_order_filled(&mut self, event: &OrderFilled)
fn on_order_filled(&mut self, event: &OrderFilled)
Called when an order is filled. Read more
§fn on_order_fill_voided(&mut self, event: &OrderFillVoided)
fn on_order_fill_voided(&mut self, event: &OrderFillVoided)
Called when an applied order fill is partly or fully voided.
§fn on_position_opened(&mut self, event: PositionOpened)
fn on_position_opened(&mut self, event: PositionOpened)
Called when a position is opened. Read more
§fn on_position_event(&mut self, event: PositionEvent)
fn on_position_event(&mut self, event: PositionEvent)
Called after a position opened, changed, or closed handler runs. Read more
§fn on_position_changed(&mut self, event: PositionChanged)
fn on_position_changed(&mut self, event: PositionChanged)
Called when a position is changed (quantity or price updated). Read more
§fn on_position_closed(&mut self, event: PositionClosed)
fn on_position_closed(&mut self, event: PositionClosed)
Called when a position is closed. Read more
§fn on_market_exit(&mut self)
fn on_market_exit(&mut self)
Called when a market exit has been initiated. Read more
§fn post_market_exit(&mut self)
fn post_market_exit(&mut self)
Called after a market exit has completed. Read more
§fn is_exiting(&self) -> boolwhere
Self: StrategyNative,
fn is_exiting(&self) -> boolwhere
Self: StrategyNative,
Returns whether the strategy is currently executing a market exit. Read more
§fn market_exit(&mut self) -> Result<(), Error>where
Self: StrategyNative,
fn market_exit(&mut self) -> Result<(), Error>where
Self: StrategyNative,
Initiates an iterative market exit for the strategy. Read more
§fn check_market_exit(&mut self, _event: TimeEvent)where
Self: StrategyNative + Component,
fn check_market_exit(&mut self, _event: TimeEvent)where
Self: StrategyNative + Component,
Checks if the market exit is complete and finalizes if so. Read more
§fn finalize_market_exit(&mut self)where
Self: StrategyNative + Component,
fn finalize_market_exit(&mut self)where
Self: StrategyNative + Component,
Finalizes the market exit process. Read more
§fn cancel_market_exit(&mut self)where
Self: StrategyNative,
fn cancel_market_exit(&mut self)where
Self: StrategyNative,
Cancels an active market exit without calling hooks. Read more
§fn stop(&mut self) -> boolwhere
Self: StrategyNative,
fn stop(&mut self) -> boolwhere
Self: StrategyNative,
Stops the strategy with optional managed stop behavior. Read more
§fn deny_order(&mut self, order: &OrderAny, reason: Ustr)where
Self: StrategyNative,
fn deny_order(&mut self, order: &OrderAny, reason: Ustr)where
Self: StrategyNative,
Denies an order by generating an
OrderDenied event. Read more§fn deny_order_list(&mut self, orders: &[OrderAny], reason: Ustr)where
Self: StrategyNative,
fn deny_order_list(&mut self, orders: &[OrderAny], reason: Ustr)where
Self: StrategyNative,
Denies all orders in an order list. Read more
§fn set_gtd_expiry(&mut self, order: &OrderAny) -> Result<(), Error>where
Self: StrategyNative,
fn set_gtd_expiry(&mut self, order: &OrderAny) -> Result<(), Error>where
Self: StrategyNative,
Sets a GTD expiry timer for an order. Read more
§fn cancel_gtd_expiry(&mut self, client_order_id: &ClientOrderId)where
Self: StrategyNative,
fn cancel_gtd_expiry(&mut self, client_order_id: &ClientOrderId)where
Self: StrategyNative,
Cancels a GTD expiry timer for an order.
§fn has_gtd_expiry_timer(&mut self, client_order_id: &ClientOrderId) -> boolwhere
Self: StrategyNative,
fn has_gtd_expiry_timer(&mut self, client_order_id: &ClientOrderId) -> boolwhere
Self: StrategyNative,
Checks if a GTD expiry timer exists for an order.
§fn expire_gtd_order(&mut self, event: TimeEvent)where
Self: StrategyNative,
fn expire_gtd_order(&mut self, event: TimeEvent)where
Self: StrategyNative,
Handles GTD order expiry by canceling the order. Read more
§fn reactivate_gtd_timers(&mut self)where
Self: StrategyNative,
fn reactivate_gtd_timers(&mut self)where
Self: StrategyNative,
Reactivates GTD timers for open orders on strategy start. Read more
Source§impl StrategyNative for StateStrategy
impl StrategyNative for StateStrategy
Source§fn strategy_core(&self) -> &StrategyCore
fn strategy_core(&self) -> &StrategyCore
Returns the strategy core.
Source§fn strategy_core_mut(&mut self) -> &mut StrategyCore
fn strategy_core_mut(&mut self) -> &mut StrategyCore
Returns the mutable strategy core.
§fn order_factory(&mut self) -> RefMut<'_, OrderFactory>
fn order_factory(&mut self) -> RefMut<'_, OrderFactory>
Returns a mutable borrow of the order factory. Read more
§fn order_factory_rc(&self) -> Rc<RefCell<OrderFactory>>
fn order_factory_rc(&self) -> Rc<RefCell<OrderFactory>>
Returns a clone of the reference-counted order factory. Read more
§fn portfolio_rc(&self) -> Rc<RefCell<Portfolio>>
fn portfolio_rc(&self) -> Rc<RefCell<Portfolio>>
Returns a clone of the reference-counted portfolio. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StateStrategy
impl !Send for StateStrategy
impl !Sync for StateStrategy
impl !UnwindSafe for StateStrategy
impl Freeze for StateStrategy
impl Unpin for StateStrategy
impl UnsafeUnpin for StateStrategy
Blanket Implementations§
§impl<T> Actor for Twhere
T: DataActor + DataActorNative + Debug + 'static,
impl<T> Actor for Twhere
T: DataActor + DataActorNative + Debug + 'static,
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
§impl<T> Component for Twhere
T: DataActor + DataActorNative + Debug + 'static,
impl<T> Component for Twhere
T: DataActor + DataActorNative + Debug + 'static,
§fn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
Returns the unique identifier for this component.
§fn release_subscriptions(&mut self)
fn release_subscriptions(&mut self)
Releases the message bus registrations this component installed. Read more
§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
§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
§fn not_running(&self) -> bool
fn not_running(&self) -> bool
Returns whether the component is not running.
§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Returns whether the component is running.
§fn is_stopped(&self) -> bool
fn is_stopped(&self) -> bool
Returns whether the component is stopped.
§fn is_degraded(&self) -> bool
fn is_degraded(&self) -> bool
Returns whether the component has been degraded.
§fn is_faulted(&self) -> bool
fn is_faulted(&self) -> bool
Returns whether the component has been faulted.
§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
Returns whether the component has been disposed.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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