Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Algo won't start?

Hi guys. As little as a few months ago whenever I would create code and run an algo if the code was wrong I would get the debugger and it would tell me where I was off. I haven't been to Quantopian in a few months, so maybe I missed something, but now I simply get an error message saying the algo will not start. Can someone help? My code is below.

def initialize(context):  
    context.security = symbol('XOM')  
# Will be called on every trade event for the securities you specify.  
def handle_data(context, data):  
    print(data)

    current_price = data[context.security].price  
    current_positions = context.portfolio.positions[symbol('XOM')].amount  
    cash = context.portfolio.cash


    if (current_positions*current_price < 2500) and  
        order_target_percent(context.security, .05)  
    if (current_positions*current_price > 10000) and  
        order_target_percent(context.security, .05)  

Thanks!

2 responses
def initialize(context):  
    context.security = symbol('XOM')  
# Will be called on every trade event for the securities you specify.  
def handle_data(context, data):  
    #print(data)

    current_price = data[context.security].price  
    current_positions = context.portfolio.positions[symbol('XOM')].amount  
    cash = context.portfolio.cash


    if (current_positions*current_price < 2500):  
        order_target_percent(context.security, .05)  
    if (current_positions*current_price > 10000):  
        order_target_percent(context.security, -0.05)  

Thank you!