About this question
Medium · market microstructure · Quant Researcher interview question · microstructure, liquidity, pandas, numpy
The quoted spread represents the displayed cost of trading based on the best bid and ask prices, while the effective spread captures the actual cost paid by traders relative to the mid-price, accounting for price improvement and impact. These metrics are fundamental for transaction cost analysis (TCA) and algorithmic trading strategy evaluation. Task Implement a function solution(trade_prices, bids, asks) that calculates the average Quoted Spread and average Effective Spread for a sequence of t