Skip to main content

ExecTesterConfig

Struct ExecTesterConfig 

Source
pub struct ExecTesterConfig {
Show 55 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 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_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,
}
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.

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

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 a [ConfigError] (a [ConfigError::Multiple] when more than one field is invalid) if any field fails validation.

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

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 DerefToPyAny for ExecTesterConfig

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<'a, 'py> FromPyObject<'a, 'py> for ExecTesterConfig
where Self: Clone,

Source§

type Error = PyClassGuardError<'a, 'py>

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

fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<Self, <Self as FromPyObject<'a, 'py>>::Error>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<'py> IntoPyObject<'py> for ExecTesterConfig

Source§

type Target = ExecTesterConfig

The Python output type
Source§

type Output = Bound<'py, <ExecTesterConfig as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

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

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for ExecTesterConfig

Source§

const NAME: &str = "ExecTesterConfig"

Name of the class. Read more
Source§

type Frozen = False

Whether the pyclass is frozen. Read more
Source§

impl PyClassImpl for ExecTesterConfig

Source§

const MODULE: Option<&str>

Module which the class will be associated with. Read more
Source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
Source§

const IS_IMMUTABLE_TYPE: bool = false

#[pyclass(immutable_type)]
Source§

const RAW_DOC: &'static CStr = /// Configuration for the execution tester strategy.

Docstring for the class provided on the struct or enum. Read more
Source§

const DOC: &'static CStr

Fully rendered class doc, including the text_signature if a constructor is defined. Read more
Source§

type Layout = <<ExecTesterConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<ExecTesterConfig>

Description of how this class is laid out in memory
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = NoopThreadChecker

This handles following two situations: Read more
Source§

type Inventory = Pyo3MethodsInventoryForExecTesterConfig

Source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

fn items_iter() -> PyClassItemsIter

Source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<PyObjectOffset>

Used to provide the dictoffset slot (equivalent to tp_dictoffset)
§

fn weaklist_offset() -> Option<PyObjectOffset>

Used to provide the weaklistoffset slot (equivalent to tp_weaklistoffset
Source§

impl PyClassNewTextSignature for ExecTesterConfig

Source§

const TEXT_SIGNATURE: &'static str = "(strategy_id=None, order_id_tag=None, use_hyphens_in_client_order_ids=None, external_order_claims=None, instrument_id=None, client_id=None, order_qty=None, subscribe_book=None, subscribe_quotes=None, subscribe_trades=None, open_position_on_start_qty=None, open_position_on_first_quote=None, open_position_time_in_force=None, enable_limit_buys=None, enable_limit_sells=None, enable_stop_buys=None, enable_stop_sells=None, tob_offset_ticks=None, limit_time_in_force=None, use_post_only=None, limit_aggressive=None, cancel_orders_on_stop=None, close_positions_on_stop=None, close_positions_time_in_force=None, reduce_only_on_stop=None, dry_run=None, log_data=None, can_unsubscribe=None, clamp_to_instrument_price_range=None, log_events=None, log_commands=None)"

Source§

impl PyStubType for ExecTesterConfig

Source§

fn type_output() -> TypeInfo

The type to be used in the output signature, i.e. return type of the Python function or methods.
§

fn type_input() -> TypeInfo

The type to be used in the input signature, i.e. the arguments of the Python function or methods. Read more
Source§

impl PyTypeInfo for ExecTesterConfig

Source§

const NAME: &str = <Self as ::pyo3::PyClass>::NAME

👎Deprecated since 0.28.0:

prefer using ::type_object(py).name() to get the correct runtime value

Class name.
Source§

const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE

👎Deprecated since 0.28.0:

prefer using ::type_object(py).module() to get the correct runtime value

Module name, if any.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
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§

§

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
§

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

§

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.

§

impl<'py, T> FromPyObjectOwned<'py> for T
where T: for<'a> FromPyObject<'a, 'py>,

§

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
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> 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<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

§

fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>

Converts self into an owned Python object, dropping type information.
§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
§

impl<'py, T> IntoPyObjectNautilusExt<'py> for T
where T: IntoPyObjectExt<'py>,

§

fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>

Convert self into a [Py<PyAny>] while panicking if the conversion fails. Read more
§

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

§

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
§

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
§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
§

fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>

Returns the expected type as a possible argument for the isinstance and issubclass function. Read more
§

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 = Infallible

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

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

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

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

§

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