def before_trading_start(context, data):
pass
def handle_data(context, data):
price_history = data.history(context.security, fields="price", bar_count=15, frequency="1m")
log.info(price_history.mean())
current_price = data.current(context.security, "price")
if current_price > price_history:
order(sid(49608),(.2))
if current_price < price_history:
order(sid(49608),(-1.0))