Hi,
I'm trying to grasp some of the more basic features of the IDE. I want to put a single stock into my universe, get a couple mavg and then do a comparision every day. I went and looked at the simple algorithm in the docs and I came up with this
def initialize(context):
context.security = symbols('SPY')
def handle_data(context, data):
ma1 = data[context.security].mavg(33)
ma2 = data[context.security].mavg(205)
if ma1 > ma2:
order_target_percent(context.security, 1.0)
elif ma1 < ma2:
order_target_percent(context.security, 0.00)
The error I get says TypeError: unhashable type: 'list' at line 8
but this is the same way the algo in the docs here https://www.quantopian.com/help#sample-basic assigns mavg to a variable. What am I missing?
Thanks,
Aaron