def saveHistroyDataIntoExcel(self): ''' read stock list, get historical data, and save to excel ''' print 'Save HistroyData Into Excel' storage = HistoricalDataStorage( os.path.join(self.__workingDir, 'china')) storage.buildExlsFromFile(fileName=self.__stocklistFile, div=5)
""" Created on July 18, 2010 @author: ppa """ from ultrafinance.lib.tradingStrategy.tradeInWeek import TradeInWeek from ultrafinance.lib.historicalDataStorage import HistoricalDataStorage from os.path import join, dirname, abspath if __name__ == "__main__": outputPrefix = join(dirname(dirname(abspath(__file__))), "dataSource", "SPY", "spy") print outputPrefix storage = HistoricalDataStorage(outputPrefix) storage.buildExls(["SPY"], 1) tradeInWeek = TradeInWeek("%s0.xls" % outputPrefix, 0) for value in tradeInWeek.tryAllStrategy(): print value
def testBuildExls(self): outputPrefix = os.path.join( os.path.dirname( os.path.dirname(os.path.abspath(__file__)) ), 'output', 'buildExl' ) storage = HistoricalDataStorage(outputPrefix) storage.buildExls(['MMM', 'ACE', 'ABT', 'ANF', 'ADBE', 'AMD'], 2)
def testBuildExlsFromFile(self): stockListFile = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'stock.list' ) outputPrefix = os.path.join( os.path.dirname( os.path.dirname(os.path.abspath(__file__)) ), 'output', 'fromFile' ) storage = HistoricalDataStorage(outputPrefix) storage.buildExlsFromFile(stockListFile, 2)
def saveHistroyDataIntoExcel(self): ''' read stock list, get historical data, and save to excel ''' print 'Save HistroyData Into Excel' storage = HistoricalDataStorage(os.path.join(self.__workingDir, 'china') ) storage.buildExlsFromFile(fileName=self.__stocklistFile, div=5)
''' Created on July 18, 2010 @author: ppa ''' from ultrafinance.lib.tradingStrategy.tradeInWeek import TradeInWeek from ultrafinance.lib.historicalDataStorage import HistoricalDataStorage from os.path import join, dirname, abspath if __name__ == '__main__': outputPrefix = join(dirname(dirname(abspath(__file__))), 'dataSource', 'SPY', 'spy' ) print outputPrefix storage = HistoricalDataStorage(outputPrefix) storage.buildExls(['SPY'], 1) tradeInWeek = TradeInWeek('%s0.xls' % outputPrefix, 0) for value in tradeInWeek.tryAllStrategy(): print value