I'm trying out minute runs. why doesn't this script generate logs? Neither when building or running the detailed backtest.
import datetime
import pytz
def initialize(context):
context.isBought = False
context.isSold = False
context.buyDate = datetime.datetime(2014,3,27,12,15,0,0,pytz.timezone('US/Eastern'))
context.sellDate = datetime.datetime(2014,3,27,13,30,0,0,pytz.timezone('US/Eastern'))
log.info("hello")
pass
def handle_data(context, data):
if not context.isBought and get_datetime() >= context.buyDate:
context.isBought=True
order_target_percent(sid(26578), 0.50) # GOOG, 50%
log.info("buy at {0}".format(data[sid(26578)].close_price))
if not context.isSold and get_datetime() >= context.sellDate:
context.isSold = True
order_target_percent(sid(26578), 0.0) # GOOG
log.info("sell at {0}".format(data[sid(26578)].close_price))