In my quest of a simpler and fully automatic trading strategy I tried to backtest simple strategies based only on the fast and slow HMA signals on BTC and and Alt index. The first results I got were promising.
The next question was: what happens when we combine both strategies? Very good things happens! The alt index is created by selecting the TOP30 alts by market cap.
I developed the following strategy:
- If HMA TOP30 and BTC signals are short we stay 100% in USD
- If HMA TOP30 is long and BTC is short we stay 100% in TOP30
- If HMA TOP30 is short and BTC is long we stay 100% in BTC
And when both are long? What we do? Inspired by the great “Dual Momentum” book from Gary Antonacci I decided to apply something similar to my strategy.
To decide what to do we look at the USD relative gains. If the USD gains were higher in the TOP30 index during the last 29 days we stays in TOP30. We are doing that because they are showing stronger momentum than BTC and we expect this should continue in the following days. Viceversa we stay in a BTC position.
TOP 30 Altcoins Cap Weighted Index
In my work toward simple and automated portfolio strategy I was happy to discover that Shrimpy offers an index feature. Shrimpy is an automatic rebalancing tool. Shrimpy will automatically sell and buy tiny portions of your alts in order to keep them at a prefixed value. Accordingly to their research the optimal performance is achieved by having a 20+ alts portfolio which is rebalanced every hour.
I decided to use this feature when my TOP30 Strategy 1.0 signals a TOP30 position. The index I’m using is following this rules:
- Current TOP 30 Altcoins, the index is always in the top 30 coins ranked my marketcap. The single altcoin position is weighted by the marketcap, the bigger the cap, the bigger the position.
- Max 10% for every position, this reduce the risk factor associated to every coin (do you remember BitConnect?)
- Min 1% for every position.
- Excluded coins: BTC, USDT, TUSDT and other stable coins.
During the TOP30 phase Shrimpy will continue to rebalance every 1h the portfolio to follow the index rules. If some coins enter/exit the TOP 30, Shrimpy will also auto follow that.
In the last months I switched my custom-made backtesting system to a powerful open source engine: backtrader, a feature-rich Python framework for backtesting and trading.
How performant is this strategy? As I’m writing the strategy shows potential 3988x gains since 1st January 2014. This performance is quite close to the 4237x gains of the BMP Strategy 1.0.
Walk-forward testing and particle swarm optimization
Starting today the strategy now auto-tunes the parameters every month by using a walk forward strategy coupled with an optimizer.
Walk-Forward testing is an on-going and dynamic process in order to avoid overfitting. With walk-forward we want to avoid that the strategy is too specific to particular market conditions. To do so every month we look at the last three months market data and we find the best HMA parameters. These parameters are used for one month and then we repeat the process. Thanks to that the strategy is robust and adaptive.
Here is how it work:
The best parameters are found with a Particle Swarm Optimizer (PSO), a robust evolutionary strategy inspired by the social behavior of animal species living in large colonies like birds, ants or fish.
The TOP30 Strategy 1.0 is a completely automated strategy, results are similar to the BMP Strategy 1.0 but they are achieved through a more active and technical approach.
The BMP Strategy 1.0 is slower and less time critical. I believe this strategy is more suitable for trading on micro/low caps coins. These markets cans be very profitable but they are very illiquid. A slower strategy that allows time for accumulation in my opinion is very important for these kind of coins.