pub struct ExecTesterConfig {Show 38 fields
pub base: StrategyConfig,
pub instrument_id: InstrumentId,
pub client_id: Option<ClientId>,
pub order_qty: Quantity,
pub order_display_qty: Option<Quantity>,
pub order_expire_time_delta_mins: Option<u64>,
pub subscribe_quotes: bool,
pub subscribe_trades: bool,
pub subscribe_book: bool,
pub book_type: BookType,
pub book_depth: Option<NonZeroUsize>,
pub book_interval_ms: NonZeroUsize,
pub book_levels_to_print: usize,
pub open_position_on_start_qty: Option<Decimal>,
pub open_position_time_in_force: TimeInForce,
pub enable_limit_buys: bool,
pub enable_limit_sells: bool,
pub tob_offset_ticks: u64,
pub enable_stop_buys: bool,
pub enable_stop_sells: bool,
pub stop_order_type: OrderType,
pub stop_offset_ticks: u64,
pub stop_limit_offset_ticks: Option<u64>,
pub stop_trigger_type: TriggerType,
pub modify_orders_to_maintain_tob_offset: bool,
pub modify_stop_orders_to_maintain_offset: bool,
pub cancel_replace_orders_to_maintain_tob_offset: bool,
pub cancel_replace_stop_orders_to_maintain_offset: bool,
pub use_post_only: bool,
pub cancel_orders_on_stop: bool,
pub close_positions_on_stop: bool,
pub close_positions_time_in_force: Option<TimeInForce>,
pub reduce_only_on_stop: bool,
pub use_individual_cancels_on_stop: bool,
pub use_batch_cancel_on_stop: bool,
pub dry_run: bool,
pub log_data: bool,
pub can_unsubscribe: bool,
}Expand description
Configuration for the execution tester strategy.
Fields§
§base: StrategyConfigBase strategy configuration.
instrument_id: InstrumentIdInstrument ID to test.
client_id: Option<ClientId>Client ID to use for orders and subscriptions.
order_qty: QuantityOrder quantity.
order_display_qty: Option<Quantity>Display quantity for iceberg orders (None for full display, Some(0) for hidden).
order_expire_time_delta_mins: Option<u64>Minutes until GTD orders expire (None for GTC).
subscribe_quotes: boolWhether to subscribe to quotes.
subscribe_trades: boolWhether to subscribe to trades.
subscribe_book: boolWhether to subscribe to order book.
book_type: BookTypeBook type for order book subscriptions.
book_depth: Option<NonZeroUsize>Order book depth for subscriptions.
book_interval_ms: NonZeroUsizeOrder book interval in milliseconds.
book_levels_to_print: usizeNumber of order book levels to print when logging.
open_position_on_start_qty: Option<Decimal>Quantity to open position on start (positive for buy, negative for sell).
open_position_time_in_force: TimeInForceTime in force for opening position order.
enable_limit_buys: boolEnable limit buy orders.
enable_limit_sells: boolEnable limit sell orders.
tob_offset_ticks: u64Offset from TOB in price ticks for limit orders.
enable_stop_buys: boolEnable stop buy orders.
enable_stop_sells: boolEnable stop sell orders.
stop_order_type: OrderTypeType of stop order (STOP_MARKET, STOP_LIMIT, MARKET_IF_TOUCHED, LIMIT_IF_TOUCHED).
stop_offset_ticks: u64Offset from market in price ticks for stop trigger.
stop_limit_offset_ticks: Option<u64>Offset from trigger price in ticks for stop limit price.
stop_trigger_type: TriggerTypeTrigger type for stop orders.
modify_orders_to_maintain_tob_offset: boolModify limit orders to maintain TOB offset.
modify_stop_orders_to_maintain_offset: boolModify stop orders to maintain offset.
cancel_replace_orders_to_maintain_tob_offset: boolCancel and replace limit orders to maintain TOB offset.
cancel_replace_stop_orders_to_maintain_offset: boolCancel and replace stop orders to maintain offset.
use_post_only: boolUse post-only for limit orders.
cancel_orders_on_stop: boolCancel all orders on stop.
close_positions_on_stop: boolClose all positions on stop.
close_positions_time_in_force: Option<TimeInForce>Time in force for closing positions (None defaults to GTC).
reduce_only_on_stop: boolUse reduce_only when closing positions.
use_individual_cancels_on_stop: boolUse individual cancel commands instead of cancel_all.
use_batch_cancel_on_stop: boolUse batch cancel command when stopping.
dry_run: boolDry run mode (no order submission).
log_data: boolLog received data.
can_unsubscribe: boolWhether unsubscribe is supported on stop.
Implementations§
Source§impl ExecTesterConfig
impl ExecTesterConfig
Sourcepub fn new(
strategy_id: StrategyId,
instrument_id: InstrumentId,
client_id: ClientId,
order_qty: Quantity,
) -> Self
pub fn new( strategy_id: StrategyId, instrument_id: InstrumentId, client_id: ClientId, order_qty: Quantity, ) -> Self
Creates a new ExecTesterConfig with minimal settings.
§Panics
Panics if NonZeroUsize::new(1000) fails (which should never happen).
pub fn with_log_data(self, log_data: bool) -> Self
pub fn with_dry_run(self, dry_run: bool) -> Self
pub fn with_subscribe_quotes(self, subscribe: bool) -> Self
pub fn with_subscribe_trades(self, subscribe: bool) -> Self
pub fn with_subscribe_book(self, subscribe: bool) -> Self
pub fn with_book_type(self, book_type: BookType) -> Self
pub fn with_book_depth(self, depth: Option<NonZeroUsize>) -> Self
pub fn with_enable_limit_buys(self, enable: bool) -> Self
pub fn with_enable_limit_sells(self, enable: bool) -> Self
pub fn with_enable_stop_buys(self, enable: bool) -> Self
pub fn with_enable_stop_sells(self, enable: bool) -> Self
pub fn with_tob_offset_ticks(self, ticks: u64) -> Self
pub fn with_stop_order_type(self, order_type: OrderType) -> Self
pub fn with_stop_offset_ticks(self, ticks: u64) -> Self
pub fn with_use_post_only(self, use_post_only: bool) -> Self
pub fn with_open_position_on_start(self, qty: Option<Decimal>) -> Self
pub fn with_cancel_orders_on_stop(self, cancel: bool) -> Self
pub fn with_close_positions_on_stop(self, close: bool) -> Self
pub fn with_close_positions_time_in_force( self, time_in_force: Option<TimeInForce>, ) -> Self
pub fn with_use_batch_cancel_on_stop(self, use_batch: bool) -> Self
pub fn with_can_unsubscribe(self, can_unsubscribe: bool) -> Self
Trait Implementations§
Source§impl Clone for ExecTesterConfig
impl Clone for ExecTesterConfig
Source§fn clone(&self) -> ExecTesterConfig
fn clone(&self) -> ExecTesterConfig
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecTesterConfig
impl Debug for ExecTesterConfig
Auto Trait Implementations§
impl Freeze for ExecTesterConfig
impl RefUnwindSafe for ExecTesterConfig
impl Send for ExecTesterConfig
impl Sync for ExecTesterConfig
impl Unpin for ExecTesterConfig
impl UnwindSafe for ExecTesterConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more