Enter this code in the UI. Don't worry about what it does. (Or doesn't do):
def initialize(context):
context.stock = [sid(2), sid(24)]
context.dict_close = {}
def handle_data(context, data):
dt_index = data[context.stock[0]].datetime
for stock in data:
context.dict_close[dt_index] = { stock.sid : data[stock].close_price }
print context.dict_close
Go to Line 8 i.e. the one beginning 'context.dict_close =', put the cursor on the start of 'dt_index' and delete 'dt_index' to leave '[]'. Within the square brackets type 'data[stock].' and hit return on 'datetime'. Oh. This is not what I would really want to happen. Especially without an 'Undo' feature in the UI.
P