Mean reversion

Category : Uncategorized

Mean reversion

Please make sure you have the most updated mfd_dm, mfd_ta and mfd_tex packages for Stata installed for this post.

Mean reversion is one of the more theoretical technical analysis tools. It simply argues that the prices will revert to their means.

Mean reversion test procedure

  • Difference between price and sma
  • While price is above/below the sma, the difference should decrease

Mean reversion test steps

  • For a symbol
  • Download daily prices
  • Calculate Diff=Price-SMA
  • Calculate daily change in Diff (for mean reversion, this change should be negative)

Single stocks mean reversion: 

Screen Shot 2013-09-07 at 7.17.28 PM

AAPL had return that is inline with mean reversion 51.89% of the time. In other words, 51.89% of the time the price moved towards the mean and 48.11% of the time price moved away from it. On average, daily change of difference (price-MA) should be negative to mean reversion. However, 0.0004472 is positive. Thus, it means no reversion.

Multicompany (NYA) and multi SMA window to LaTeX (using all historic prices already downloaded):

Multicompany (NYA) and multi SMA window to LaTeX (downloading prices one by one): 

Multicompany (NYA) and multi SMA window as an update to components.dta: