Skip to main content

ExecTesterConfig

Struct ExecTesterConfig 

Source
pub struct ExecTesterConfig {
Show 59 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<Params>, pub client_id: Option<ClientId>, pub subscribe_book: bool, pub subscribe_quotes: bool, pub subscribe_trades: bool, pub book_type: BookType, pub book_depth: Option<usize>, pub book_interval_ms: usize, pub book_levels_to_print: usize, pub open_position_on_start_qty: Option<Decimal>, pub open_position_on_first_quote: bool, 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 limit_time_in_force: Option<TimeInForce>, pub stop_order_type: OrderType, pub stop_offset_ticks: u64, pub stop_limit_offset_ticks: Option<u64>, pub stop_trigger_type: TriggerType, pub stop_time_in_force: Option<TimeInForce>, pub trailing_offset: Option<Decimal>, pub trailing_offset_type: TrailingOffsetType, pub enable_brackets: bool, pub batch_submit_limit_pair: 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 trigger_limit_order_maintenance_once: bool, pub use_post_only: bool, pub limit_aggressive: 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_qty_precision: Option<u8>, 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 test_modify_rejected: bool, pub can_unsubscribe: bool, pub clamp_to_instrument_price_range: bool, pub bracket_contingency_type: ContingencyType, pub bracket_tp_order_type: OrderType,
}
Expand description

Configuration for the execution tester strategy.

Fields§

§base: StrategyConfig

Base strategy configuration.

§instrument_id: InstrumentId

Instrument ID to test.

§order_qty: Quantity

Order 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<Params>

Adapter-specific order parameters.

§client_id: Option<ClientId>

Client ID to use for orders and subscriptions.

§subscribe_book: bool

Whether to subscribe to order book.

§subscribe_quotes: bool

Whether to subscribe to quotes.

§subscribe_trades: bool

Whether to subscribe to trades.

§book_type: BookType

Book type for order book subscriptions.

§book_depth: Option<usize>

Order book depth for subscriptions.

§book_interval_ms: usize

Order book interval in milliseconds.

§book_levels_to_print: usize

Number 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_on_first_quote: bool

Delay opening the start position until the first quote arrives.

§open_position_time_in_force: TimeInForce

Time in force for opening position order.

§enable_limit_buys: bool

Enable limit buy orders.

§enable_limit_sells: bool

Enable limit sell orders.

§enable_stop_buys: bool

Enable stop buy orders.

§enable_stop_sells: bool

Enable stop sell orders.

§tob_offset_ticks: u64

Offset from TOB in price ticks for limit orders.

§limit_time_in_force: Option<TimeInForce>

Override time in force for limit orders (None uses GTC/GTD logic).

§stop_order_type: OrderType

Type of stop order (STOP_MARKET, STOP_LIMIT, MARKET_IF_TOUCHED, LIMIT_IF_TOUCHED).

§stop_offset_ticks: u64

Offset 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: TriggerType

Trigger type for stop orders.

§stop_time_in_force: Option<TimeInForce>

Override time in force for stop orders (None uses GTC/GTD logic).

§trailing_offset: Option<Decimal>

Trailing offset for TRAILING_STOP_MARKET orders.

§trailing_offset_type: TrailingOffsetType

Trailing offset type (BasisPoints or Price).

§enable_brackets: bool

Enable bracket orders (entry with TP/SL).

§batch_submit_limit_pair: bool

Submit limit buy and sell as an order list instead of individual orders.

§bracket_entry_order_type: OrderType

Entry order type for bracket orders.

§bracket_offset_ticks: u64

Offset in ticks for bracket TP/SL from entry price.

§modify_orders_to_maintain_tob_offset: bool

Modify limit orders to maintain TOB offset.

§modify_stop_orders_to_maintain_offset: bool

Modify stop orders to maintain offset.

§cancel_replace_orders_to_maintain_tob_offset: bool

Cancel and replace limit orders to maintain TOB offset.

§cancel_replace_stop_orders_to_maintain_offset: bool

Cancel and replace stop orders to maintain offset.

§trigger_limit_order_maintenance_once: bool

Trigger one modify or cancel-replace when each enabled limit side is first accepted. Combine with exactly one limit-order maintenance mode (TC-E30 to TC-E33).

§use_post_only: bool

Use post-only for limit orders.

§limit_aggressive: bool

Place limit orders at marketable prices (cross the spread). Combined with limit_time_in_force = Ioc/Fok, exercises aggressive-fill (TC-E13, TC-E15) and passive-no-fill (TC-E14, TC-E16) scenarios when inverted with the standard passive offset.

§use_quote_quantity: bool

Use quote quantity for orders.

§emulation_trigger: Option<TriggerType>

Emulation trigger type for orders.

§cancel_orders_on_stop: bool

Cancel all orders on stop.

§close_positions_on_stop: bool

Close all positions on stop.

§close_positions_qty_precision: Option<u8>

Truncate close-on-stop quantities to this decimal precision.

§close_positions_time_in_force: Option<TimeInForce>

Time in force for closing positions (None defaults to GTC).

§reduce_only_on_stop: bool

Use reduce_only when closing positions.

§use_individual_cancels_on_stop: bool

Use individual cancel commands instead of cancel_all.

§use_batch_cancel_on_stop: bool

Use batch cancel command when stopping.

§dry_run: bool

Dry run mode (no order submission).

§log_data: bool

Log received data.

§test_reject_post_only: bool

Test post-only rejection by placing orders on wrong side of spread.

§test_reject_reduce_only: bool

Test reduce-only rejection by setting reduce_only on open position order.

§test_modify_rejected: bool

Programmatically attempt one strategy-wide modify against the next accepted limit order (whichever side acks first) to exercise the adapter’s modify-rejection path (TC-E36). Independent of modify_orders_to_maintain_tob_offset, which only fires on price drift. Not honored when batch_submit_limit_pair is true; combine with individual buy/sell maintenance instead.

§can_unsubscribe: bool

Whether unsubscribe is supported on stop.

§clamp_to_instrument_price_range: bool

Clamp computed prices to the instrument’s [min_price, max_price] before submit.

§bracket_contingency_type: ContingencyType

OCO or OUO relationship between bracket exit orders.

§bracket_tp_order_type: OrderType

Take-profit order type (LIMIT, MARKET_IF_TOUCHED, or LIMIT_IF_TOUCHED).

Implementations§

Source§

impl ExecTesterConfig

Source

pub fn builder() -> ExecTesterConfigBuilder

Create an instance of ExecTesterConfig using the builder syntax

Source§

impl ExecTesterConfig

Source

pub fn validate(&self) -> ConfigResult<()>

Validates the execution tester configuration, collecting every field violation.

§Errors

Returns an error if any field fails validation. Multiple validation failures are collected into one error.

Source

pub fn new( strategy_id: StrategyId, instrument_id: InstrumentId, client_id: ClientId, order_qty: Quantity, ) -> Self

Creates a new ExecTesterConfig with minimal settings.

Trait Implementations§

Source§

impl Clone for ExecTesterConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecTesterConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExecTesterConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ExecTesterConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ExecTesterConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more