I want to see what my code is doing while I teach myself...
I am trying to simply print the ticker symbol in the log. Any help is appreciated. I keep spinning my wheels.
def initialize(context):
context.securities = [sid(39840), sid(27817)]
def handle_data(context, data):
price_history = data.history(context.securities, "price", bar_count=2, frequency="1d")
for stock in context.securities:
prev_bar = price_history[stock][-2]
curr_bar = price_history[stock][-1]
log.info({tickersymbolhere} + " prev: " + str(prev_bar))
log.info({tickersymbolhere} + " curr: " + str(curr_bar))