def get_option_data(symbol, year, month,i): myPrice = float(yahoostock.get_price(symbol)) myArray = yahoostock._option_data(symbol,year,month); myRetArray = get_relevant_data(myPrice,myArray,i) for ix1 in myRetArray: price = ix1['price'] quote = ix1['quote'] returnPct = (quote/myPrice) * 100 print ' %4s %-6.2f %-6.2f %-6.2f %-2.2f' % (symbol,myPrice,price,quote, returnPct)
def get_option_data(symbol, year, month, i): myPrice = float(yahoostock.get_price(symbol)) myArray = yahoostock._option_data(symbol, year, month) myRetArray = get_relevant_data(myPrice, myArray, i) for ix1 in myRetArray: price = ix1['price'] quote = ix1['quote'] returnPct = (quote / myPrice) * 100 print ' %4s %-6.2f %-6.2f %-6.2f %-2.2f' % ( symbol, myPrice, price, quote, returnPct)
def call_me(i): someArray = ['BRCM', 'XLNX', 'JNPR','NOK','P','ENOC','ALTR','TWC','BRLI','QCOM','ABMD', 'PHMD','CUTR','ARII'] today = date.today() year = today.year month = 12 safetyGoal = 7 profitGoal = 5 for symbol in someArray: myPrice = yahoostock.get_price(symbol) getRetArr = get_option_data(symbol,myPrice,myPrice,safetyGoal,profitGoal,year,month) sys.exit(0)
def call_me(i): someArray = [ 'BRCM', 'XLNX', 'JNPR', 'NOK', 'P', 'ENOC', 'ALTR', 'TWC', 'BRLI', 'QCOM', 'ABMD', 'PHMD', 'CUTR', 'ARII' ] today = date.today() year = today.year month = 12 safetyGoal = 7 profitGoal = 5 for symbol in someArray: myPrice = yahoostock.get_price(symbol) getRetArr = get_option_data(symbol, myPrice, myPrice, safetyGoal, profitGoal, year, month) sys.exit(0)
def get_option_data(symbol, year, month,i): toRet = [] myPrice = float(yahoostock.get_price(symbol)) myArray = yahoostock._option_data(symbol,year,month); #print symbol myRetArray = get_relevant_data(myPrice,myArray,i) for ix1 in myRetArray: ret_tuple = {} price = ix1['price'] quote = ix1['quote'] returnPct = (quote/price) * 100 ret_tuple['symbol'] = symbol; ret_tuple['myPrice'] = myPrice; ret_tuple['price'] = price; ret_tuple['quote'] = quote; ret_tuple['returnPct'] = returnPct; cumRet = int(100 * returnPct * ((myPrice - price)/myPrice*100)) ret_tuple['cumRet'] = cumRet; toRet.append(ret_tuple) #print ' %4s %-6.2f %-6.2f %-6.2f %-2.2f' % (symbol,myPrice,price,quote, returnPct) return toRet
def get_option_data(symbol, year, month, i): toRet = [] myPrice = float(yahoostock.get_price(symbol)) myArray = yahoostock._option_data(symbol, year, month) #print symbol myRetArray = get_relevant_data(myPrice, myArray, i) for ix1 in myRetArray: ret_tuple = {} price = ix1['price'] quote = ix1['quote'] returnPct = (quote / price) * 100 ret_tuple['symbol'] = symbol ret_tuple['myPrice'] = myPrice ret_tuple['price'] = price ret_tuple['quote'] = quote ret_tuple['returnPct'] = returnPct cumRet = int(100 * returnPct * ((myPrice - price) / myPrice * 100)) ret_tuple['cumRet'] = cumRet toRet.append(ret_tuple) #print ' %4s %-6.2f %-6.2f %-6.2f %-2.2f' % (symbol,myPrice,price,quote, returnPct) return toRet
def _fetch_price(self,symbol): return (yahoostock.get_price(symbol))
def _update(self): self.oldPrice = self.price self.price = yahoostock.get_price(self.symbol) self.change = yahoostock.get_change(self.symbol)
def _fetch_price(symbol): return (yahoostock.get_price(symbol))
def _update(self): self.oldPrice = self.price self.price = yahoostock.get_price(self.symbol) self.change = yahoostock.get_change(self.symbol) self.sma200 = yahoostock.get_200day_moving_avg(self.symbol)
def _update(self): self.oldPrice = self.price self.price = yahoostock.get_price(self.symbol) self.change = yahoostock.get_change(self.symbol) self.sma200 = yahoostock.get_200day_moving_avg(self.symbol);