Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
QQQ market open trade, with 3X long/short QQQ ETFs as indicators

Something to play with.

3 responses

Here's a longer run (back to the earliest date possible), with a slight change in the code to:

if v_z_diff[-1] < -6.5*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,-2.5)  
    elif v_z_diff[-1] > 6.5*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,2.5)  
    else:  
        order_target_percent(context.qqq,0)  

instead of

f v_z_diff[-1] < -6*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,-3)  
    elif v_z_diff[-1] > 6*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,3)  
    else:  
        order_target_percent(context.qqq,0)  

interesting..good work! Have you tried with less leverage?

@Daniel, feel free to clone the algo and play around with it. To change the leverage conveniently, something like this could be done:

context.leverage = 1

if v_z_diff[-1] < -6.5*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,-context.leverage)  
elif v_z_diff[-1] > 6.5*v_z_diff[0:-1].std():  
        order_target_percent(context.qqq,context.leverage)  
else:  
        order_target_percent(context.qqq,0)  

Here's a research notebook that seems to highlight that TQQQ & SQQQ (+/- 3X QQQ ETFs, respectively) are sometimes somehow "out of whack" at market open, and then settle down. Just a murky observation at this point.