I never thought such as simple algo could fetch 2 sharpe.
I never thought such as simple algo could fetch 2 sharpe.
Works from 2011 only for some reason. Maybe components of XLE were different before that? I am not sure why.
Thanks for that. it worked for me from 2007 (XLF is traded from end of 2006), I noticed that you are shorting the energy ETF= XLF as you said to hedge the long individual energy stocks. Whats the rational behind this algo ?
Agree with Simon. There's potential for survivorship bias here as the code states "Set_symbol_lookup_date('2015-05-01')". You will only be buying those that survived till May 1, 2015.
Can you please explain to me your algorithm? As far as I understand, it's do the following daily:
Compute the 1 day return
Compute the daily mean return
Compute the daily standard deviation of returns
The weights in each security are their normalized Z scores then?
Somewhere, I'm mistaken in my reading of your python code (I'm not very well versed in Zipline), since I get a massive drawdown in 2013.
Thanks for the help.
@Ilya,
Compute the cumulative log returns (not daily returns).
Compute the mean across all stock cumulative log returns.
calculate z score by subtracting mean from each stock's cumulative log return and dividing by standard deviation of cumulative log returns.
So you're saying to compute a running cumulative product from the onset, and not a moving window (EG 5 periods)?
How exactly are you computing your daily returns?
daily_return = prices.pct_change().dropna().values
log_return = np.log1p(daily_return)
cumulative_return = np.cumsum(log_return)
This only seems to work for Energy out of Energy, Financials and Technology sector. I will try to run this for other sectors as well.
I divided the consistency based weighting into two components (Momentum and inverse volatility). The inverse volatility generates some alpha but momentum fails for technology sector. It seems cross-sectional return (finalret) dispersion is an important ingredient for this strategy but the values are not very different across energy and tech sectors. What could be going on?
Thanks for sharing - this looks promising at first, but upon closer inspection, it is just the fact that with QE everyone wins. If you test it between 2007 to 2011, this system has a negative sharp.