Engine Strategies

The engine crate defines its own Strategy trait for order-book-aware trading:

#![allow(unused)]
fn main() {
pub trait Strategy {
    fn on_tick(&mut self, obs: &Observation, requests: &mut Vec<OrderRequest>);
}
}

This is a different trait from market_model::PriceStrategy. It operates on Observation (BBO, portfolio, volatility, drift, parameters) and emits OrderRequests (place, cancel, cancel-all) into the exchange.

Available strategies

Avellaneda-Stoikov family

The core market-making strategy with several variants:

  • AvellanedaStoikovStrategy: the canonical AS quotes. Optional online volatility estimation (EWMA rolling window) and real-vol passthrough. Optional permanent price impact adjustment.

  • AvellanedaStoikovHestonStrategy: AS quotes with Heston stochastic volatility dynamics. The strategy observes the current variance from the Observation filter.

  • AvellanedaStoikovHawkesStrategy: AS quotes with Hawkes self-exciting intensity dynamics.

  • AvellanedaStoikovBilateralHawkesStrategy: separate Hawkes intensities for bid and ask sides.

  • AvellanedaStoikovBilateralHawkesOrderFlowImbalanceStrategy: extends the bilateral Hawkes variant with an order flow imbalance signal for additional adverse selection protection.

  • AvellanedaStoikovExactStrategy: uses the exact (non-approximate) AS solution for the optimal spread.

Signal-based strategies

  • SignalEngineStrategy: generic engine strategy driven by one or more PriceStrategy instances. Wraps market_model signals (MaCrossover, RsiStrategy) and translates them to exchange orders. Supports:
    • Multiple signal sources with AND/OR/Majority voting (SignalCombinator).
    • Configurable position sizing: fixed quantity or fraction of wealth.
    • Convenience constructors: new_ma(fast, slow, qty), new_rsi(window, oversold, overbought, qty). This strategy is a heuristic — no HJB or optimal-control derivation.

Baseline strategies

  • ConstantSymmetricStrategy: posts a fixed spread around the mid price. Good for isolating the effect of spread width.

  • KellyStrategy: growth-optimal (Kelly) market making. CARA-based approximation — not a rigorous log-utility HJB solution. Estimates drift and volatility online from recent prices via EWMA. Computes target inventory q* = mu/(gamma * sigma^2) and shifts the AS reservation price toward q* instead of zero. Uses CARA spread dynamics with Kelly-inspired inventory bias.

  • KellyRigorousStrategy: rigorous Kelly (log-utility) market making. Rigorous solution. Uses precomputed 3D lookup tables [q, x, tau] from solving the true log-utility HJB via finite difference policy iteration. No CARA approximation. x = cash/mid is the wealth ratio. Contrasts with KellyStrategy which uses the CARA ansatz with a Kelly-inspired target shift.

  • ZeroIntelligenceStrategy and RandomStrategy: random order placement. Used as noise-trader agents in multi-agent simulations.

  • ExternalStrategy: loads strategy parameters from a configuration file. Allows swapping strategies without recompiling.

Observation filtering

Each agent sees a filtered view of the market via ObservationFilter:

  • Transparent: all ground truth visible (volatility, drift, parameters).
  • Opaque: only BBO and portfolio visible.
  • Partial: whitelist of visible parameters.

This lets you test strategies under realistic information constraints: a market maker that cannot observe true volatility must estimate it from price data.