So here is my code, it is very rudimentary as I am just starting out.
def initialize(context):
context.stocks = sid(42277)
# Will be called on every trade event for the securities you specify.
def handle_data(context, data):
current_price = data[sid(42277)].price
#current_price = history(1, "1m", "price")
one_minute = history(2, "1m", "price")
two_minute = history(3, "1m", "price")
two_min_average = ((one_minute + two_minute) / 2)
print "Current price------------------"
print current_price
print "two min average-------------------"
print two_min_average
For some reason my variable two_min_average does not print out anything when asked to. Any ideas as to why?