Created
January 3, 2013 16:53
-
-
Save anonymous/4444836 to your computer and use it in GitHub Desktop.
playing with ipython notebook and yahoo stock data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# <nbformat>2</nbformat> | |
# <codecell> | |
import datetime as dt | |
import pandas as pd | |
# <codecell> | |
symbol = 'vcadx' | |
starting_value = 10000 | |
# <codecell> | |
symbol_pd = pd.read_csv('yahoo-data/' + symbol + '.csv', names=None, index_col='Date', parse_dates=True) | |
symbol_pd = symbol_pd.sort_index() | |
# <codecell> | |
adj_close = symbol_pd['Adj Close'] | |
first_price = adj_close.ix[0] | |
shares = starting_value / first_price | |
# <codecell> | |
adj_close = adj_close * shares | |
# <codecell> | |
adj_close.plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment