Hi there,
I'm a noob to Quantopian so sorry for the stupid question.
I simply want to edit the example from the getting started tutorial to use minute instead of daily data.
My attempt below is based on the description of the data object given here:
https://www.quantopian.com/help#api-data-methods.
I'm currently getting the error: AttributeError: 'DataFrame' object has no attribute 'history'.
Can someone please point me in the right direction.
# Research environment functions
from quantopian.research import prices, symbols
# Pandas library: https://pandas.pydata.org/
import pandas as pd
'''
# Query historical pricing data for AAPL
aapl_close = prices(
assets=symbols('AAPL'),
start='2013-01-01',
end='2016-01-01',
)
'''
appl_close = data.history('AAPL', 'price', 5*390, '1m').dropna(axis=1)
# Compute 20 and 50 day moving averages on
# AAPL's pricing data
aapl_sma20 = aapl_close.rolling(20).mean()
aapl_sma50 = aapl_close.rolling(50).mean()
# Combine results into a pandas DataFrame and plot
pd.DataFrame({
'AAPL': aapl_close,
'SMA20': aapl_sma20,
'SMA50': aapl_sma50
}).plot(
title='AAPL Close Price / SMA Crossover'
);