コード例 #1
0
 def testBaseFeedInterface(self):
     values = [(datetime.datetime.now() + datetime.timedelta(seconds=i), {
         "i": i
     }) for i in xrange(100)]
     feed = memfeed.MemFeed()
     feed.addValues(values)
     feed_test.tstBaseFeedInterface(self, feed)
コード例 #2
0
    def testBaseFeedInterface(self):
        common.init_temp_path()
        path = os.path.join(common.get_temp_path(), "trades-mgtox-usd-2013-01-01.csv")
        tools.download_trades_by_day("usd", 2013, 1, 1, path)

        bf = barfeed.CSVTradeFeed()
        bf.addBarsFromCSV(path)
        feed_test.tstBaseFeedInterface(self, bf)
コード例 #3
0
    def testBaseFeedInterface(self):
        common.init_temp_path()
        path = os.path.join(common.get_temp_path(),
                            "trades-mgtox-usd-2013-01-01.csv")
        tools.download_trades_by_day("usd", 2013, 1, 1, path)

        bf = barfeed.CSVTradeFeed()
        bf.addBarsFromCSV(path)
        feed_test.tstBaseFeedInterface(self, bf)
コード例 #4
0
ファイル: dbfeed_test.py プロジェクト: harsha550/pyalgotrade
    def testBaseFeedInterface(self):
        tmpFeed = TemporarySQLiteFeed(SQLiteFeedTestCase.dbName, bar.Frequency.DAY)
        with tmpFeed:
            # Load bars using a Yahoo! feed.
            yahooFeed = yahoofeed.Feed()
            yahooFeed.addBarsFromCSV("orcl", common.get_data_file_path("orcl-2000-yahoofinance.csv"), marketsession.USEquities.timezone)
            yahooFeed.addBarsFromCSV("orcl", common.get_data_file_path("orcl-2001-yahoofinance.csv"), marketsession.USEquities.timezone)

            # Fill the database using the bars from the Yahoo! feed.
            sqliteFeed = tmpFeed.getFeed()
            sqliteFeed.getDatabase().addBarsFromFeed(yahooFeed)

            # Load the SQLite feed and process all bars.
            sqliteFeed.loadBars("orcl")
            feed_test.tstBaseFeedInterface(self, sqliteFeed)
コード例 #5
0
    def testBaseFeedInterface(self):
        tmpFeed = TemporarySQLiteFeed(SQLiteFeedTestCase.dbName, bar.Frequency.DAY)
        with tmpFeed:
            # Load bars using a Yahoo! feed.
            yahooFeed = yahoofeed.Feed()
            yahooFeed.addBarsFromCSV("orcl", common.get_data_file_path("orcl-2000-yahoofinance.csv"), marketsession.USEquities.timezone)
            yahooFeed.addBarsFromCSV("orcl", common.get_data_file_path("orcl-2001-yahoofinance.csv"), marketsession.USEquities.timezone)

            # Fill the database using the bars from the Yahoo! feed.
            sqliteFeed = tmpFeed.getFeed()
            sqliteFeed.getDatabase().addBarsFromFeed(yahooFeed)

            # Load the SQLite feed and process all bars.
            sqliteFeed.loadBars("orcl")
            feed_test.tstBaseFeedInterface(self, sqliteFeed)
コード例 #6
0
 def testBaseFeedInterface(self):
     feed = fxfeed.Feed("Date", "%Y-%m-%d")
     feed.addValuesFromCSV(
         common.get_data_file_path(
             "/home/staurou/data/EURUSD-Daily-2012-2016.csv"))
     feed_test.tstBaseFeedInterface(self, feed)
コード例 #7
0
 def testBaseFeedInterface(self):
     barFeed = ninjatraderfeed.Feed(ninjatraderfeed.Frequency.MINUTE)
     barFeed.addBarsFromCSV("spy", common.get_data_file_path("nt-spy-minute-2011.csv"))
     feed_test.tstBaseFeedInterface(self, barFeed)
コード例 #8
0
 def testBaseFeedInterface(self):
     barFeed = yahoofeed.Feed()
     barFeed.addBarsFromCSV(
         FeedTestCase.TestInstrument,
         common.get_data_file_path("orcl-2000-yahoofinance.csv"))
     feed_test.tstBaseFeedInterface(self, barFeed)
コード例 #9
0
 def testBaseFeedInterface(self):
     barFeed = yahoofeed.Feed()
     barFeed.addBarsFromCSV(FeedTestCase.TestInstrument, common.get_data_file_path("orcl-2000-yahoofinance.csv"))
     feed_test.tstBaseFeedInterface(self, barFeed)
コード例 #10
0
 def testBaseFeedInterface(self):
     feed = csvfeed.Feed("Date", "%Y-%m-%d")
     feed.addValuesFromCSV(common.get_data_file_path("orcl-2000-yahoofinance.csv"))
     feed_test.tstBaseFeedInterface(self, feed)
コード例 #11
0
 def testBaseFeedInterface(self):
     feed = csvfeed.Feed("Date", "%Y-%m-%d")
     feed.addValuesFromCSV(
         common.get_data_file_path("orcl-2000-yahoofinance.csv"))
     feed_test.tstBaseFeedInterface(self, feed)
コード例 #12
0
 def testBaseFeedInterface(self):
     values = [(datetime.datetime.now() + datetime.timedelta(seconds=i), {"i": i}) for i in xrange(100)]
     feed = memfeed.MemFeed()
     feed.addValues(values)
     feed_test.tstBaseFeedInterface(self, feed)
コード例 #13
0
ファイル: fxfeed_test.py プロジェクト: revivalfx/pyalgotrade
 def testBaseFeedInterface(self):
     feed = fxfeed.Feed("Date", "%Y-%m-%d")
     feed.addValuesFromCSV(common.get_data_file_path("/home/staurou/data/EURUSD-Daily-2012-2016.csv"))
     feed_test.tstBaseFeedInterface(self, feed)