I've seen a lot of people are posting their algos to get feedback or are collaborating publically. I wanted to share mine and join the effort.

The attached algo finds stocks with a 4 day EMA twice the 30 day EMA, and shorts them. Other values such as 10/50 and 2/25 also work well. Other parameters are also configurable.

Unfortunately, I've struggled to get this algo to a point I like. The biggest issue is that a big move against you leads to a margin call, forfeiting all gains. This has happened in other backtests. I've tried to manage this with position sizing and portfolio rebalancing, but it isn't as robust as I'd like.

I'm open to all ideas. Some alternatives I've considered to shorting (but not yet implemented) are bear call spreads, long puts, and bear put spreads. All benefit from defined maximum losses and some also benefit from high IV.