Back to Community
Strategy selecting the best end of day Sharpe ratio

Hi Quantopian Community,

I am Stephanie, a director of Portfolio Analytics at PortfolioEffect and I’m excited to share some of what we do. We use high frequency market data to calculate intraday or end of day risk metrics. This involves a new methodology for the calculation of risk that was developed through 5 years of research. The result is more accurate risks estimators. We offer data on volatility and risk factors for 8,000+ financial instruments, including stocks, stock indices and ETFs.

To illustrate the potential utility of our data, we’ve built a sample algorithm that uses it. Using the end of day Sharpe ratio calculated by PortfolioEffect, we compare the end of day Sharpe ratio for the last day to the Sharpe ratio for a 1 week window length on 10 stocks: 'IBM','GOOG','C','F','GM','GE','AAPL','AMZN','CSCO','GS' since 01/04/2013.

By 1 week window length, it means the window length for calculating the metric is 1 week. Weekly Sharpe ratio is calculated on 5 days windows length. Therefore, we look at the Sharpe ratio of the daily vs weekly rate. If the daily Sharpe ratio is greater than the weekly Sharpe ratio, we take a long position, otherwise a short one. At each step of the algo, we buy and sell. For example, we have 8 shares to buy and 2 shares to sale, we buy each share with a quantity of 150% / 8 = 18.75% and sell up to 50% / 2 = 25% of the portfolio. We are creating a changing portfolio containing long and short positions at any given time.

In summary, we buy stocks with good Sharpe ratio through the sale of shares with poor Sharpe ratio.

Take a look at the attached backtest. We would love to hear your thoughts about the algo and the potential uses of the data.

For more information on the data, please feel free to contact Andrei or Steph directly at [email protected]

Best,
Stephanie Toper

Clone Algorithm
106
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 573b67a56aeb770f91516188
There was a runtime error.
4 responses

Why don't you just calculate the sharpe ratio in your code?

Hi Stepanie,

Looks pretty interesting. If I am understanding correctly, the value-add would be a more accurate Sharpe calculation? Essentially reducing variance by increasing sample size? I am wondering what level of data frequency was used to calculate Sharpe ratio in the csv file in your algo?

Thanks

Frank

Hi Mikko,

At PortfolioEffect, we are not using the classical approach of calculating Sharpe ratio using yesterday and today return to calculate it. Our frequency is far higher: we are using high frequency market data. Calculation needs powerful servers and the methodology to calculate the Sharpe ratio using data every second during the day taking into account microstructure noise, price jumps/outliers, fat distribution tails. We provide more risk metrics than Sharpe ratio in our databases like skew, kurtosis, vol, value at risk and much more. We are even working currently on a database for vol forecasting. Through PortfolioEffect API risk metrics can even been seen intraday.

In summary, it will not be possible to calculate Sharpe ratio using high frequency data into your code without years of research.

Best,
Steph

Hi Frank,

Indeed the Sharpe ratio will be more accurate compare to classical method of calculation. PortfolioEffect methodology is reducing variance by increasing sample size as we have high frequency market data. Using High Frequency (HF) data dramatically improves precision of statistical estimates due to the so-called bias-variance tradeoff. HF data provides many more recent/fresh data points, thus decreasing the variance of estimates, without using stale data points that would increase the estimation bias.

In the csv file in the algo, we use a frequency of every second (1s) for the daily Sharpe ratio with a 1 day window length, and for the weekly Sharpe ratio with a 5 business day window length.

Best,
Steph