I am trying to test a simple code with Schedule function but it keeps showing error. Please tell me what is wrong
def initialize(context):
context.security = symbol('AAPL')# Run handle_entry at 10:00 every day schedule_function(handle_entry, date_rules.every_day(), time_rules.market_open(minutes=30)) def handle_entry(context, data): #Go long if open price is higher than prior day close close_price = history(2, '1d', field='price') open_price = history(2, '1d', field='open_price') if close_price < open_price: order(sid(24), 50) def handle_data(context, data): pass