Equal-weight ETF allocation with automatic rebalancing
quantopian.com
quantopian.com
I'd love to hear if other HN readers are playing with algorithmic trading. I occasionally think quantitative trading would be fun because of the intersection of math/stats and CS. Of course, that's an "in the abstract" statement. Depending on it for my mortgage would be . . . different.
The stress is always there, though you become desensitized to it after a while, or you just quit in a stress induced rage:(
I'm Canadian so my knowledge is skewed to the Canadian markets.
My email is in my profile if you'd like to chat.
Yes, I know you take property security. There's always some bug or flaw you don't know about. Because you're logging in to the clients brokerage account, that means your software has access to their UNENCRYPTED UNHASHED password.
Also, there are reasons to NOT automatically rebalance every 21 days. Long-term games are better than short-term gains (unless it's an IRA). In addition to commissions, there's the cost of the bid/ask spread, not included in your calculation.
You will need to authenticate to your Interactive Brokers account. (Note: Quantopian does not store your brokerage password.)*
A neat way to do this would be to use your IRA only for the balancing portion. So suppose you have 100k "normal" money invest and 10k in an IRA. Allocate it all even (in both accounts), and when rebalancing needs to occur, do it in the IRA. The normal account stays unbalanced, but the IRA goes way out of balance in the other direction to make up for it. It'd be interesting to see how much "normal" money could be balanced by a $1 of IRA money, historically.
Is the claim that this is somehow a better approximation? Are there some tax loss harvesting benefits? What am I missing?
Is there any theory behind this sort of weighting or is just one of those things that someone figured was worth a shot?
Another way to think about it: market cap weighting is a momentum strategy. Equal across sectors is mean reversion.
In this case, the equal weighting is abstracted away by 1 layer - each ETF is already cap weighted, so you aren't getting the full effect of equal weighting. Instead, you're reallocating to the ETF that has underperformed relative to all others, so as already pointed out, you are betting on reversion rather than momentum.
Just because the sector is big doesn't mean the companies in that sector are big.
If the sector is big because it has a lot of medium/small sized constituents you gain from this implementation because a cap weighted index would under allocate to these smaller names.
The algo author wrote a detailed explanation of the outperformance of the S&P 500 here (source code included): https://www.quantopian.com/posts/equal-weight-all-sector-str...
Also, the chart in the page is from actual trading on a roughly $25k account, and updates each day.
Very impressed with the product btw. Good work.
Full disclosure, I work for Quantopian and I wrote this strategy.