With the help of Quantopian high level API, let’s first implement a 5 day mean reversion buy & sell strategy on stock market. (strategy written in Python)

**Hypothesis**: based on previous 5 day returns, bottom 10% stocks will likely go up and top 10% stocks will likely go down. Therefore, on the beginning of 6th day, we buy bottom 10% and sell top 10% stocks.

**Time period: ** from 2016-01-01 to 2016-07-07

**Trade Frequency:** weejkt rebalancing on the first trading day of the week at market

at 11 AM EST

**Initial Capital:** $1M

**Performance Chart: **

**Performance Analysis: **

**Alpha = 0.17 & Beta = 0.08**

After running strategy for the first half of 2016, this strategy beats Benchmark return (SPY) for 4.6% with **Alpha=0.17**, and very insensitive to benchmark market performance with only **Beta=0.08**, considering this is a market neutral strategy. Normally, we should expect higher Alpha and lower Beta to generate profitability regardless to market movement.

**Sharpe Ratio = 0.87**

Sharpe Ratio is defined as :

(**Portfolio Return – Risk-Free Rate) / Portfolio Standard Deviation**

Sharpe Ratio helps us to evaluation portfolio performance by looking at risk-adjusted return instead of pure accumulated return without considering any big porfolio value swing.

**Sortino Ratio = 1.65**

Sortio Ratio is defined as :

**(Portfolio Return – Risk-Free Rate) / Portfolio Standard Deviation caused by negative return**

OR

**(Portfolio Return – Risk-Free Rate) / Portfolio Downside risk**

In other words, sortino ratio measures the return to “bad” volatility. (Volatility caused by negative returns is considered bad or undesirable by an investor, while volatility caused by positive returns is good or acceptable.)

**Information Ratio = 0.43**

Information Ratio is defined as :

**(Return of the portfolio – Return of the index or benchmark) / Tracking error**

** Tracking error is standard deviation of the difference between returns of the portfolio and the returns of the index. *

Information Ratio measures the consistency of this portfolio performance. This ratio will identify if a manager has beaten the benchmark by a lot in a few months or a little every month. The higher the information ratio the more consistent a manager is and consistency is an ideal trait. For this strategy’s information ratio (0.43) specifically, it isn’t ideal.