Why Mean Reversion Conflicts with Index Replication
Summary
The document examines whether a cross sectional mean reversion strategy can replicate an equity index using a subset of its components. The proposed signal buys stocks whose returns lag the universe and shorts those that outperform. The response explains that this active long short positioning differs from index replication: an index portfolio holds long positions according to index weights, while mean reversion trades can move holdings away from those weights and increase tracking error.
A possible compromise is to hold a weighted subset of index constituents and apply mean reversion to those names, with periodic rebalancing toward index weights. That portfolio can resemble part of the index when its positions remain long, but the document does not specify a signal, rebalancing rule, or evaluation method. It also does not solve the user's implementation question about adapting price data to a backtesting library's required format, so the discussion is conceptual rather than a complete replication workflow.
Key ideas
- Index replication generally uses long holdings aligned with constituent weights.
- Shorting outperformers and buying underperformers creates active exposures that can diverge from the index.
- Mean reversion trades can increase tracking error relative to a benchmark index.
- A weighted subset of constituents can be combined with reversion trading and periodic rebalancing.
- The document does not provide code or performance evidence for the proposed compromise.
Tags
Full text
# Mean-reverting backtest between index and components
# Mean-reverting backtest between index and components
I am a beginner with ETF replication: I have to make a code to make the value of my assets go back to the average of the index Eurostoxx 50 with a subset of components. I am not sure how to implement it.
I have understood that typically, a cross-sectional mean reversion strategy is fed a universe of stocks, where each stock has its relative returns compared to the mean returns of the universe.
- a stock with a positive relative return is shorted
- a stock with a negative relative return is bought
But is it what I have to adapte to replicate an ETF?
I know how to code a mean-reverting strategy:
```
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
from backtesting.test import SMA, GOOG
class SmaCross(Strategy):
def init(self):
Close = self.data.Close
self.ma1 = self.I(SMA, Close, 10)
self.ma2 = self.I(SMA, Close, 20)
#self.boll = bt.indicators.BollingerBands(period=self.p.period, devfactor=self.p.devfactor)
def next(self):
if crossover(self.ma1, self.ma2):
self.buy()
elif crossover(self.ma2, self.ma1):
self.sell()
bt = Backtest(GOOG, SmaCross,
cash=10000, commission=.002)
bt.run()
bt.plot()
```
But, first I don't know how to do mean reverting to go back to the index (SX5E) and, second, I don't know how to adapt my dataset to the one `Backtest` is expecting `('data' must be a pandas.DataFrame with columns 'Open', 'High', 'Low', 'Close', and (optionally) 'Volume`).
My dataset looks is fully accessible here and looks like the following:
```
ABI BB Equity AD NA Equity ADS GY Equity AI FP Equity AIR FP Equity AMS SQ Equity ASML NA Equity BAS GY Equity BAYN GY Equity BBVA SQ Equity BMW GY Equity BN FP Equity BNP FP Equity CRH ID Equity CS FP Equity DAI GY Equity DG FP Equity DPW GY Equity DTE GY Equity EL FP Equity ENEL IM Equity ENGI FP Equity ENI IM Equity FP FP Equity FRE GY Equity GLE FP Equity IBE SQ Equity INGA NA Equity ISP IM Equity ITX SQ Equity KER FP Equity LIN GY Equity MC FP Equity MUV2 GY Equity NOKIA FH Equity OR FP Equity ORA FP Equity PHIA NA Equity SAF FP Equity SAN FP Equity SAN SQ Equity SAP GY Equity SIE GY Equity SU FP Equity TEF SQ Equity URW NA Equity VIV FP Equity VOW3 GY Equity SX5E Index
Dates
2019-02-27 09:00:00 65.65 22.870 212.40 109.95 113.32 69.24 162.14 67.25 68.79 5.2590 73.67 67.18 43.275 27.60 21.830 53.00 82.42 26.680 14.455 106.60 5.314 14.065 15.220 49.910 48.500 25.805 7.372 11.338 2.0830 26.22 484.20 152.80 303.55 207.1 5.3660 222.0 13.320 35.105 118.40 72.93 4.1550 94.00 97.30 68.64 7.573 143.46 24.23 150.30 3279.78
2019-02-27 09:10:00 65.69 22.490 212.20 109.90 113.20 69.16 162.32 67.21 67.96 5.2310 73.59 67.16 43.045 27.53 21.840 52.82 82.50 26.700 14.485 107.05 5.320 14.065 15.212 49.925 48.530 25.700 7.364 11.300 2.0790 26.09 483.90 152.95 303.20 206.8 5.3540 221.6 13.360 35.095 118.75 72.95 4.1265 94.27 97.20 68.76 7.558 143.04 24.25 149.80 3275.70
... ...
```
The last column is the index.
## Answer by Pepino (score 0)
https://quant.stackexchange.com/a/50832
You cannot have a strategy which will at the same time perform mean reversion and track an index.
Firstly, index replication is a long-only strategy. No names are shorted in an index. Secondly, every time your mean reversion strategy trades, it will deviate from the index, increasing the tracking error and eventually diverging from it.
What you could have is a portfolio constructed with the biggest weights of a index (your subset) and trade a mean reversion strategy on each of them, appropriately matching the size on each of the names with their weighting in the index, and rebalancing to mirror the index whenever necessary/appropriate.
Yet, this strategy will replicate (part of) the index only when all names are long.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.