Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Stock & Bond Risk Parity

rebalance per month

5 responses

Since you are using QQQ probably best to see how it worked during the tech crash.

Can't recall whether I have done the test!

I am a bit late, but are you assuming QQQ and TLT to have the same Sharpe ratio, aren't you?

I'm not sure I would use either. I would probably opt for a broader based stock index such as the MSCI World and a much shorter term bond index - again probably International. Max diversification.

Nice work! I'm a beginner but I would recommend using the same QQQ as a benchmark, just to compare apples with apples :)

def initialize(context):  
    #set_slippage(slippage.VolumeShareSlippage(volume_limit=0.025, price_impact=0.1))  
    context.asserts = symbols('QQQ', 'TLT')  
    # unused if volatility_policy is true  
    context.asserts_position = [0.40, 0.60]  
    context.rebalance_inteval = 'M'  
    context.rebalance_date = 0  
    context.volatility_policy = True  
    #unused if volatility_policy is false  
    context.volatility_days = 252  
    context.volatility_price_history = 21  
    set_benchmark(sid(19920))  
    set_commission(commission.PerShare(cost=0.005, min_trade_cost=1.00))  
    context.fired = False