Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
schedule function dont seem to work? doesnt seem to show the correct trading time?

def initialize(context):
context.stock = sid(8554)
schedule_function(buy_up, date_rules.every_day(), time_rules.market_open(minutes = 30))

def handle_data(context, data):
pass

def buy_up(context, data):
print('Eastern', get_datetime('US/Eastern'))
print('UTC', get_datetime())

2 responses

You have to run your backtest in minute mode if you want your scheduled function to execute at a particular intraday time (ie: 30 after open) .

nice one thanks!