Amihud Illiquidity Ratio
Install and import#
npm install fintech-algorithmsimport { amihudIlliquidity } from "fintech-algorithms/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio";Signature#
amihudIlliquidity(closes, dollarVolumes, scale)Average absolute return per unit of dollar volume — how much price moves per dollar traded. The most widely used low-frequency illiquidity proxy precisely because it needs only daily data.
Parameters#
| Name | Type | Notes |
|---|---|---|
closes | number[] | Daily closing prices. |
dollarVolumes | number[] | Daily traded value, aligned index-for-index with the closes. |
scale | number | Scaling applied to the raw ratio. The unscaled value is tiny, so published figures are almost always scaled — and papers differ on by how much. min: 0 |
Returns#
{ ratio, daily_ratios, observations, scale }
The averaged ratio with the daily series and the scale applied, since a figure quoted without its scale is not comparable.
Errors#
- When a dollar volume is zero, making the daily ratio undefined — excluded from the average and reported
Complexity: time O(n),
space O(n).
Worked example#
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input#
[100, 101, 100.5, 102, 101.5, 103][1000000, 1200000, 900000, 1500000, 1100000, 1400000]1000000Call#
amihudIlliquidity(closes, dollarVolumes, scale)Returns#
object with 9 fields: model, observation_count, return_count, returns, daily_illiquidity, illiquidity_per_currency_unit, scale, illiquidity_per_scaled_volume, …
{
"model": "amihud-illiquidity",
"observation_count": 6,
"return_count": 5,
"returns": [
0.010000000000000009,
-0.004950495049504955,
0.014925373134328401,
-0.004901960784313708,
0.014778325123152802
],
"daily_illiquidity": [
8.33333333333334e-9,
5.500550055005505e-9,
9.950248756218935e-9,
4.4563279857397345e-9,
1.0555946516537716e-8
],
"illiquidity_per_currency_unit": 7.759281329367046e-9,
"scale": 1000000,
"illiquidity_per_scaled_volume": 0.0077592813293670465,
"state": "estimated"
}Other exports#
This module also exports
quotedSpread, effectiveSpread, realizedSpread, rollSpread, corwinSchultzSpread, calculate. Every module additionally exports run as an alias of its
primary function, and a meta object carrying its catalog id, domain, family,
shape and article URL.
Diagrams#
Calculation flow#
Amihud Illiquidity Ratio validation flow
flowchart LR
A["Question: How much absolute return accompanies one unit of traded dollar volume?"] --> B["Freeze instrument, scope, clock, units, and variant"]
B --> C["Validate Amihud Illiquidity Ratio inputs"]
C --> D{"Eligible and synchronized?"}
D -- "No" --> E["Reject with topic-specific reason"]
D -- "Yes" --> F["Apply the frozen Amihud ratio formula"]
F --> G["Expose intermediate value and decision state"]
G --> H{"Direct measure or model-based proxy?"}
H --> I["Report result with its unit and limitation"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- Amihud (2002), Illiquidity and Stock Returns — Journal of Financial Markets
- NYSE Daily TAQ product description — New York Stock Exchange