예제 #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