5 ms·
The site is pretty slick, but the backtest I ran when I cloned the algo is pretty slow. It's been running for about 10+ mins now and it's only 40% done. As we
by steven2012 14y ago
The site is pretty slick, but the backtest I ran when I cloned the algo is pretty slow. It's been running for about 10+ mins now and it's only 40% done.
As well, in the logs, when I see stuff like:
2012-05-31handle_data:35INFO -63.520880 shares of Security(6109) sold.
it doesn't really inspire a lot of confidence. What does it mean that -63.520880 shares were sold? Does that mean they were bought? And the fact that you are purchasing fractional shares also doesn't inspire a lot of confidence.
- jbredeche 14y ago(disclaimer: I work for Quantopian) I can't speak for the author of the algo, but from the algo, it looks like the relevant lines for your question are 34 (order(stock,indicator * context.bet_amount)) and 35 (log.info("%f shares of %s sold." %(context.bet_amount * indicator,stock)). Our backtester (Zipline) will only order whole number of shares, obviously. If you pass it a fractional number, we take the floor: https://github.com/quantopian/zipline/blob/master/zipline/gens/tradesimulation.py#L217 https://github.com/quantopian/zipline/blob/master/zipline/ge... The log line you're seeing should probably flip the sign of the number of shares before logging. order(-63, sid(6109)) means sell 63 shares of security 6109. The log line is simply logging the negative value instead of the positive one. Users can log anything they want in their backtest. As for the slow performance, apologies - being on HN has resulted in a lot of people running this algo and while we're scaling up new servers, it's taking a bit of time to distribute load. thanks for using Quantopian! [Edit - added source link to Zipline's order method]