'''
Created Oct 10-20, 2010

@author: alandavidson, ola, rcd
'''
import StockData
import matplotlib.pyplot as plt


def getMaxPrice (stockData):
    """
    Given a list of (date, price, volume) tuples, 
    returns the highest price.
    """
    return max([ s.price for s in data ])


def getMaxPriceDate (stockData):
    """
    Given a list of (date, price, volume) tuples, 
    returns the date of the tuple that has the highest price.
    """
    # TODO: students fill this in
    pass


def getAveragePrice (stockData):
    """
    Given a list of (date, price, volume) tuples, 
    returns the average price.
    """
    # TODO: students fill this in.
    pass


def plotPrices (stockData):
    """
    Given a list of (date, price, volume) tuples, 
    Create a plot of the price of the stock over all the days in the list.
    The x-axis is the index in the list, and the y-axis is the price of the stock.
    """
    # TODO: students fill this in
    plt.show()


def plotPriceAndAverage (stockData):
    """
    Given a list of (date, price, volume) tuples, 
    Create a plot of how the current price of the stock compares
    to the average price of the past 10 days. 
    The x-axis is the index in the list, and the y-axis is the difference 
    between the current price and the 10-day average.
    """
    # TODO: students fill this in
    plt.show()



#data = StockData.getWebData("GOOG", "20110101", "20120101")
data = StockData.getFileData("data/goog_11.txt")
print(data[0])
# if you want to test various functions, you can do it here.
