Skip to content

Latest commit

 

History

History
2401 lines (1964 loc) · 116 KB

spec_exec_testing.md

File metadata and controls

2401 lines (1964 loc) · 116 KB

Execution Testing Spec

Use this test matrix to validate adapter execution functionality with the Rust ExecTester strategy. Python exposes it as a built-in strategy configured through nautilus_trader.testkit.ExecTesterConfig. Rust code imports it from nautilus_testkit::testers. Cases use prefixed IDs (for example, TC-E01) and are grouped by functionality.

Each adapter must pass the subset of tests matching its supported capabilities.

Tests progress from simple (single market order) to complex (brackets, modification chains, rejection handling). An adapter that passes groups 1-5 is considered baseline compliant. Data connectivity should be verified first using the Data Testing Spec.

Document adapter-specific behavior (how a venue simulates market orders, handles TIF options, etc.) in the adapter's own guide, not here. Each adapter guide should include a capability matrix showing which order types, time-in-force options, actions, and flags it supports.

Prerequisites

Before running execution tests:

  • Demo/testnet account with valid API credentials (preferred, not required).
  • Account funded with sufficient margin for the test instrument and quantities.
  • Target instrument available and loadable via the instrument provider.
  • Environment variables set: {VENUE}_API_KEY, {VENUE}_API_SECRET (or sandbox variants).
  • If the venue offers a demo/testnet mode, use credentials created for that environment. Demo and production API keys are typically separate and not interchangeable. Using the wrong credentials produces authentication errors (e.g. HTTP 401).
  • Risk engine bypassed (LiveRiskEngineConfig(bypass=True)) to avoid interference.
  • Reconciliation enabled to verify state consistency.

Python node setup:

Use nautilus_trader.live.LiveNode. Call LiveNode.builder(...) when you need to register adapter client factories before the node is built.

from nautilus_trader.common import Environment
from nautilus_trader.config import LiveExecutionEngineConfig
from nautilus_trader.config import LiveRiskEngineConfig
from nautilus_trader.live import LiveNode
from nautilus_trader.model import TraderId
from nautilus_trader.testkit import ExecTesterConfig

node = (
    LiveNode.builder("TESTER-001", TraderId("TESTER-001"), Environment.SANDBOX)
    .with_risk_engine_config(LiveRiskEngineConfig(bypass=True))
    .with_exec_engine_config(LiveExecutionEngineConfig(reconciliation=True))
    .add_exec_client(None, adapter_exec_client_factory, exec_client_config)
    .build()
)

tester_config = ExecTesterConfig(
    instrument_id=instrument_id,
    client_id=client_id,
    order_qty=order_qty,
)
node.add_builtin_strategy("ExecTester", tester_config)
# Register remaining components, then start or run

Rust node setup (reference: crates/adapters/{adapter}/examples/node_exec_tester.rs):

use nautilus_testkit::testers::{ExecTester, ExecTesterConfig};
use nautilus_trading::strategy::StrategyConfig;

let tester_config = ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(order_qty)
    .build()?;
let tester = ExecTester::new(tester_config);
node.add_strategy(tester)?;
node.run().await?;

Timestamp scale

Nautilus stores ts_event and ts_init as Unix nanoseconds (UnixNanos). Every execution message must use that scale: order events, fills, account state, and reconciliation reports (OrderStatusReport, FillReport, PositionStatusReport, ExecutionMassStatus).

  • A value below 10^16 is not a plausible Unix-nanosecond timestamp (10^16 ns is about 116 days after 1970-01-01) and usually means the adapter left the venue scale unconverted.
  • Second-precision venue times that were converted correctly end in 000000000 and still pass: that is coarse precision, not a scale error.
  • Live stream ts_event should be near wall-clock time for the session. Reconciliation reports may be older and still valid if the scale is nanoseconds.
  • ts_init is the local clock when Nautilus created the object. Small ts_event > ts_init skew is possible when the venue clock is ahead.

ExecTester warns when received market-data or order-event timestamps fail the scale check. Inspect report timestamps on the reports themselves. Treat a scale warning or leftover seconds, milliseconds, or microseconds on any execution message as a failure.

Basic smoke test

A quick sanity check that can run at any time, for example after adapter changes or between development iterations. The tester opens a position with a market order on start, places a buy and sell post-only limit order, waits 30 seconds, then stops (cancelling open orders and closing the position).

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.001"),
    open_position_on_start_qty=Decimal("0.001"),
    enable_limit_buys=True,
    enable_limit_sells=True,
    use_post_only=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.001"))
    .open_position_on_start_qty(dec!(0.001))
    .enable_limit_buys(true)
    .enable_limit_sells(true)
    .use_post_only(true)
    .build()?

Expected behavior:

  1. On start: market order fills, opening a position.
  2. Two limit orders placed at tob_offset_ticks away from best bid/ask (default 500 ticks).
  3. Strategy idles for 30 seconds. Check logs for errors, rejected orders, or disconnections.
  4. On stop: open limit orders cancelled, position closed with a market order.

Pass criteria: No errors in logs, position opened and closed cleanly, and limit orders acknowledged by the venue.


Each group below begins with a summary table, followed by detailed test cards. Test IDs use spaced numbering to allow insertion without renumbering.


Group 1: Market orders

Test market order submission and fills. Market orders should execute immediately.

TC Name Description Skip when
TC-E01 Market BUY - submit and fill Open long position via market buy. No market orders.
TC-E02 Market SELL - submit and fill Open short position via market sell. No market orders.
TC-E03 Market order with IOC TIF Market order explicitly using IOC time in force. No IOC.
TC-E04 Market order with FOK TIF Market order explicitly using FOK time in force. No FOK.
TC-E05 Market order with quote qty Market order using quote currency quantity. No quote quantity.
TC-E06 Close position via market Close an open position with a market order on stop. No market orders.

TC-E01: Market BUY - submit and fill

Field Value
Prerequisite Adapter connected, instrument loaded, market data flowing, no open position.
Action ExecTester opens a long position via open_position_on_start_qty.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Position opened with side=LONG, quantity matches config, fill price within market range, AccountState updated.
Skip when Adapter does not support market orders.

Considerations:

  • Some adapters simulate market orders as aggressive limit IOC orders (check adapter guide).
  • The event sequence from the strategy's perspective should be identical regardless of the venue mechanism.
  • Fill price should be within the recent bid/ask spread.
  • Partial fills are valid. Verify the cumulative filled quantity matches the order quantity.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

TC-E02: Market SELL - submit and fill

Field Value
Prerequisite Adapter connected, instrument loaded, market data flowing, no open position.
Action ExecTester opens a short position via negative open_position_on_start_qty.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Position opened with side=SHORT, quantity matches config, fill price within market range.
Skip when Adapter does not support market orders or short selling.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("-0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(-1, 2))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

TC-E03: Market order with IOC TIF

Field Value
Prerequisite Adapter connected, instrument loaded, market data flowing.
Action Open position with open_position_time_in_force=IOC.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Same as TC-E01. The IOC TIF is explicitly set on the order.
Skip when No IOC support.

Considerations:

  • Some adapters simulate market orders as aggressive limit IOC. An unfilled simulated market maps to OrderCanceled, not OrderRejected.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    open_position_time_in_force=TimeInForce.IOC,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .open_position_time_in_force(TimeInForce::Ioc)
    .build()?

TC-E04: Market order with FOK TIF

Field Value
Prerequisite Adapter connected, instrument loaded, market data flowing.
Action Open position with open_position_time_in_force=FOK.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Same as TC-E01. The FOK TIF is explicitly set on the order.
Skip when No FOK support.

Considerations:

  • FOK requires the entire quantity to be fillable immediately or the order is canceled.
  • Use small test quantities so book depth is sufficient for a complete fill.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    open_position_time_in_force=TimeInForce.FOK,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .open_position_time_in_force(TimeInForce::Fok)
    .build()?

TC-E05: Market order with quote quantity

Field Value
Prerequisite Adapter connected, instrument loaded, adapter supports quote quantity.
Action Open position with use_quote_quantity=True, quantity in quote currency.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Order submitted with quote currency quantity. Fill quantity is in base currency.
Skip when Adapter does not support quote quantity orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("100.0"),  # Quote currency amount
    open_position_on_start_qty=Decimal("100.0"),
    use_quote_quantity=True,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("100"))
    .open_position_on_start_qty(Decimal::from(100))
    .use_quote_quantity(true)
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

TC-E06: Close position via market order on stop

Field Value
Prerequisite Open position from TC-E01 or TC-E02.
Action Stop the strategy. ExecTester closes position via market order.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled (closing order).
Pass criteria Position closed, or only the exact sub-precision residual remains. No open orders remain.
Skip when Adapter does not support market orders.

Considerations:

  • This test naturally follows TC-E01 or TC-E02 as part of the same session.
  • close_positions_on_stop=True is the default.
  • The closing order should be on the opposite side of the position.
  • Set close_positions_qty_precision when the venue accepts fewer size decimals than the instrument. The tester closes only that venue-fillable quantity and logs any exact residual.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    close_positions_on_stop=True,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .close_positions_on_stop(true)
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

Group 2: Limit orders

Test limit order submission, acceptance, and behavior across time-in-force options.

TC Name Description Skip when
TC-E10 Limit BUY GTC Place GTC limit buy below TOB, verify accepted. Never.
TC-E11 Limit SELL GTC Place GTC limit sell above TOB, verify accepted. Never.
TC-E12 Limit BUY and SELL pair Both sides simultaneously, verify both accepted. Never.
TC-E13 Limit IOC aggressive fill Limit IOC at aggressive price, expect fill. No IOC.
TC-E14 Limit IOC passive no fill Verify cancel or documented no-liquidity rejection. No IOC.
TC-E15 Limit FOK fill Limit FOK at aggressive price, expect fill. No FOK.
TC-E16 Limit FOK no fill Verify cancel or documented no-liquidity rejection. No FOK.
TC-E17 Limit GTD Limit with expiry time, verify accepted. No GTD.
TC-E18 Limit GTD expiry Verify documented terminal event at expiry. No GTD.
TC-E19 Limit DAY Limit with DAY TIF, verify accepted. No DAY.

TC-E10: Limit BUY GTC - submit and accept

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a limit buy at best_bid - tob_offset_ticks.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order is open on the venue with correct price, quantity, side=BUY, TIF=GTC.
Skip when Never.

Considerations:

  • The tob_offset_ticks (default 500) places the order well away from the market to avoid accidental fills.
  • Verify the order appears in the cache with OrderStatus.ACCEPTED.
  • The order should remain open until explicitly canceled.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .build()?

TC-E11: Limit SELL GTC - submit and accept

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a limit sell at best_ask + tob_offset_ticks.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order is open on the venue with correct price, quantity, side=SELL, TIF=GTC.
Skip when Never.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(true)
    .build()?

TC-E12: Limit BUY and SELL pair

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places both a limit buy and limit sell.
Event sequence Two independent sequences: each OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Both orders open on venue, buy below bid, sell above ask.
Skip when Never.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(true)
    .build()?

TC-E13: Limit IOC aggressive fill

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Submit a limit buy IOC at or above the best ask (aggressive price).
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Order fills immediately. Position opened.
Skip when Adapter does not support IOC TIF.

Considerations:

  • This test requires manual order creation or adapter-specific configuration, as the ExecTester's default limit order placement uses GTC TIF.
  • The venue cancels IOC orders that do not fill immediately.

TC-E14: Limit IOC passive - no fill

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Submit a limit buy IOC well below the market (passive price).
Event sequence OrderInitialized -> OrderSubmitted; then acceptance/cancel or documented rejection.
Pass criteria No fill; Canceled, or Rejected with the adapter-documented no-liquidity reason.
Skip when Adapter does not support IOC TIF.

Considerations:

  • The default outcome is OrderAccepted -> OrderCanceled. If the venue explicitly rejects the order for no liquidity, verify the adapter-documented OrderSubmitted -> OrderRejected sequence, exact rejection reason, and zero filled quantity in both Rust and Python. Other rejection reasons and OrderExpired do not pass this case. Preserve an explicit venue rejection rather than synthesizing acceptance or cancellation.

TC-E15: Limit FOK fill

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing, sufficient book depth.
Action Submit a limit buy FOK at aggressive price with quantity within top-of-book depth.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Order fills completely in a single fill event.
Skip when Adapter does not support FOK TIF.

Considerations:

  • FOK requires the entire quantity to be fillable. Use small quantities so book depth is sufficient.

TC-E16: Limit FOK no fill

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Submit a limit buy FOK at passive price (well below market).
Event sequence OrderInitialized -> OrderSubmitted; then acceptance/cancel or documented rejection.
Pass criteria No fill; Canceled, or Rejected with the adapter-documented no-liquidity reason.
Skip when Adapter does not support FOK TIF.

Considerations:

  • Apply the same adapter-specific no-liquidity checks as TC-E14.

TC-E17: Limit GTD - submit and accept

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Place limit buy with order_expire_time_delta_mins set (e.g., 60 minutes).
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted with GTD TIF and correct expiry timestamp.
Skip when Adapter does not support GTD TIF.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    order_expire_time_delta_mins=60,
    enable_limit_buys=True,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .order_expire_time_delta_mins(60)
    .build()?

TC-E18: Limit GTD expiry

Field Value
Prerequisite Open GTD limit order from TC-E17 using the shortest venue-supported expiry.
Action Wait for the GTD expiry time to elapse.
Event sequence OrderExpired by default, or the terminal event documented by the adapter.
Pass criteria Order reaches the adapter-documented terminal status at venue expiry.
Skip when Adapter does not support GTD TIF.

Considerations:

  • Use the shortest expiry accepted by the venue. Do not assume one or two minutes is valid.
  • Some venues report GTD expiry as a cancel. Preserve and verify the documented adapter mapping instead of normalizing every venue to OrderExpired.

TC-E19: Limit DAY - submit and accept

Field Value
Prerequisite Adapter connected, instrument loaded, market is in trading hours.
Action Submit limit buy with DAY TIF.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted with DAY TIF. Will be automatically canceled at end of trading day.
Skip when Adapter does not support DAY TIF.

Considerations:

  • DAY orders may behave differently on 24/7 crypto venues vs traditional markets.
  • Verify behavior when submitted outside trading hours (if applicable).

Group 3: Stop and conditional orders

Test stop and conditional order types. These orders rest on the venue until a trigger condition is met. Adapters that support venue-native conditional orders should also verify that open trigger orders appear in restart reconciliation, not only in the normal open-order endpoint.

TC Name Description Skip when
TC-E20 StopMarket BUY Stop buy above ask, verify accepted. No STOP_MARKET.
TC-E21 StopMarket SELL Stop sell below bid, verify accepted. No STOP_MARKET.
TC-E22 StopLimit BUY Stop-limit buy with trigger + limit price. No STOP_LIMIT.
TC-E23 StopLimit SELL Stop-limit sell with trigger + limit price. No STOP_LIMIT.
TC-E24 MarketIfTouched BUY MIT buy below bid. No MIT.
TC-E25 MarketIfTouched SELL MIT sell above ask. No MIT.
TC-E26 LimitIfTouched BUY LIT buy with trigger + limit price. No LIT.
TC-E27 LimitIfTouched SELL LIT sell with trigger + limit price. No LIT.

TC-E20: StopMarket BUY

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a stop-market buy above the current ask.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Stop order accepted on venue with correct trigger price and side=BUY.
Skip when Adapter does not support StopMarket orders.

Considerations:

  • The trigger price should be above the current ask by stop_offset_ticks.
  • The order should NOT trigger immediately (trigger price is above market).
  • For venues with long-lived trigger signatures, check trigger-order signing expiry against the venue's trigger-order window, rather than normal order expiry.
  • Verifying trigger and fill requires the market to move, which may not happen during the test.
  • After acceptance, restart or force reconciliation. If the venue keeps trigger orders in a separate endpoint, check the open order reports. Make sure that the order still appears there.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
    enable_stop_buys=True,
    enable_stop_sells=False,
    stop_order_type=OrderType.STOP_MARKET,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .enable_stop_buys(true)
    .enable_stop_sells(false)
    .stop_order_type(OrderType::StopMarket)
    .build()?

TC-E21: StopMarket SELL

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a stop-market sell below the current bid.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Stop order accepted on venue with correct trigger price and side=SELL.
Skip when Adapter does not support StopMarket orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
    enable_stop_buys=False,
    enable_stop_sells=True,
    stop_order_type=OrderType.STOP_MARKET,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .enable_stop_buys(false)
    .enable_stop_sells(true)
    .stop_order_type(OrderType::StopMarket)
    .build()?

TC-E22: StopLimit BUY

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a stop-limit buy with trigger price above ask and limit offset.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Stop-limit order accepted with correct trigger price, limit price, and side=BUY.
Skip when Adapter does not support StopLimit orders.

Considerations:

  • Requires stop_limit_offset_ticks to be set for the limit price offset from the trigger price.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
    enable_stop_buys=True,
    enable_stop_sells=False,
    stop_order_type=OrderType.STOP_LIMIT,
    stop_limit_offset_ticks=50,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .enable_stop_buys(true)
    .enable_stop_sells(false)
    .stop_order_type(OrderType::StopLimit)
    .stop_limit_offset_ticks(50)
    .build()?

TC-E23: StopLimit SELL

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places a stop-limit sell with trigger price below bid.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Stop-limit order accepted with correct trigger price, limit price, and side=SELL.
Skip when Adapter does not support StopLimit orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=False,
    enable_stop_buys=False,
    enable_stop_sells=True,
    stop_order_type=OrderType.STOP_LIMIT,
    stop_limit_offset_ticks=50,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .enable_stop_buys(false)
    .enable_stop_sells(true)
    .stop_order_type(OrderType::StopLimit)
    .stop_limit_offset_ticks(50)
    .build()?

TC-E24: MarketIfTouched BUY

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Place MIT buy with trigger below current bid (buy on dip).
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria MIT order accepted on venue with correct trigger price.
Skip when Adapter does not support MarketIfTouched orders.

TC-E25: MarketIfTouched SELL

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Place MIT sell with trigger above current ask (sell on rally).
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria MIT order accepted on venue with correct trigger price.
Skip when Adapter does not support MarketIfTouched orders.

TC-E26: LimitIfTouched BUY

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Place LIT buy with trigger below bid and limit price offset.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria LIT order accepted with correct trigger price and limit price.
Skip when Adapter does not support LimitIfTouched orders.

TC-E27: LimitIfTouched SELL

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action Place LIT sell with trigger above ask and limit price offset.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria LIT order accepted with correct trigger price and limit price.
Skip when Adapter does not support LimitIfTouched orders.

Group 4: Order modification

Test order modification (amend) and cancel-replace workflows.

TC Name Description Skip when
TC-E30 Modify limit BUY price Amend open limit buy to new price. No modify support.
TC-E31 Modify limit SELL price Amend open limit sell to new price. No modify support.
TC-E32 Cancel-replace limit BUY Cancel and resubmit limit buy at new price. Never.
TC-E33 Cancel-replace limit SELL Cancel and resubmit limit sell at new price. Never.
TC-E34 Modify stop trigger price Amend stop order trigger price. No modify or no stop.
TC-E35 Cancel-replace stop order Cancel and resubmit stop at new trigger price. No stop orders.
TC-E36 Unsupported modify denied Modify on unsupported adapter. Adapter supports modify.

trigger_limit_order_maintenance_once=True requires exactly one of the limit-order modify or cancel-replace modes and at least one enabled limit side. It is incompatible with bracket entries, test_modify_rejected, and two-sided batch limit submission. Configuration validation rejects these combinations.

TC-E30: Modify limit BUY price

Field Value
Prerequisite Open GTC limit buy from TC-E10.
Action ExecTester modifies the open limit buy to a new price.
Event sequence OrderPendingUpdate -> OrderUpdated.
Pass criteria OrderUpdated event logged with the new price. Order exits PendingUpdate.
Skip when Adapter does not support order modification.

Considerations:

  • trigger_limit_order_maintenance_once=True amends to a different valid price directly from the first OrderAccepted, preferring one tick more passive. A quiet book is not inconclusive.
  • After the one-shot workflow starts, it stops further limit maintenance for that side. Thus, the tester does not immediately amend the order back to the TOB target.
  • Without that flag, the modify waits for the order price to drift from the target TOB offset. No movement and no OrderUpdated is inconclusive, not a failure.
  • Verify the OrderUpdated log shows the expected price. If the event never arrives after a forced or drift-triggered amend, the order stays in PendingUpdate and the tester stops modifying it.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    modify_orders_to_maintain_tob_offset=True,
    trigger_limit_order_maintenance_once=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .modify_orders_to_maintain_tob_offset(true)
    .trigger_limit_order_maintenance_once(true)
    .build()?

TC-E31: Modify limit SELL price

Field Value
Prerequisite Open GTC limit sell from TC-E11.
Action ExecTester modifies the open limit sell to a new price.
Event sequence OrderPendingUpdate -> OrderUpdated.
Pass criteria OrderUpdated event logged with the new price. Order exits PendingUpdate.
Skip when Adapter does not support order modification.

Considerations:

  • Same one-shot trigger and quiet-book guidance as TC-E30.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=True,
    modify_orders_to_maintain_tob_offset=True,
    trigger_limit_order_maintenance_once=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(true)
    .modify_orders_to_maintain_tob_offset(true)
    .trigger_limit_order_maintenance_once(true)
    .build()?

TC-E32: Cancel-replace limit BUY

Field Value
Prerequisite Open GTC limit buy.
Action ExecTester cancels and resubmits the limit buy at a new price.
Event sequence OrderPendingCancel -> OrderCanceled -> OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Original order canceled, new order accepted at updated price.
Skip when Never (cancel-replace is always available).

Considerations:

  • This is the universal alternative when the adapter does not support native modify.
  • Two distinct orders in the cache: the canceled original and the new replacement.
  • trigger_limit_order_maintenance_once=True requests one cancel directly from the first OrderAccepted, then submits the replacement only after OrderCanceled.
  • Without the one-shot trigger, cancel-replace waits for TOB drift. No movement and no replacement is inconclusive, not a failure.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    cancel_replace_orders_to_maintain_tob_offset=True,
    trigger_limit_order_maintenance_once=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .cancel_replace_orders_to_maintain_tob_offset(true)
    .trigger_limit_order_maintenance_once(true)
    .build()?

TC-E33: Cancel-replace limit SELL

Field Value
Prerequisite Open GTC limit sell.
Action ExecTester cancels and resubmits the limit sell at a new price.
Event sequence OrderPendingCancel -> OrderCanceled -> OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Original order canceled, new order accepted at updated price.
Skip when Never.

Considerations:

  • Same one-shot trigger and quiet-book guidance as TC-E32.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=False,
    enable_limit_sells=True,
    cancel_replace_orders_to_maintain_tob_offset=True,
    trigger_limit_order_maintenance_once=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(false)
    .enable_limit_sells(true)
    .cancel_replace_orders_to_maintain_tob_offset(true)
    .trigger_limit_order_maintenance_once(true)
    .build()?

TC-E34: Modify stop trigger price

Field Value
Prerequisite Open stop order from TC-E20 or TC-E22.
Action ExecTester modifies stop trigger price as market moves (modify_stop_orders_to_maintain_offset=True).
Event sequence OrderPendingUpdate -> OrderUpdated.
Pass criteria OrderUpdated event logged with the new trigger price. Order exits PendingUpdate.
Skip when Adapter does not support native stop modify, or no stop order support.

Considerations:

  • Some venues allow limit-order modify but reject trigger-order replace. For those adapters, skip TC-E34 and run TC-E35 instead.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_stop_buys=True,
    modify_stop_orders_to_maintain_offset=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_stop_buys(true)
    .modify_stop_orders_to_maintain_offset(true)
    .build()?

TC-E35: Cancel-replace stop order

Field Value
Prerequisite Open stop order.
Action ExecTester cancels and resubmits stop at new trigger price.
Event sequence OrderPendingCancel -> OrderCanceled -> OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Original stop canceled, new stop accepted at updated trigger price.
Skip when No stop order support.

Considerations:

  • This is the required path for venues that do not support native trigger-order replace.
  • After the new stop is accepted, restart or force reconciliation and verify exactly one current trigger order remains.
  • ExecTester keeps replacements pending after reconciliation-generated cancellations and logs an error. Mark the case inconclusive, then check and cancel any remaining test orders at the venue; the original stop may still be working.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_stop_buys=True,
    cancel_replace_stop_orders_to_maintain_offset=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_stop_buys(true)
    .cancel_replace_stop_orders_to_maintain_offset(true)
    .build()?

TC-E36: Unsupported modify denied

Field Value
Prerequisite Open limit order, adapter does NOT support modify.
Action Attempt to modify the order (programmatically, not via ExecTester auto-maintain).
Event sequence OrderModifyDenied.
Pass criteria Modify attempt results in OrderModifyDenied with the command ID and reason. Original order remains unchanged.
Skip when Adapter supports order modification.

Considerations:

  • This tests the adapter's local denial path, not the ExecTester's cancel-replace logic.
  • The denial reason should indicate that modification is not supported.

Group 5: Order cancellation

Test order cancellation workflows.

TC Name Description Skip when
TC-E40 Cancel single limit order Cancel an open limit order. Never.
TC-E41 Cancel all on stop Strategy stop cancels all open orders (default). Never.
TC-E42 Individual cancels on stop Cancel orders one-by-one on stop. Never.
TC-E43 Batch cancel on stop Cancel orders via batch API on stop. No batch cancel.
TC-E44 Cancel already-canceled Verify documented denial, rejection, or idempotent result. Never.

TC-E40: Cancel single limit order

Field Value
Prerequisite Open GTC limit order from TC-E10 or TC-E11.
Action Stop the strategy. ExecTester cancels the open limit order.
Event sequence OrderPendingCancel -> OrderCanceled.
Pass criteria Order status transitions to CANCELED. No open orders remaining.
Skip when Never.

Considerations:

  • cancel_orders_on_stop=True (default) triggers cancellation when the strategy stops.
  • Verify the OrderCanceled event contains the correct venue_order_id.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    cancel_orders_on_stop=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .cancel_orders_on_stop(true)
    .build()?

TC-E41: Cancel all on stop

Field Value
Prerequisite Multiple open orders (limit buy + limit sell from TC-E12).
Action Stop the strategy with cancel_orders_on_stop=True (default).
Event sequence For each order: OrderPendingCancel -> OrderCanceled.
Pass criteria All open orders canceled. No open orders remaining.
Skip when Never.

Considerations:

  • Default stop uses cancel_all. Some venues implement that as account-wide. Confirm the adapter's CancelAllOrders scope before running beside other open orders. Use use_individual_cancels_on_stop or use_batch_cancel_on_stop to isolate.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=True,
    cancel_orders_on_stop=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(true)
    .cancel_orders_on_stop(true)
    .build()?

TC-E42: Individual cancels on stop

Field Value
Prerequisite Multiple open orders.
Action Stop with use_individual_cancels_on_stop=True.
Event sequence Individual OrderPendingCancel -> OrderCanceled for each order.
Pass criteria Each order canceled individually. All orders reach CANCELED status.
Skip when Never.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=True,
    use_individual_cancels_on_stop=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(true)
    .use_individual_cancels_on_stop(true)
    .build()?

TC-E43: Batch cancel on stop

Field Value
Prerequisite Multiple open orders, adapter supports batch cancel.
Action Stop with use_batch_cancel_on_stop=True.
Event sequence Batch OrderPendingCancel -> OrderCanceled for all orders.
Pass criteria All orders canceled via single batch request. All reach CANCELED status.
Skip when Adapter does not support batch cancel.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=True,
    use_batch_cancel_on_stop=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(true)
    .use_batch_cancel_on_stop(true)
    .build()?

TC-E44: Cancel already-canceled order

Field Value
Prerequisite A previously canceled order (from TC-E40).
Action Attempt to cancel the same order again.
Event sequence OrderCancelDenied locally, OrderCancelRejected from the venue, or a documented idempotent result.
Pass criteria Result matches the adapter contract without a duplicate terminal event.
Skip when Never.

Considerations:

  • The default contract tests the adapter's error handling for invalid cancel requests. The denial or rejection reason should indicate the order is not in a cancelable state.
  • Strategy.cancel_order and the order manager drop cancels for locally closed orders, so ExecTester cannot reach the adapter after TC-E40. A second cancel_order that never leaves the process is inconclusive.
  • A venue may treat an already-terminal cancel as idempotent. Document that disposition and use an adapter-focused test that submits CancelOrder with the venue order ID after the order is terminal.

Group 6: Bracket orders

Test bracket order submission (entry + take-profit + stop-loss).

ExecTester defaults to OUO exits and a LIMIT take-profit. For adapters that require native OCO exits with a conditional take-profit, set bracket_contingency_type to OCO and bracket_tp_order_type to MARKET_IF_TOUCHED or LIMIT_IF_TOUCHED, as supported by the adapter. For Lighter, use OCO and MARKET_IF_TOUCHED; see contingent orders.

TC Name Description Skip when
TC-E50 Bracket BUY Entry limit buy + TP sell + SL stop sell. No bracket support.
TC-E51 Bracket SELL Entry limit sell + TP buy + SL stop buy. No bracket support.
TC-E52 Bracket entry fill activates Verify TP/SL become active after entry fill. No bracket support.
TC-E53 Bracket with post-only entry Entry order uses post-only flag. No bracket or PO.

TC-E50: Bracket BUY

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester submits a bracket order: limit buy entry + take-profit sell + stop-loss sell.
Event sequence Entry: OrderInitialized -> OrderSubmitted -> OrderAccepted. TP and SL: OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Three orders created and accepted: entry below bid, TP above ask, SL below entry.
Skip when Adapter does not support bracket orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_brackets=True,
    bracket_entry_order_type=OrderType.LIMIT,
    bracket_offset_ticks=500,
    enable_limit_buys=True,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_brackets(true)
    .bracket_entry_order_type(OrderType::Limit)
    .bracket_offset_ticks(500)
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .build()?

TC-E51: Bracket SELL

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester submits bracket: limit sell entry + TP buy + SL buy.
Event sequence Same pattern as TC-E50 but for sell side.
Pass criteria Three orders created and accepted on sell side.
Skip when Adapter does not support bracket orders.

TC-E52: Bracket entry fill activates TP/SL

Field Value
Prerequisite Bracket order from TC-E50 where entry order fills.
Action Entry order fills. Verify contingent TP and SL orders activate.
Event sequence Entry: OrderFilled. TP and SL transition from contingent to active.
Pass criteria After entry fill, TP and SL orders are live on the venue.
Skip when Adapter does not support bracket orders.

Considerations:

  • This requires the entry order to actually fill, which may need aggressive pricing.
  • The TP/SL activation mechanism varies by venue (some activate immediately, some are OCA groups).

TC-E53: Bracket with post-only entry

Field Value
Prerequisite Adapter supports brackets and post-only.
Action Submit bracket with use_post_only=True.
Event sequence Same as TC-E50 with post-only flag on entry.
Pass criteria Entry order accepted as post-only (maker).
Skip when No bracket support or no post-only support.

LIMIT and LIMIT_IF_TOUCHED take-profits are also post-only. Stop-loss and MARKET_IF_TOUCHED take-profit orders are not post-only.


Group 7: Order flags

Test order-level flags and special parameters.

TC Name Description Skip when
TC-E60 PostOnly accepted Limit with post-only, placed away from TOB. No post-only.
TC-E61 ReduceOnly on close Close position with reduce-only flag. No reduce-only.
TC-E62 Display quantity Iceberg order with visible quantity < total. No display quantity.
TC-E63 Custom order params Adapter-specific params via order_params. N/A.

TC-E60: PostOnly accepted

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places limit buy with use_post_only=True at passive price.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted as a maker order. Post-only flag acknowledged by venue.
Skip when Adapter does not support post-only flag.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    use_post_only=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .use_post_only(true)
    .build()?

TC-E61: ReduceOnly on close

Field Value
Prerequisite Open position (from TC-E01).
Action Stop strategy with reduce_only_on_stop=True. Closing order uses reduce-only flag.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled (with reduce-only).
Pass criteria Closing order has reduce-only flag. Position fully closed.
Skip when Adapter does not support reduce-only flag.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    reduce_only_on_stop=True,
    close_positions_on_stop=True,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .reduce_only_on_stop(true)
    .close_positions_on_stop(true)
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

TC-E62: Display quantity (iceberg)

Field Value
Prerequisite Adapter connected, adapter supports display quantity.
Action Place limit order with order_display_qty < order_qty.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted with display quantity set. Only display qty visible on the book.
Skip when Adapter does not support display quantity / iceberg orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("1.0"),
    order_display_qty=Quantity.from_str("0.1"),
    enable_limit_buys=True,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("1.0"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .order_display_qty(Quantity::from("0.1"))
    .build()?

TC-E63: Custom order params

Field Value
Prerequisite Adapter connected, adapter accepts additional parameters.
Action Place order with order_params dict containing adapter-specific parameters.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted. Adapter-specific parameters passed through to venue.
Skip when N/A (adapter-specific).

Considerations:

  • The order_params dict is opaque to the ExecTester and passed through to the adapter.
  • Consult the adapter's guide for supported parameters.

Group 8: Rejection handling

Test that the adapter correctly handles and reports order rejections.

TC Name Description Skip when
TC-E70 PostOnly rejection Post-only order that would cross the spread. No post-only.
TC-E71 ReduceOnly rejection Reduce-only order with no position to reduce. No reduce-only.
TC-E72 Unsupported order type Submit order type not supported by adapter. Never.
TC-E73 Unsupported TIF Submit order with unsupported time in force. Never.
TC-E74 Ambiguous submit fail Transport, timeout, or send failure on submit. No mock path.
TC-E75 Ambiguous cancel fail Transport, timeout, or send failure on cancel. No cancel.
TC-E76 Ambiguous modify fail Transport, timeout, or send failure on modify. No modify.
TC-E77 Ambiguous batch fail Whole-batch failure without per-order result. No batch.
TC-E78 Per-order batch reject Batch response has explicit per-order rejection. No batch.

TC-E74 through TC-E78 are specified collectively below because they usually require a mock HTTP or WebSocket boundary rather than a live venue.

Ambiguous outcome failures

These cases prove that adapter request failures do not turn into terminal rejection events when the venue outcome is unknown. The pass criteria also define an exception for local prepare failures. The command must be known not to have been sent. The failure must be attributable to one cancel or modify command. If both conditions hold, the adapter emits the matching denied event with the command ID.

Pass criteria:

  • Submit failures from transport errors, timeouts, WebSocket send failures, retry exhaustion, or response parse failures do not emit OrderRejected.
  • When the venue outcome is unknown, cancel failures from transport errors, timeouts, WebSocket send failures, retry exhaustion, or whole-request server failures emit neither OrderCancelDenied nor OrderCancelRejected.
  • When the venue outcome is unknown, modify failures from transport errors, timeouts, WebSocket send failures, retry exhaustion, or whole-request server failures emit neither OrderModifyDenied nor OrderModifyRejected.
  • Local cancel prepare failures that prove the command cannot be sent emit OrderCancelDenied with the attributable cancel command ID.
  • Local modify prepare failures that prove the command cannot be sent emit OrderModifyDenied with the attributable modify command ID.
  • Whole-batch failures with unknown per-order outcomes emit neither denied nor rejected events.
  • Explicit per-order venue rejections still emit the matching rejection event with the venue reason.

These criteria apply to adapter request failures. Separately, when the engine exhausts in-flight retries under RetainUnresolved, it emits OrderCancelRejected or OrderModifyRejected with reason INFLIGHT_TIMEOUT for a pending cancel or modify on an accepted order. This restores the prior order status without proving a venue rejection. See In-flight checks.

After an ambiguous outcome, the order remains in flight until venue evidence resolves it or the engine's in-flight timeout policy handles it. When periodic open-order checks are enabled, open-only missing-order queries can return a terminal report for a restored order; a missing report or failed query leaves it open.

TC-E70: PostOnly rejection

Field Value
Prerequisite Adapter connected, instrument loaded, quotes flowing.
Action ExecTester places post-only order on the wrong side of the book (test_reject_post_only=True), causing it to cross the spread.
Event sequence OrderInitialized -> OrderSubmitted -> OrderRejected.
Pass criteria Venue rejects order. OrderRejected.due_post_only=true. Reason names post-only violation.
Skip when Adapter does not support post-only flag.

Considerations:

  • The ExecTester's test_reject_post_only mode intentionally prices the order to cross.
  • Some venues may partially fill instead of rejecting. Behavior is venue-specific.
  • Adapters that emit OrderRejected for a post-only crossing reject should set due_post_only=true so strategies can distinguish this from other venue rejections.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    use_post_only=True,
    test_reject_post_only=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .enable_limit_buys(true)
    .enable_limit_sells(false)
    .use_post_only(true)
    .test_reject_post_only(true)
    .build()?

TC-E71: ReduceOnly rejection

Field Value
Prerequisite Adapter connected, no open position for the instrument.
Action Submit a supported order type with reduce_only=True when no position exists to reduce.
Event sequence OrderInitialized -> OrderDenied, or OrderInitialized -> OrderSubmitted -> OrderRejected.
Pass criteria Order denied before submission or rejected by the venue, with a reason indicating a reduce-only violation.
Skip when Adapter does not support the reduce-only flag.

Considerations:

  • The test_reject_reduce_only flag only applies to the opening market order submitted via open_position_on_start_qty. For adapters without market orders, use a manual strategy with a supported marketable limit IOC order.
  • Verify no prior position exists for the instrument before running this test.
  • An unsupported-order-type denial does not prove reduce-only validation. The reason must identify the reduce-only violation.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
    test_reject_reduce_only=True,
    enable_limit_buys=False,
    enable_limit_sells=False,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .test_reject_reduce_only(true)
    .enable_limit_buys(false)
    .enable_limit_sells(false)
    .build()?

TC-E72: Unsupported order type

Field Value
Prerequisite Adapter connected, order type not in adapter's supported set.
Action Submit an order type the adapter does not support.
Event sequence OrderDenied (pre-submission rejection by adapter).
Pass criteria Order denied before reaching venue. OrderDenied event with reason.
Skip when Never (every adapter has unsupported order types to test).

Considerations:

  • OrderDenied occurs at the adapter level before the order reaches the venue.
  • This differs from the normal OrderRejected path, which follows a venue rejection. Reconciliation can also synthesize OrderRejected. See Terminal reconciliation provenance.
  • Test by configuring a stop order type that the adapter does not support.

TC-E73: Unsupported TIF

Field Value
Prerequisite Adapter connected, TIF not in adapter's supported set.
Action Submit an order with a TIF the adapter does not support.
Event sequence OrderDenied (pre-submission rejection by adapter).
Pass criteria Order denied before reaching venue. OrderDenied event with reason.
Skip when Never (every adapter has unsupported TIF options to test).

Considerations:

  • Similar to TC-E72 but for time-in-force options.
  • Test with TIF values from the Nautilus enum that the adapter does not map.

Group 9: Lifecycle and reconciliation

Test strategy lifecycle behavior and execution-state recovery on start, stop, and report failure.

TC-E88 and TC-E89 run offline as deterministic adapter unit or integration tests rather than through ExecTester against a venue.

TC Name Description Skip when
TC-E80 Open position on start Open a position immediately when strategy starts. No market orders.
TC-E81 Cancel orders on stop Cancel all open orders when strategy stops. Never.
TC-E82 Close positions on stop Close open positions when strategy stops. No market orders.
TC-E83 Unsubscribe on stop Unsubscribe from data feeds on strategy stop. No unsub support.
TC-E84 Reconcile open orders Reconcile existing open orders from a prior session. Never.
TC-E85 Reconcile filled orders Reconcile previously filled orders from a prior session. Never.
TC-E86 Reconcile open long Reconcile existing open long position. Never.
TC-E87 Reconcile open short Reconcile existing open short position. Never.
TC-E88 Reconciliation commission failure A required fill commission cannot be represented. No fill commission logic.
TC-E89 WebSocket commission failure A private fill commission cannot be represented. No private fill stream or commission logic.

TC-E80: Open position on start

Field Value
Prerequisite Adapter connected, instrument loaded, no existing position.
Action Strategy starts with open_position_on_start_qty set.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Position opened on start. Market order submitted and filled before limit order maintenance begins.
Skip when Adapter does not support market orders.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    open_position_on_start_qty=Decimal("0.01"),
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .open_position_on_start_qty(Decimal::new(1, 2))
    .build()?

TC-E81: Cancel orders on stop

Field Value
Prerequisite Open limit orders from the strategy session.
Action Stop the strategy with cancel_orders_on_stop=True (default).
Event sequence For each open order: OrderPendingCancel -> OrderCanceled.
Pass criteria All strategy-owned open orders canceled on stop.
Skip when Never.

TC-E82: Close positions on stop

Field Value
Prerequisite Open position from the strategy session.
Action Stop the strategy with close_positions_on_stop=True (default).
Event sequence Closing order: OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled.
Pass criteria Positions closed, or only exact sub-precision residuals remain. No open orders remain.
Skip when Adapter does not support market orders.

TC-E83: Unsubscribe on stop

Field Value
Prerequisite Active data subscriptions (quotes, trades, book).
Action Stop the strategy with can_unsubscribe=True (default).
Event sequence Data subscriptions removed.
Pass criteria No further data events received after stop. Clean disconnection.
Skip when Adapter does not support unsubscribe.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,
    order_qty=Quantity.from_str("0.01"),
    can_unsubscribe=True,
)

Rust config:

ExecTesterConfig::builder()
    .base(StrategyConfig {
        strategy_id: Some(strategy_id),
        ..Default::default()
    })
    .instrument_id(instrument_id)
    .client_id(client_id)
    .order_qty(Quantity::from("0.01"))
    .can_unsubscribe(true)
    .build()?

TC-E84: Reconcile open orders

Field Value
Prerequisite One or more open limit orders on the venue from a prior session.
Action Start the node with reconciliation=True.
Event sequence OrderStatusReport generated for each open order.
Pass criteria Each open order is loaded into the cache with correct venue_order_id, status=ACCEPTED, price, quantity, side, and order type.
Skip when Never.

Considerations:

  • Leave limit orders open from a prior test session (do not cancel on stop).
  • Configure external_order_instrument_ids so strategy registration creates the active claim used to assign reconciled orders.
  • Verify that the reconciled order count matches the venue-reported count.
  • Mass-status may include historical terminal orders. Unclaimed ones appear as EXTERNAL. Compare open-order counts against the venue open-order endpoint, not the full mass-status length.
  • Report ts_event values must be Unix nanoseconds even when the venue only has second precision.

TC-E85: Reconcile filled orders

Field Value
Prerequisite One or more filled orders on the venue from a prior session.
Action Start the node with reconciliation=True.
Event sequence FillReport generated for each historical fill.
Pass criteria Each filled order is loaded into the cache with correct venue_order_id, status=FILLED, fill price, fill quantity, and commission.
Skip when Never.

Considerations:

  • Requires orders that filled in a prior session.
  • Verify fill price, quantity, and commission match the venue's reported values.
  • Some adapters may only report fills within a lookback window.
  • Historical fill replay can change a live zero commission to the REST fee. That flip is expected when the stream omits fees and reconciliation supplies them.
  • Report ts_event values must be Unix nanoseconds even when the venue only has second precision.

TC-E86: Reconcile open long position

Field Value
Prerequisite An open long position on the venue from a prior session.
Action Start the node with reconciliation=True.
Event sequence PositionStatusReport generated for the long position.
Pass criteria Position loaded into cache with correct instrument, side=LONG, quantity, and entry price matching the venue.
Skip when Never.

Considerations:

  • Open a long position in a prior session and stop the strategy without closing it (close_positions_on_stop=False).
  • Verify the reconciled position quantity and average entry price match the venue.
  • After reconciliation, the strategy should be able to manage or close this position.

TC-E87: Reconcile open short position

Field Value
Prerequisite An open short position on the venue from a prior session.
Action Start the node with reconciliation=True.
Event sequence PositionStatusReport generated for the short position.
Pass criteria Position loaded into cache with correct instrument, side=SHORT, quantity, and entry price matching the venue.
Skip when Never.

Considerations:

  • Open a short position in a prior session and stop the strategy without closing it (close_positions_on_stop=False).
  • Verify the reconciled position quantity and average entry price match the venue.
  • After reconciliation, the strategy should be able to manage or close this position.

TC-E88: Reconciliation commission failure

Field Value
Prerequisite A deterministic fixture produces an out-of-range commission for an owned, confirmed fill.
Action Exercise direct fill, mass-status, targeted report, and inferred-fill commission paths with the fixture.
Event sequence Report requests return an error. Engine reconciliation logs a hook error and emits no fallback inferred fill.
Pass criteria The error is observable. Startup fails or inferred work defers. A later valid response reconciles exactly once.
Skip when The adapter does not calculate commission for fill reports.

Considerations:

  • Assert that no zero or generic commission replaces the failed venue calculation.
  • Exercise the inferred-fill hook as well as direct FillReport construction.
  • Skip the inferred-fill portion when the adapter does not override the shared commission hook.
  • Assert that hook quantity, price, and liquidity inputs match the emitted inferred fill. Include the back-solved price of an incremental residual after a prior fill.
  • Valid explicit fills may apply, but the residual quantity and dependent terminal transition stay pending.
  • A position-only synthetic correction without trade evidence is not a commission calculation failure.

TC-E89: WebSocket commission failure

Field Value
Prerequisite A private fill fixture produces an out-of-range commission and has a stable venue trade ID.
Action Deliver the invalid trade, repair its commission, then replay the same trade ID. For Polymarket, use the exception below.
Event sequence The first delivery emits no fill and changes no fill, terminal, or deduplication state. The replay emits one fill.
Pass criteria No panic or fallback occurs. The valid replay applies exactly once. REST reconciliation can recover a missed replay.
Skip when The adapter has no private fill stream or does not calculate commission for private fills.

Considerations:

  • For a venue trade that fills several owned orders, make one report fail. Assert that the first delivery emits none of those reports. This prevents a replay from duplicating reports built before the failure.
  • Assert that the adapter consumes the deduplication key only after all reports construct and route successfully.
  • Assert that a failed trade does not confirm or terminalize its order.

Polymarket exception:

Invalid commission evidence quarantines the whole trade for targeted REST resolution. The failed delivery emits no fill, applies no owned leg, and does not confirm or terminalize the order. Quarantine state persists across repaired WebSocket replays with the same trade ID, including CONFIRMED updates. The default WebSocket replay recovery, unchanged deduplication state, and REST reconciliation fallback requirements above do not apply to Polymarket, including the deduplication-key consideration. Targeted terminal REST evidence supplies recovery.

After repairing the commission inputs, verify that:

  1. A same-ID WebSocket replay emits no fill and leaves the trade quarantined.
  2. A targeted non-terminal REST result emits no fill and leaves the trade quarantined.
  3. A valid targeted REST CONFIRMED result emits the exact fill quantity, price, and commission once.
  4. Repeated REST evidence emits no duplicate, both before and after the engine applies the fill.

Use distinct REST fill values to prove that recovery uses REST evidence. For terminal FAILED evidence, verify that no previously unemitted fill appears. See Polymarket settlement resolution.


Group 10: Options trading

Test options-specific execution behavior. Options instruments typically have different constraints from linear derivatives: venues may restrict order types, support alternative pricing modes, or disallow conditional orders. Exact restrictions vary by venue. Consult the adapter guide.

These tests require a CryptoOption instrument. Use an OTM option with reasonable liquidity for fills.

TC Name Description Skip when
TC-E90 Limit BUY option Place a limit buy on an option instrument. No options support.
TC-E91 Limit SELL option Place a limit sell on an option instrument. No options support.
TC-E92 Limit with alt pricing Place a limit order with adapter-specific pricing via order_params. No alt pricing.
TC-E94 Unsupported order type denied Submit an order type the adapter rejects for options. No options support.
TC-E96 Conditional order rejected Submit a stop/conditional order on an option. Expect rejection. No options support.
TC-E99 FOK limit option Place a FOK limit order on an option instrument. No FOK options.
TC-E100 Cancel option order Cancel an open limit order on an option instrument. No options support.
TC-E101 Reconcile option position Reconcile an open option position from a prior session. No options support.

TC-E90: Limit BUY option

Field Value
Prerequisite Adapter connected, option instrument loaded, quotes flowing.
Action ExecTester places a limit buy on the option at a passive price.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted by venue with correct instrument, side, price, and quantity.
Skip when Adapter does not support options trading.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,  # CryptoOption instrument
    order_qty=Quantity.from_str("1"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    tob_offset_ticks=500,
)

TC-E91: Limit SELL option

Field Value
Prerequisite Adapter connected, option instrument loaded, quotes flowing.
Action ExecTester places a limit sell on the option at a passive price.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted by venue with correct instrument, side, price, and quantity.
Skip when Adapter does not support options trading.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,  # CryptoOption instrument
    order_qty=Quantity.from_str("1"),
    enable_limit_buys=False,
    enable_limit_sells=True,
    tob_offset_ticks=500,
)

TC-E92: Limit with alternative pricing

Field Value
Prerequisite Adapter connected, option instrument loaded.
Action Place limit order with adapter-specific pricing via order_params.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted.
Pass criteria Order accepted. Venue acknowledges the alternative pricing mode.
Skip when Adapter does not support alternative pricing modes for options.

Considerations:

  • The price field on the order object may be a placeholder when alternative pricing is active. Consult the adapter guide for supported parameter keys.
  • Example: OKX supports px_usd (USD price) and px_vol (implied volatility).
  • Verify in venue responses that the pricing mode is reflected correctly.

Python config:

ExecTesterConfig(
    instrument_id=instrument_id,  # CryptoOption instrument
    order_qty=Quantity.from_str("1"),
    enable_limit_buys=True,
    enable_limit_sells=False,
    order_params={"px_usd": "100.5"},  # Adapter-specific pricing key
)

TC-E94: Unsupported order type denied for options

Field Value
Prerequisite Adapter connected, option instrument loaded.
Action Submit an order type the venue does not support for options (e.g. market order).
Event sequence Adapter-dependent: OrderDenied (pre-submission) or OrderSubmitted -> OrderRejected (post-submission).
Pass criteria Order does not fill. Denial or rejection reason references the unsupported order type.
Skip when Adapter does not support options.

Considerations:

  • The exact rejection point varies by adapter. Some adapters deny locally before submitting. Others submit and relay the venue rejection.
  • ExecTester can trigger a market order via open_position_on_start_qty on an option instrument. Some unsupported types (e.g. MarketToLimit) require manual or programmatic submission.
  • Test each unsupported type the adapter documents.

TC-E96: Conditional order rejected for options

Field Value
Prerequisite Adapter connected, option instrument loaded.
Action Submit a conditional order on an option instrument.
Event sequence Adapter-dependent: OrderDenied (pre-submission) or OrderSubmitted -> OrderRejected (post-submission).
Pass criteria Order does not fill. Reason references unsupported conditional order type.
Skip when Adapter does not support options, or adapter supports conditionals for options.

Considerations:

  • Test each conditional type the adapter documents as unsupported for options (e.g. STOP_MARKET, STOP_LIMIT, MARKET_IF_TOUCHED, LIMIT_IF_TOUCHED, TRAILING_STOP_MARKET).
  • ExecTester can trigger conditional orders via enable_stop_buys/enable_stop_sells with stop_order_type on an option instrument.

TC-E99: FOK limit option

Field Value
Prerequisite Adapter connected, option instrument loaded, sufficient book depth.
Action Place a limit order with TimeInForce::Fok on an option instrument.
Event sequence OrderInitialized -> OrderSubmitted -> OrderAccepted -> OrderFilled or OrderCanceled.
Pass criteria Order fills completely or is canceled. No partial fills.
Skip when Adapter does not support FOK for options.

Considerations:

  • See the adapter's integration guide for its options FOK request mapping.
  • Use small quantities and aggressive pricing to get a fill for the positive case.

TC-E100: Cancel option order

Field Value
Prerequisite Open limit order from TC-E90 or TC-E91.
Action Cancel the open limit order.
Event sequence OrderPendingCancel -> OrderCanceled.
Pass criteria Order canceled. No longer appears in open orders on the venue.
Skip when Adapter does not support options.

TC-E101: Reconcile option position

Field Value
Prerequisite Open option position from a prior session.
Action Start the node with reconciliation=True.
Event sequence PositionStatusReport generated for the option position.
Pass criteria Position loaded into cache with correct instrument, side, quantity, and entry price.
Skip when Adapter does not support options.

Considerations:

  • Open an option position in a prior session and stop without closing (close_positions_on_stop=False).
  • Verify the reconciled position matches the venue-reported state.

ExecTester configuration reference

Quick reference for each Python ExecTesterConfig parameter. Defaults are resolved values after construction. The Rust builder uses equivalent defaults.

Parameter Type Default Affects groups
strategy_id StrategyId? None All
order_id_tag str? None All
use_hyphens_in_client_order_ids bool True All
use_uuid_client_order_ids bool False All
external_order_instrument_ids list[InstrumentId]? None 9
instrument_id InstrumentId BTCUSDT-PERP.BINANCE All
client_id ClientId? None All
order_qty Quantity 0.001 All
order_display_qty Quantity? None 2, 7
order_expire_time_delta_mins PositiveInt? None 2
order_params dict? None 7, 10
subscribe_book bool False
subscribe_quotes bool True
subscribe_trades bool True
book_type BookType L2_MBP
book_depth PositiveInt? None
book_interval_ms PositiveInt 1000
book_levels_to_print PositiveInt 10
open_position_on_start_qty Decimal? None 1, 9
open_position_on_first_quote bool False 1
open_position_time_in_force TimeInForce GTC 1
enable_limit_buys bool True 2, 4, 5, 6
enable_limit_sells bool True 2, 4, 5, 6
enable_stop_buys bool False 3, 4
enable_stop_sells bool False 3, 4
tob_offset_ticks PositiveInt 500 2, 4
limit_time_in_force TimeInForce? None 2, 6
stop_order_type OrderType STOP_MARKET 3
stop_offset_ticks PositiveInt 100 3
stop_limit_offset_ticks PositiveInt? None 3
stop_trigger_type TriggerType DEFAULT 3
stop_time_in_force TimeInForce? None 3
trailing_offset Decimal? None 3
trailing_offset_type TrailingOffsetType BASIS_POINTS 3
enable_brackets bool False 6
batch_submit_limit_pair bool False 2, 5
bracket_entry_order_type OrderType LIMIT 6
bracket_contingency_type ContingencyType OUO 6
bracket_tp_order_type OrderType LIMIT 6
bracket_offset_ticks PositiveInt 500 6
modify_orders_to_maintain_tob_offset bool False 4
modify_stop_orders_to_maintain_offset bool False 4
cancel_replace_orders_to_maintain_tob_offset bool False 4
cancel_replace_stop_orders_to_maintain_offset bool False 4
trigger_limit_order_maintenance_once bool False 4
use_post_only bool False 2, 6, 7, 8
limit_aggressive bool False 2
use_quote_quantity bool False 1, 7
emulation_trigger TriggerType? None 2, 3
use_individual_cancels_on_stop bool False 5
cancel_orders_on_stop bool True 5, 9
close_positions_on_stop bool True 9
close_positions_qty_precision int? None 9
close_positions_time_in_force TimeInForce? None 9
reduce_only_on_stop bool True 7, 9
use_batch_cancel_on_stop bool False 5
dry_run bool False
log_data bool True
test_reject_post_only bool False 8
test_reject_reduce_only bool False 8
test_modify_rejected bool False 4
can_unsubscribe bool True 9
clamp_to_instrument_price_range bool False 1-8, 10
log_events bool True All
log_commands bool True All