About this question

Rolling Amihud Illiquidity Ratio

Easy · backtesting · Quant Researcher interview question · backtesting, amihud, illiquidity, market-microstructure, rolling-window

The Amihud illiquidity ratio, defined as an asset's absolute return per dollar of trading volume, is a key measure of price impact. Rolling averages of this ratio are essential inputs for liquidity-adjusted return models, transaction cost analysis, and portfolio capacity management. Task Implement the function solution(returns: list, volumes: list, window: int) -> list to calculate the rolling Amihud illiquidity ratio. For each sliding window, compute the average of the daily |return| / volume