Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Positive Acceleration in Thinly Traded Stocks

The algorithm seeks stocks in the bottom 1% of the universe that exhibit 2 straight days of positive slope and 1 day of positive acceleration. Thoughts?

2 responses

hi,
Run a full backtest and check the transactions. Seems you are buying with extreme leverage. Take a look at get_open_orders and order_target instead of order. This will avoid you are ordering and ordering and ordering...
Example can be found here.
J.

This is not a universe that will work, IMHO. Too many companies in this percentile go out of business. The backtester does not handle this situation well, and it keeps the last price and extends it forward. If you keep track of the value of your portfolio sans the bankrupt companies like I do, you will quickly see your total value (marked "rpv" on my chart for Real Portfolio Value) go to zero using this strategy.

You have to remember, you have selected the very bottom of the dollar VOLUME universe... it can be hard to buy or sell any amount of stock down there... there just isn't any volume.

(Sorry about the convoluted code in the backtest - it's far more complicated than it needs to be. But if you want to use the set_universe function, I'm afraid you'll need a lot of similar code to handle the weirdness. And notably, you cannot trust the blue "Algorithm" line, since it includes all of your bankrupt holdings at their last market price!)