Class SorExecution

java.lang.Object
com.quantfinlib.backtest.SorExecution
All Implemented Interfaces:
ExecutionModel

public final class SorExecution extends Object implements ExecutionModel
Smart-order-routed execution over a synthetic fragmented market. Each bar, a top-of-book is derived from the bar (close ± half-spread; each venue's touch size = its liquidity share of the bar volume) and the parent order is split by SmartOrderRouter. Liquidity is finite per bar, so large parents fill across several bars — making liquidity cost and fill duration part of the backtest instead of an assumption.
  • Constructor Details

  • Method Details

    • worstCaseCostFraction

      public double worstCaseCostFraction()
      Description copied from interface: ExecutionModel
      Upper bound on this model's all-in cost as a fraction of ExecutionModel.referencePrice(com.quantfinlib.core.BarSeries, int) (spread + fees + slippage). The engine uses it to size entries so that a fully-filled parent can never overdraw cash — a model whose fills can cost more than referencePrice * (1 + worstCaseCostFraction()) MUST override one or both methods, or the backtest silently trades on margin it doesn't have. Wrappers must DELEGATE both to the model that actually prices the fills. Default 1%.
      Specified by:
      worstCaseCostFraction in interface ExecutionModel
    • execute

      public List<Execution> execute(Side side, long requestedQty, BarSeries series, int index)
      Description copied from interface: ExecutionModel
      Executes up to requestedQty on this bar. Must never fill more than requested; may fill less (or nothing) — the remainder is retried on subsequent bars.
      Specified by:
      execute in interface ExecutionModel