Notebook
In [7]:
import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt 
In [20]:
mcdon = get_pricing('MCD',
                   start_date='2005-01-01',
                   end_date='2017-02-01',
                    frequency='daily' )
In [21]:
mcdon.head()
Out[21]:
open_price high low close_price volume price
2005-01-03 00:00:00+00:00 22.110 22.550 22.068 22.271 4324900.0 22.271
2005-01-04 00:00:00+00:00 22.208 22.606 22.208 22.424 5149200.0 22.424
2005-01-05 00:00:00+00:00 22.446 22.578 22.278 22.285 3840200.0 22.285
2005-01-06 00:00:00+00:00 22.278 22.537 22.250 22.467 3502500.0 22.467
2005-01-07 00:00:00+00:00 22.411 22.516 22.201 22.278 3458700.0 22.278
In [17]:
mcdon.info()
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 8190 entries, 2017-01-03 14:31:00+00:00 to 2017-02-01 21:00:00+00:00
Data columns (total 6 columns):
open_price     8188 non-null float64
high           8188 non-null float64
low            8188 non-null float64
close_price    8188 non-null float64
volume         8190 non-null float64
price          8190 non-null float64
dtypes: float64(6)
memory usage: 447.9 KB
In [24]:
mcdon['close_price'].plot()
Out[24]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fd7c5b8c0f0>
In [25]:
mcdon_eq_info = symbols('MCD')
In [26]:
type(mcdon_eq_info)
Out[26]:
<class 'zipline.assets._assets.Equity'>
In [30]:
mcdon_eq_info.to_dict()
Out[30]:
{'asset_name': 'MCDONALDS CORP',
 'auto_close_date': Timestamp('2020-02-14 00:00:00+0000', tz='UTC'),
 'end_date': Timestamp('2020-02-11 00:00:00+0000', tz='UTC'),
 'exchange': 'NYSE',
 'exchange_full': 'NEW YORK STOCK EXCHANGE',
 'exchange_info': ExchangeInfo('NEW YORK STOCK EXCHANGE', 'NYSE', 'US'),
 'first_traded': None,
 'multiplier': 1.0,
 'sid': 4707,
 'start_date': Timestamp('2002-01-01 00:00:00+0000', tz='UTC'),
 'symbol': 'MCD',
 'tick_size': 0.01}
In [33]:
fundamentals = init_fundamentals()
---------------------------------------------------------------------------
NoLongerSupported                         Traceback (most recent call last)
<ipython-input-33-74c0cb6ff0af> in <module>()
----> 1 fundamentals = init_fundamentals()

/build/src/qexec_repo/qexec/research/api.py in init_fundamentals()
     55 def init_fundamentals():
     56     raise NoLongerSupported(
---> 57         'The `init_fundamentals` method has been removed. To use fundamental'
     58         ' data in your notebooks and algorithms, use Pipeline.\n'
     59         'See: https://www.quantopian.com/help#fundamental-data',

NoLongerSupported: The `init_fundamentals` method has been removed. To use fundamental data in your notebooks and algorithms, use Pipeline.
See: https://www.quantopian.com/help#fundamental-data
In [ ]:
fundamentals.