Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why this algo outperform SPY so much ?

Hi,

It is not clear for me why this algo outperform SPY so much with no leverage (the only thing it does is to short financial sector during recession, then buy SPY). Could someone explain please ?

Thank's!

6 responses

Almost 40 views and no responses :-(
I understand there is a problem with passing the orders, but how is it possible ?

Your code never sells. You just keep buying when your condition is true over and over. Leveraging continually.

Hi Gregory, I buy SPY there is no leveraging

I added a function to record your leverage and exposure, it looks like the algo does go haywire borrowing. My guess is that it is placing new orders when there are already open orders that have not filled.

Here is a version that doesn't place a new order if there is already an unfilled order for that security. The 'order_target' style orders don't take unfilled orders into account, so you have to check for them in your code.

I added a function to record your leverage and exposure, it looks like
the algo does go haywire borrowing. My guess is that it is placing new
orders when there are already open orders that have not filled.

It is clear, thank you.