pub struct ExecTesterConfig {Show 46 fields
pub base: StrategyConfig,
pub instrument_id: InstrumentId,
pub order_qty: Quantity,
pub order_display_qty: Option<Quantity>,
pub order_expire_time_delta_mins: Option<u64>,
pub order_params: Option<IndexMap<String, String>>,
pub client_id: Option<ClientId>,
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 enable_stop_buys: bool,
pub enable_stop_sells: bool,
pub tob_offset_ticks: u64,
pub stop_order_type: OrderType,
pub stop_offset_ticks: u64,
pub stop_limit_offset_ticks: Option<u64>,
pub stop_trigger_type: TriggerType,
pub enable_brackets: bool,
pub bracket_entry_order_type: OrderType,
pub bracket_offset_ticks: u64,
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 use_quote_quantity: bool,
pub emulation_trigger: Option<TriggerType>,
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 test_reject_post_only: bool,
pub test_reject_reduce_only: bool,
pub can_unsubscribe: bool,
}Expand description
Configuration for the execution tester strategy.
Fields§
§base: StrategyConfigBase strategy configuration.
instrument_id: InstrumentIdInstrument ID to test.
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).
order_params: Option<IndexMap<String, String>>Adapter-specific order parameters.
client_id: Option<ClientId>Client ID to use for orders and subscriptions.
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.
enable_stop_buys: boolEnable stop buy orders.
enable_stop_sells: boolEnable stop sell orders.
tob_offset_ticks: u64Offset from TOB in price ticks for limit 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.
enable_brackets: boolEnable bracket orders (entry with TP/SL).
bracket_entry_order_type: OrderTypeEntry order type for bracket orders.
bracket_offset_ticks: u64Offset in ticks for bracket TP/SL from entry price.
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.
use_quote_quantity: boolUse quote quantity for orders.
emulation_trigger: Option<TriggerType>Emulation trigger type for 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.
test_reject_post_only: boolTest post-only rejection by placing orders on wrong side of spread.
test_reject_reduce_only: boolTest reduce-only rejection by setting reduce_only on open position order.
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
pub fn with_enable_brackets(self, enable: bool) -> Self
pub fn with_bracket_entry_order_type(self, order_type: OrderType) -> Self
pub fn with_bracket_offset_ticks(self, ticks: u64) -> Self
pub fn with_test_reject_post_only(self, test: bool) -> Self
pub fn with_test_reject_reduce_only(self, test: bool) -> Self
pub fn with_emulation_trigger(self, trigger: Option<TriggerType>) -> Self
pub fn with_use_quote_quantity(self, use_quote: bool) -> Self
pub fn with_order_params(self, params: Option<IndexMap<String, String>>) -> Self
Trait Implementations§
Source§impl Clone for ExecTesterConfig
impl Clone for ExecTesterConfig
Source§fn clone(&self) -> ExecTesterConfig
fn clone(&self) -> ExecTesterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more