Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
real dumb question about order function

i'm doing this simple test using order function.

the first test is to order 100 shares of spy and sell them at the close, the return is 8.69%
then the second test is to order -100 shares (short) spy and then close (buy) them at close, the return is -11.5%

my question is how can this be? aren't they supposed to be exact opposite trades thus the exact negative returns?
If i were ordering by percentage i'd understand but I was ordering by exact the same number of shares...

Someone please help explain... Thanks!

2 responses

If you disable default commission and slippage models:

    set_commission(commission.PerTrade(cost=0.00))  
    set_slippage(slippage.FixedSlippage(spread=0.00))

Results for long and short trades will be absolutely opposite.

that makes a lot of sense, I'll try it out, thank you!