Roll Spread
Calculate the Roll (1984) implied bid-ask spread, per asset.
Roll’s model shows that, under a stylized microstructure model in which the true (efficient) price follows a random walk and observed trade prices randomly bounce between the bid and the ask, the effective spread can be backed out purely from the serial covariance of consecutive price changes, without needing any actual quote data. If the estimated covariance is zero or positive, no valid estimate can be backed out and NaN is returned instead.
The Roll measure is used when no quote data is available, typically for less liquid stocks or historical studies. On daily closes of liquid large caps it mostly picks up price noise rather than the bid-ask bounce, and in trending periods the autocovariance is positive and no estimate exists, so treat it as a rough, relative measure.
For more information about the method, see the following 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.
The formula is as follows:
\[\text{Roll Spread} = 2 \cdot \sqrt{- \operatorname{Cov}(\Delta P_{t},\; \Delta P_{} (t-1))}\] \[\text{Relative Roll Spread} = \text{Roll Spread} / \operatorname{Mean}(P)\]Where P is the Close price, ΔP_t = P_t - P_(t-1) and Cov the sample autocovariance (ddof=1) of consecutive price changes; a covariance of zero or above gives NaN.
Also known as: Roll’s implied spread, Roll measure.
Roll Spread in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_roll_spread as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["KO", "PEP", "PG"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_roll_spread()
Or, after setting up the Finance Toolkit MCP, ask:
What bid-ask spread does the Roll measure imply for Coca-Cola, PepsiCo, Procter & Gamble and the S&P 500 from 2021 to 2025?
Which returns:
| KO | PEP | PG | Benchmark | |
|---|---|---|---|---|
| Roll Spread | 0.173128 | 0.72957 | 0.751753 | 1.97906 |
| Relative Roll Spread | 0.0028038 | 0.00449337 | 0.0049553 | 0.00408282 |
| Autocovariance | -0.00749332 | -0.133068 | -0.141283 | -0.979167 |
| Valid Estimate | 1 | 1 | 1 | 1 |
Parameters
get_roll_spread accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
within_period | bool | Whether to calculate the spread within the specified period or for the entire period. Defaults to False. Note that this requires intraday data when period = ‘daily’, since a single day only nests observations when intraday data was fetched. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |