Hi QC community,

I got into quantitative trading and QuantConnect about a month ago and I’m excited to share my first algorithm. 

Fundamental reason: Imagine having two assets with zero return and high volatility. If we buy just one, we are not going to earn anything. However, buying both and periodically rebalancing forces us to buy the asset that has decreased in relative value and sell the asset that has appreciated (thus taking profit) in relative value (as measured by their weights in the portfolio). As a result, we earn a so-called “rebalancing premium” or “diversification return.” (more details on Quantpedia). 

Universe: Take all USD pairs on FTX, filter those that are showing a mean-reversion pattern (using bollinger bands), and select the top 25 by daily trading volume. Refresh the universe weekly. We filter for mean-reverting assets as assets showing momentum are less likely to earn a rebalancing premium (we'd be better off to buy-and-hold those). 

Strategy: Equal weighting across all assets in our universe, rebalanced daily. Every day, we buy the assets that have decreased in value and sell the assets that have appreciated, thus obtaining the “rebalancing premium”. 

Drawdown protection: Don't let the portfolio overall or any individual cryptos in our portfolio drop by more than 30% on a single day. 

The backtesting results for this algo seem decent. That said, I’m new to QC, and would love feedback from the community on: 

1) Any thoughts on coding style / am I using the correct QC patterns? 

2) Are there any pitfalls I have not taken into account that might make the algorithm perform poorly during live trading? 

3) Setting the drawdown limit at 30% seems arbitrary, so I'm curious whether there's a more elegant way to minimize drawdown without impacting performance. 

Huge thank you to Alexandre Catarino for showing me how to construct a scheduled crypto universe in QuantConnect, and to Fred Painchaud for providing feedback on my code and helping me better understand the LEAN API.