Price Impact

Calculate the price impact of trading per asset and period: how much the price moves per unit traded, with Kyle’s, Amihud’s or Hasbrouck’s lambda as the regression slopes of López de Prado (2018, chapter 19.4) or with the Roll Impact (section 19.3.2).

Each lambda is the slope of a regression, without an intercept, of the daily price changes on a measure of the trading of the day, over the days within the period. A high value is an illiquid asset, in which trading moves the price a lot:

  • Kyle’s lambda: Kyle (1985) models market makers who cannot tell informed from uninformed orders and move the price by \(\lambda\) per share of net order flow. The price change of a day is regressed on its Volume, signed with the tick rule (a rise is buying, a fall selling).
  • Amihud’s lambda: the absolute log return of a day is regressed on its dollar volume. This is the regression form of the Amihud (2002) illiquidity ratio (get_amihud_illiquidity, the mean of the ratios), which weighs the days by their dollar volume, so a quiet day with a large move does not dominate it.
  • Hasbrouck’s lambda: Hasbrouck (2009) uses the square root of the signed dollar volume, as the impact of an order grows less than proportionally with its size. The log return of a day is regressed on the square root of its dollar volume, signed with the tick rule.
  • Roll Impact: the Roll (1984) spread of the period (see get_roll_spread) divided by the mean dollar volume of its days, the spread paid per dollar traded.

The measures are mostly used to compare assets and periods: a rising lambda is a market that has become thinner. Their level depends on the size of the asset (a large cap trades billions of dollars a day), so compare assets of a similar size or look at the changes over time.

The formula is as follows:

For Kyle’s lambda:

\[b_{t} = \operatorname{sign}(\Delta P_{t}),\;\; \text{or}\;\; b_{t-1} \;\text{when}\; \Delta P_{t} = 0\] \[\Delta P_{t} = \lambda \cdot (b_{t} \cdot V_{t}) + \epsilon_{t}\] \[\text{Kyle's Lambda} = \frac{\sum(\Delta P_{t} \cdot b_{t} \cdot V_{t})}{\sum((b_{t} \cdot V_{t})^{2})} \cdot \text{1,000,000}\]

For Amihud’s lambda:

\[\left|r_{t}\right| = \lambda \cdot \text{DV}_{t} + \epsilon_{t}\] \[\text{Amihud's Lambda} = \frac{\sum(\left|r_{t}\right| \cdot \text{DV}_{t})}{\sum(\text{DV}_{t}^{2})} \cdot \text{1,000,000,000}\]

For Hasbrouck’s lambda:

\[b_{t} = \operatorname{sign}(r_{t}),\;\; \text{or}\;\; b_{t-1} \;\text{when}\; r_{t} = 0\] \[r_{t} = \lambda \cdot (b_{t} \cdot \sqrt{\text{DV}} \;\text{}_{t}) + \epsilon_{t}\] \[\text{Hasbrouck's Lambda} = \frac{\sum(r_{t} \cdot b_{t} \cdot \sqrt{\text{DV}} \;\text{}_{t})}{\sum(\text{DV}_{t})} \cdot \text{1,000,000}\]

For the Roll Impact:

\[\text{Roll Spread} = 2 \cdot \sqrt{- \operatorname{Cov}(\Delta P_{t},\; \Delta P_{t-1})}\] \[\text{Roll Impact} = \frac{\text{Roll Spread}}{\operatorname{Mean}(\text{DV}_{t})} \cdot \text{1,000,000,000}\]

Where \(\Delta P_{t}\) is the change of the Close, \(V_{t}\) the Volume, \(\text{DV}_{t}\) = Close_t * \(V_{t}\) the dollar volume and \(r_{t}\) the log return of the Adjusted Close (continuously compounded) on day t; the sums, the covariance (with n - 1 in the denominator) and the mean run over the days within the period. The default scale makes the measures of stocks readable: Kyle’s lambda is the change of the price per million shares of net buying, Amihud’s lambda the absolute log return per billion dollars traded (as get_amihud_illiquidity is shown), Hasbrouck’s lambda the log return per square root of a dollar times 1,000,000 and the Roll Impact the spread in price units per billion dollars traded a day.

Also known as: price impact coefficient, Kyle’s lambda, market depth, Amihud’s lambda, Hasbrouck’s lambda, Roll impact.

Example · SNAP, ETSY, LYFT · 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_price_impact:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["SNAP", "ETSY", "LYFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-06-30",
)

toolkit.risk.get_price_impact()

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

How much did trading move the prices of Snap, Etsy, Lyft and the S&P 500 in each month of the first half of 2025, measured by Kyle's lambda?

Which returns:

Parameters

get_price_impact accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe period each regression runs within. Options are: “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “monthly”."weekly"
rollingintRegress on the days of the last rolling periods together instead of one period (e.g. period=’monthly’ and rolling=3 for a three-month lambda at every month end). At least 2. Defaults to None.4
methodstrThe measure. Options are: “kyle” (Kyle’s lambda), “amihud” (Amihud’s lambda), “hasbrouck” (Hasbrouck’s lambda), “roll” (Roll Impact). Defaults to “kyle”."kyle"
scalefloat | NoneA multiplier applied to the measure for readability. Defaults to None, which uses 1,000,000 for method=”kyle” and “hasbrouck” and 1,000,000,000 for “amihud” and “roll”.1000000000.0
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the measure over time. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Kyle, A. S. (1985). “Continuous Auctions and Insider Trading.” Econometrica, 53(6), 1315-1335.
  • Paper Amihud, Y. (2002). “Illiquidity and Stock Returns: Cross-Section and Time-Series Effects.” Journal of Financial Markets, 5(1), 31-56.
  • Paper Hasbrouck, J. (2009). “Trading Costs and Returns for U.S. Equities: Estimating Effective Costs from Daily Data.” The Journal of Finance, 64(3), 1445-1477.
  • Paper Roll, R. (1984). “A Simple Implicit Measure of the Effective Bid-Ask Spread in an Efficient Market.” The Journal of Finance, 39(4), 1127-1139.
  • Paper López de Prado, M. (2018). “Advances in Financial Machine Learning.” Wiley, sections 19.3.2 and 19.4.
Share