Exemple #1
0
    def createDAM(damType, settings=None):
        ''' create DAM '''
        if 'yahoo' == damType:
            from ultrafinance.dam.yahooDAM import YahooDAM
            dam = YahooDAM()
        elif 'google' == damType:
            from ultrafinance.dam.googleDAM import GoogleDAM
            dam = GoogleDAM()
        elif 'excel' == damType:
            from ultrafinance.dam.excelDAM import ExcelDAM
            dam = ExcelDAM()
        elif 'hbase' == damType:
            from ultrafinance.dam.hbaseDAM import HBaseDAM
            dam = HBaseDAM()
        elif 'sql' == damType:
            from ultrafinance.dam.sqlDAM import SqlDAM
            dam = SqlDAM()
        else:
            raise UfException(Errors.INVALID_DAM_TYPE,
                              "DAM type is invalid %s" % damType)

        dam.setup(settings)
        return dam
Exemple #2
0
 def testReadFundamental(self):
     dam = GoogleDAM()
     dam.setSymbol('EBAY')
     keyTimeValueDict = dam.readFundamental()
     self.assertNotEqual(0, len(keyTimeValueDict))
Exemple #3
0
 def testReadTicks(self):
     dam = GoogleDAM()
     dam.setSymbol('EBAY')
     data = dam.readTicks('20111120', '20111201')
     self.assertNotEqual(0, len(data))
Exemple #4
0
 def testReadQuotes(self):
     dam = GoogleDAM()
     dam.setSymbol('NASDAQ:EBAY')
     data = dam.readQuotes('20110101', '20110110')
     self.assertNotEqual(0, len(data))
 def testReadFundamental(self):
     dam = GoogleDAM()
     dam.setSymbol('EBAY')
     keyTimeValueDict = dam.readFundamental()
     print(keyTimeValueDict)
     self.assertNotEqual(0, len(keyTimeValueDict))
 def testReadTicks(self):
     dam = GoogleDAM()
     dam.setSymbol('EBAY')
     data = dam.readTicks('20111120', '20111201')
     print(data)
     self.assertNotEqual(0, len(data))
 def testReadQuotes(self):
     dam = GoogleDAM()
     dam.setSymbol('NASDAQ:EBAY')
     data = dam.readQuotes('20110101', '20110110')
     print(data)
     self.assertNotEqual(0, len(data))
Exemple #8
0
 def testReadQuotes(self):
     dam = GoogleDAM()
     dam.setSymbol('NASDAQ:EBAY')
     data = dam.readQuotes('20131101', '20131110')
     print([str(q) for q in data])
     self.assertNotEqual(0, len(data))