def getHistoricalOpenPrice(symbol,date): openPrice=queryDatabaseForOpenPrice(symbol,date) if openPrice!=-1: return openPrice else: data=getHistoricalStockData(symbol,date) if data!="None": #we should also save the data in the database return data[1][4] else: return 0
def getHistoricalData(symbol,date): if (queryDatabaseForCount(symbol,date)>0): #we should get the data from Yahoo and return that return 0 else: return getHistoricalStockData(symbol,date)