Class MarketImpactModel

java.lang.Object
com.quantfinlib.microstructure.MarketImpactModel

public final class MarketImpactModel extends Object
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.
All results in basis points of the arrival price. Coefficients default to commonly cited magnitudes; calibrate per market with withCoefficients(double, double, double).
  • Constructor Summary

    Constructors
    Constructor
    Description
    MarketImpactModel(double adv, double dailyVolatility)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    estimate(BarSeries series, int index, int window)
    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.
    double
    expectedCostBps(double quantity, double participationRate)
    Expected implementation cost of executing quantity at the given participation rate: half the permanent impact (average price concession over the schedule) plus the full temporary impact.
    double
    permanentImpactBps(double quantity)
    Permanent (information) impact, linear in size relative to ADV.
    double
    squareRootImpactBps(double quantity)
    Square-root-law total impact for an order of quantity.
    double
    temporaryImpactBps(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).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MarketImpactModel

      public MarketImpactModel(double adv, double dailyVolatility)
  • Method Details

    • withCoefficients

      public MarketImpactModel withCoefficients(double y, double etaBps, double gamma)
      Returns a copy with calibrated coefficients (square-root Y, temporary eta bps, permanent gamma).
    • estimate

      public static MarketImpactModel estimate(BarSeries series, int index, int window)
      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. Returns null when 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 of quantity.
    • 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 executing quantity at the given participation rate: half the permanent impact (average price concession over the schedule) plus the full temporary impact.