# Put any initialization logic here. The context object will be passed to
# the other methods in your algorithm.
def initialize(context):
context.stocks = [sid(24), sid(698)]
context.fired = False
# Will be called on every trade event for the securities you specify.
def handle_data(context, data):
if not context.fired:
historical_data = history(200, '1d', 'price')
print historical_data.head()
stops = historical_data.iloc[-1]
print stops.head()
context.fired = True
else:
return
This is not working.
It seems history will only pick the stocks in universe. Yet I didnt find a way to set specific stocks to universe. Maybe i miss read the doc.
Please help