Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
New Algo....good returns, but I'm worried about some other factors

Hi,

I've created a new algorithm from scratch and have attached the tear sheet. I'm not quite sure how to interpret the results apart from the returns. (Underwater, Turnover, etc...) . Please take a look and let me know what you think and some areas where I need to pay closer attention.

Blessings,
Steve

5 responses

have you looked into what it's buying and selling?

some warning signs of "too good to be true" results:

unfilled orders
short selling leveraged etfs (UVXY a common culprit)
leverage going well above 1 when it's not supposed to
leverage going well below 1 when it's not supposed to

Is it a bad idea to short sell leveraged etfs if you can generate returns?

Can you help me to understand when it is bad for the leverage to go slightly above 1 or slightly below 1? I don't really understand this metric.

Looking at your algorithm, you could maybe call this the 'Extreme Reversion' strategy. And yes, it has some merit but also some drawbacks. I didn't see any runaway leverage (generally around 1) and, with a cursory look, saw only equities and not ETFs etc being traded.

It's really based upon one of the two pillars of technical analysis 'prices will revert to the mean' (the other pillar is 'prices will not revert to the mean but continue with a trend). By selecting stocks with such huge price swings (16% in one day as an example) one can almost guarantee this spike to be an anomaly and the price will revert closer to what it was beforehand.

The biggest problem with this strategy is the small number of securities being traded and therefore it's limited scalability. The second biggest problem is the potential for huge swings and drawdowns. Backtest using more starting capital (you started with only $12,000) and then backtest over different date ranges, and one can see very different results.

I'd also have some concerns about the actual 'tradability' of this algorithm. One line of code specifically jumps out as 'suspicious'. That is this

dollar_volume = AverageDollarVolume(window_length=1)

In effect, this does nothing or at least not what one would typically use 'AverageDollarVolume' for. Typically a check like this is to ensure one doesn't get into a position with low liquidity. Many of the algorithm's picks were the day after a huge volume increase (which follows from the huge price swing). Choosing a window size of only 1 day obscures the fact that before and perhaps after that time the volume was and will be very thin. This check doesn't do a lot to keep one out of a low liquidity position. That said, the backtest slippage function does a pretty good job of catching this and warning of unfilled orders. Watch for that in the backtest. (also, if one were to trade this in real life make sure to use limit orders which is typically a good idea anyway).

Another practical matter is that not all the securities chosen may be 'shortable'. This is hard to account for in the backtests but generally takes care of itself if a large number of high volume low risk stocks are traded. This may not be the case here. One can always go long however. Maybe check your results using a long only version of this?

I'd look for ways to get more stocks involved and ensure those stocks are liquid enough to get in and out. Even if that lowers the returns it may raise your chances of being able to see these results in real trading.

Maybe limit to the Q1500US and take the top 10 (I tried this and the returns were not so good). Maybe try to distinguish the stocks where the huge gains are warranted verses over-reaction somehow. Also, maybe give yourself more time to exit a position and not simply trade the next day.

This isn't how one would want to invest their entire 401K but could have some merit as a small part of a larger strategy. As I started with, it's really a 'mean reversion' strategy taken to the extremes. Mean reversion strategies do have some sound rational behind them.

Thank you for this excellent and thoughtful feedback.

I will attempt to use Q500US, increase the number of securities traded to about 5 long and 5 short, change the rebalance period to weekly.