Hi, for my algorithm, I'm doing some TA at the beginning of the day to figure which securities I want to focus on for the day. This is the error that I'm getting with the code below:
FunctionCalledOutsideOfTradingStart: 0069 'history' only permitted within before_trading_start function
DAILY_WINDOW = 100
def initialize(context):
set_universe(universe.DollarVolumeUniverse(99.0, 100.0))
def before_trading_start(context):
high_history = history(DAILY_WINDOW, '1d', 'high')
low_history = history(DAILY_WINDOW, '1d', 'low')
price_history = history(DAILY_WINDOW, '1d', 'price')
def handle_data(context, data):
pass