Class SorExecution
java.lang.Object
com.quantfinlib.backtest.SorExecution
- All Implemented Interfaces:
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.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSorExecution(List<SorExecution.VenueConfig> venues, double halfSpreadBps, boolean preferDark) -
Method Summary
Modifier and TypeMethodDescriptionExecutes up torequestedQtyon this bar.doubleUpper bound on this model's all-in cost as a fraction ofExecutionModel.referencePrice(com.quantfinlib.core.BarSeries, int)(spread + fees + slippage).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.quantfinlib.backtest.ExecutionModel
onParentOrder, referencePrice
-
Constructor Details
-
SorExecution
public SorExecution(List<SorExecution.VenueConfig> venues, double halfSpreadBps, boolean preferDark)
-
-
Method Details
-
worstCaseCostFraction
public double worstCaseCostFraction()Description copied from interface:ExecutionModelUpper bound on this model's all-in cost as a fraction ofExecutionModel.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 thanreferencePrice * (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:
worstCaseCostFractionin interfaceExecutionModel
-
execute
Description copied from interface:ExecutionModelExecutes up torequestedQtyon this bar. Must never fill more than requested; may fill less (or nothing) — the remainder is retried on subsequent bars.- Specified by:
executein interfaceExecutionModel
-