Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
backtest shows loss of 76% in a day. bug?

I suspect it's a bug with the system.

algorithm hold 20 longs and 20 shorts on 15% most liquid stocks, with portfolio value of $1e6. On june 5th 2014, backtest shows loss of 76% ($760,000) and only thing i can think of is a disappearing portfolio.

is this a know issue?

6 responses

Toan, I have had similar issues pop up in the past. Did you check the transaction logs for the trading activity on 6/5/14? That has always isolated the issue for me in the past and then I just filter said stock out of my strategy.

Frank, thanks!

running a new back test, but looking at the transaction logs, it thinks that with a $60k allocation, it should buy 17 shares of $200k stock (brk-a). but still it doesn't account for the losses since brk-a hardly moves. ok, backtest just finished and it's still there. hmmm.

Not sure if you are dead set on keeping brk-a in the strategy, but if you just wanna bump it out of the strategy all together, I remember a good way to do it from a Q tutorial I watched. If using pipeline, you can just filter the stock out of the pipline like so:

pipeline = pipeline[pipeline.symbol.apply(lambda x: not x.endswith('brk-a'))]

Howdy Frank, Thanks for that. I did get brk-a booted, and it removed my massive loss--but still, that's a bug in the system though right?

I used slightly different syntax:
context.output = context.output.drop([sid(1091)], 0)

Yea not sure on that, but I bet the switch to Q2 caused a bug similar to what was fixed in the past.:

https://www.quantopian.com/posts/berkshire-hathaway-not-available

toan tran,

There is a bug in BRK-A historical data but that happened not on june 5th 2014.
The best way to get help is publish that algo. (Attach, backtest, select algo, select bactest, attach, reply}.