Class MarketImpactModel
java.lang.Object
com.quantfinlib.microstructure.MarketImpactModel
Temporary / permanent market impact models for large trades, parameterized
by average daily volume (ADV) and daily volatility:
- Square-root law (empirical standard):
impact = Y * sigma_daily * sqrt(Q / ADV). - Almgren-Chriss style decomposition: linear temporary impact in
participation rate and linear permanent impact in size, with the
expected cost of an execution schedule
E[cost] = permanent/2 + temporary.
withCoefficients(double, double, double).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MarketImpactModelEstimates a model from a series' trailing window: ADV as the mean volume, daily vol as the stdev of close-to-close returns — the one canonical bar-data → impact-model bridge, shared by the alpha and portfolio backtesters so their impact numbers can never diverge.doubleexpectedCostBps(double quantity, double participationRate) Expected implementation cost of executingquantityat the given participation rate: half the permanent impact (average price concession over the schedule) plus the full temporary impact.doublepermanentImpactBps(double quantity) Permanent (information) impact, linear in size relative to ADV.doublesquareRootImpactBps(double quantity) Square-root-law total impact for an order ofquantity.doubletemporaryImpactBps(double participationRate) Temporary (execution-rate) impact at the given participation rate in [0, 1].withCoefficients(double y, double etaBps, double gamma) Returns a copy with calibrated coefficients (square-root Y, temporary eta bps, permanent gamma).
-
Constructor Details
-
MarketImpactModel
public MarketImpactModel(double adv, double dailyVolatility)
-
-
Method Details
-
withCoefficients
Returns a copy with calibrated coefficients (square-root Y, temporary eta bps, permanent gamma). -
estimate
Estimates a model from a series' trailing window: ADV as the mean volume, daily vol as the stdev of close-to-close returns — the one canonical bar-data → impact-model bridge, shared by the alpha and portfolio backtesters so their impact numbers can never diverge. Returnsnullwhen the window has no volume (impact needs ADV; absent volume is a data gap, not free liquidity — callers charge their flat costs and skip impact). -
squareRootImpactBps
public double squareRootImpactBps(double quantity) Square-root-law total impact for an order ofquantity. -
temporaryImpactBps
public double temporaryImpactBps(double participationRate) Temporary (execution-rate) impact at the given participation rate in [0, 1]. -
permanentImpactBps
public double permanentImpactBps(double quantity) Permanent (information) impact, linear in size relative to ADV. -
expectedCostBps
public double expectedCostBps(double quantity, double participationRate) Expected implementation cost of executingquantityat the given participation rate: half the permanent impact (average price concession over the schedule) plus the full temporary impact.
-