Thanks Simon.
I've already watched all of the Sentdex videos (they are excellent), taken a Python course and watched most of Dan Dunn's tutorials. I'll be at Quantcon and am taking the factor class the day after. I have a lot of work to do between now and then.
The areas I keep having problems with are 1) the use of pandas data frames don't seem to be consistent (because I'm missing something) in Quantopian and 2) the use of content.X in functions and how it's passed between functions.
For example, if I want to call a function (in minute mode) that calculates some statistics after the first bar after the open, I create a function called heavy_calcs. In initialize, I create a schedule function that calls this function 1 minute after the open. Such as:
def heavy_calcs (context, data):
stock = context.stock
context.AvgRange = history(30, '1d', 'high')[stock] - history(30, '1d', 'low')[stock].mavg(30)
context.Gap = history(1, '1d', 'price')[stock] - history(0, '1d', 'open_price')[stock]
I then want this data (AvgRange and Gap) to be available in the handle_data function. This is where I keep getting hung up.
When I try to build an algo with the above function, it builds fine, however it throws an error at the line with context.AvgRange when I try to run a backtest.