ExecTesterConfig

Struct ExecTesterConfig 

Source
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: StrategyConfig

Base strategy configuration.

§instrument_id: InstrumentId

Instrument ID to test.

§client_id: Option<ClientId>

Client ID to use for orders and subscriptions.

§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).

§subscribe_quotes: bool

Whether to subscribe to quotes.

§subscribe_trades: bool

Whether to subscribe to trades.

§subscribe_book: bool

Whether to subscribe to order book.

§book_type: BookType

Book type for order book subscriptions.

§book_depth: Option<NonZeroUsize>

Order book depth for subscriptions.

§book_interval_ms: NonZeroUsize

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_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.

§tob_offset_ticks: u64

Offset from TOB in price ticks for limit orders.

§enable_stop_buys: bool

Enable stop buy orders.

§enable_stop_sells: bool

Enable stop sell orders.

§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.

§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.

§use_post_only: bool

Use post-only for limit orders.

§cancel_orders_on_stop: bool

Cancel all orders on stop.

§close_positions_on_stop: bool

Close 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: 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.

§can_unsubscribe: bool

Whether unsubscribe is supported on stop.

Implementations§

Source§

impl ExecTesterConfig

Source

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).

Source

pub fn with_log_data(self, log_data: bool) -> Self

Source

pub fn with_dry_run(self, dry_run: bool) -> Self

Source

pub fn with_subscribe_quotes(self, subscribe: bool) -> Self

Source

pub fn with_subscribe_trades(self, subscribe: bool) -> Self

Source

pub fn with_subscribe_book(self, subscribe: bool) -> Self

Source

pub fn with_book_type(self, book_type: BookType) -> Self

Source

pub fn with_book_depth(self, depth: Option<NonZeroUsize>) -> Self

Source

pub fn with_enable_limit_buys(self, enable: bool) -> Self

Source

pub fn with_enable_limit_sells(self, enable: bool) -> Self

Source

pub fn with_enable_stop_buys(self, enable: bool) -> Self

Source

pub fn with_enable_stop_sells(self, enable: bool) -> Self

Source

pub fn with_tob_offset_ticks(self, ticks: u64) -> Self

Source

pub fn with_stop_order_type(self, order_type: OrderType) -> Self

Source

pub fn with_stop_offset_ticks(self, ticks: u64) -> Self

Source

pub fn with_use_post_only(self, use_post_only: bool) -> Self

Source

pub fn with_open_position_on_start(self, qty: Option<Decimal>) -> Self

Source

pub fn with_cancel_orders_on_stop(self, cancel: bool) -> Self

Source

pub fn with_close_positions_on_stop(self, close: bool) -> Self

Source

pub fn with_close_positions_time_in_force( self, time_in_force: Option<TimeInForce>, ) -> Self

Source

pub fn with_use_batch_cancel_on_stop(self, use_batch: bool) -> Self

Source

pub fn with_can_unsubscribe(self, can_unsubscribe: bool) -> Self

Trait Implementations§

Source§

impl Clone for ExecTesterConfig

Source§

fn clone(&self) -> ExecTesterConfig

Returns a duplicate of the value. Read more
1.0.0§

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

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

impl<T> Ungil for T
where T: Send,