Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Knife-Catching Swings

Hello, this is my first algorithm I have worked on. I'm having some problems closing my positions completely, and sometimes they flip to short positions even. I was wondering if anyone could help with that as well as critique the strategy in general.

It's essentially as follows:
x days with successive lower highs
and then two days with higher highs with a stop at the most recent bullish bar's low

Also I'm wondering if anyone could assist with any portfolio allocation. The longer the backtest, the more stocks it diversifies. However, at the beginning the positions grow rather slowly and the strategy has little initial exposure and at the end it can have upwards of 300+ stocks. I've tried limit it to ~30 stocks and limit over exposure in a single equity by making the max weight 10% if < 10.

1 response