About this question
Medium · backtesting · Quant Researcher interview question · pairs_trading, statistical_arbitrage, z_score, log_spread, backtesting
The z-score of a price spread is a key signal in statistical arbitrage, particularly for pairs trading. This metric quantifies the deviation of a cointegrated pair's price ratio from its historical mean, allowing traders to identify potential mean-reversion opportunities. Quantitative trading desks use this rolling z-score to generate entry and exit signals for their strategies. Task Implement the function pairs_zscore(series_a, series_b, lookback) to calculate the rolling z-score of the log pr