示例#1
0
 def getYahoo( self, ticker, datacode ):
     """Return Yahoo data. Mapped to PyUNO through the Xsmf.rdb file"""
     try:
         x = float(yahoo.fetch_data(self, ticker, datacode))
     except:
         x = yahoo.fetch_data(self, ticker, datacode)
     return x
示例#2
0
 def getYahoo(self, ticker, datacode):
     """Return Yahoo data. Mapped to PyUNO through the Xsmf.rdb file"""
     try:
         x = float(yahoo.fetch_data(self, ticker, datacode))
     except:
         x = yahoo.fetch_data(self, ticker, datacode)
     return x
示例#3
0
 def getYahoo(self, ticker, datacode):
     # Retrieve the requested data
     try:
         s = yahoo.fetch_data(self, ticker, datacode)
     except Exception as ex:
         # x = yahoo.fetch_data(self, ticker, datacode)
         return str(ex)
     # If the data was retrieved, if possible, convert it to float
     try:
         x = float(s)
     except:
         x = s
     return x
示例#4
0
def find_exchange(self, ticker):
    """Determine exchange ticker is traded on so we can query morningstar"""
    # query yahoo to determine which exchange our ticker is traded on
    exchange = yahoo.fetch_data(self, ticker, 54)
    if exchange == 'AMEX':
        exchange = 'XASE'
        return exchange
    elif exchange == 'NasdaqNM':
        exchange = 'XNAS'
        return exchange
    elif exchange == 'NYSE':
        exchange = 'XNYS'
        return exchange
    #catch errors
    else:
        return exchange
示例#5
0
 def getYahoo( self, ticker, datacode ):
     return yahoo.fetch_data(self, ticker, datacode)
示例#6
0
 def getYahoo(self, ticker, datacode):
     return yahoo.fetch_data(self, ticker, datacode)
示例#7
0
文件: smf.py 项目: heroas/dotfiles
 def getYahoo(self, ticker, datacode):
     try:
         x = float(yahoo.fetch_data(self, ticker, datacode))
     except:
         x = yahoo.fetch_data(self, ticker, datacode)
     return x