• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python yahoofinance.build_feed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyalgotrade.tools.yahoofinance.build_feed函数的典型用法代码示例。如果您正苦于以下问题:Python build_feed函数的具体用法?Python build_feed怎么用?Python build_feed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了build_feed函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: testInvalidDates

    def testInvalidDates(self):
        instrument = "orcl"

        # Don't skip errors.
        with self.assertRaisesRegexp(Exception, "HTTP Error 404: Not Found"):
            with common.TmpDir() as tmpPath:
                bf = yahoofinance.build_feed([instrument], 2100, 2101, storage=tmpPath, frequency=bar.Frequency.DAY)

        # Skip errors.
        with common.TmpDir() as tmpPath:
            bf = yahoofinance.build_feed(
                [instrument], 2100, 2101, storage=tmpPath, frequency=bar.Frequency.DAY, skipErrors=True
            )
            bf.loadAll()
            self.assertNotIn(instrument, bf)
开发者ID:JimSnead,项目名称:pyalgotrade,代码行数:15,代码来源:yahoo_test.py


示例2: algoparser

def algoparser(**kwargs):
    """
    编译用户代码
    :param args:
    :param kwargs:
              sid: 资产ID
              start: 策略开始时间
              end: 策略结束时间
              code: 用户策略代码(字符串)
              filename: 用户策略文件名(.py)
    :return:
    """
    sid = kwargs.pop('sid', None)
    start = kwargs.pop('start', None)
    end = kwargs.pop('end', None)
    code = kwargs.pop('code',None)

    Algo = compile(code, '<string>', 'exec')
    exec Algo

    instrument = sid
    feed = yahoofinance.build_feed([instrument], start, end, ".")

    strat = Strategy(feed, instrument)

    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    plt = plotter.StrategyPlotter(strat,True,False,False)
    strat.run()
    stat = plt.plotjson()
    print stat
    return stat
开发者ID:StratsOn,项目名称:pyalgotrade,代码行数:33,代码来源:engine.py


示例3: main

def main(plot):
    use_ex = True

    instrument = "tcehy"
    feed = yahoofinance.build_feed([instrument], 2015, 2016, ".")

    if (use_ex):
        strat = SMACrossOverEx(feed, instrument)
    else:
        strat = SMACrossOver(feed, instrument, 15)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    strat.attachAnalyzer(returnsAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, True, False, True)
        if (use_ex):
            plt.getInstrumentSubplot(instrument).addDataSeries("sma-15", strat.getSMA(15))
            plt.getInstrumentSubplot(instrument).addDataSeries("sma-30", strat.getSMA(30))
        else:
            plt.getInstrumentSubplot(instrument).addDataSeries("sma", strat.getSMA())

        # Plot the simple returns on each bar.
        plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())

    strat.run()
    strat.info("Final portfolio value: $%.2f" % strat.getResult())

    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)

    if plot:
        plt.plot()
开发者ID:upbit,项目名称:pyalgotrade-step-by-step,代码行数:35,代码来源:sma_test.py


示例4: main

def main(plot):
    al1 = Analyst('Ivy Kang')
    al1.assign_weight('cmg', 0.673)
    al1.assign_weight('aapl', 0.215)

    al2 = Analyst('Charlie Brown')
    al2.assign_weight('cmg', 0.420)
    al2.assign_weight('orcl', 0.130)
    al2.assign_weight('bk', 0.32)
    al2.assign_weight('bk', 0.40)
    al2.assign_weight('cmg', 0.30)

    org = Organization()
    org.add_analyst(al1)
    org.add_analyst(al2)

    # Download the bars.
    feed = yahoofinance.build_feed(org.get_weights().keys(), 2014, 2015, ".instr_data")

    strat = OrgStrat(feed, org)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, True, False, True)

    strat.run()

    if plot:
        plt.plot()
开发者ID:yuanagain,项目名称:gimg_btn,代码行数:30,代码来源:strats.py


示例5: pickAsFunToLoop2

def pickAsFunToLoop2(instrument):

    #code = pickle.load(open(r'C:\Users\pmhgms\Desktop\machine_leaning\DataSet\stock_code.pickle','rb'))
    #instrument = code[randint(0, len(code))]
    # Load the yahoo feed from the CSV file
    instruments = [instrument]
    sy, ey = 2000, 2015
    smaPeriod = 60
    feed = yahoofinance.build_feed(instruments, sy, ey, "yhfeed", skipErrors=True)
    
    # Evaluate the strategy with the feed's bars.
    myStrategy = tut.SMACrossOver(feed, instrument, smaPeriod)
    
    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    myStrategy.attachAnalyzer(returnsAnalyzer)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    myStrategy.attachAnalyzer(sharpeRatioAnalyzer)
    # Attach the plotter to the strategy.
    plt = plotter.StrategyPlotter(myStrategy)
    # Include the SMA in the instrument's subplot to get it displayed along with the closing prices.
    plt.getInstrumentSubplot(instrument).addDataSeries("sma", myStrategy.getSMA())
    # Plot the simple returns on each bar.
    #plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())
    
    # Run the strategy.
    myStrategy.run()
    myStrategy.info("Final portfolio value: $%.2f" % (myStrategy.getResult()))
    
    # Plot the strategy.
    directory = 'smajpg'
    picname = instrument+'_From_'+str(sy)+'_To_'+str(ey)+'_smaPeriod_'+str(smaPeriod)+'.jpg'
    path = os.path.join(directory, picname)
    plt.plot(savefige=True, path=path)
开发者ID:pmhgms,项目名称:dataScript,代码行数:34,代码来源:ana_temp.py


示例6: main

def main(plot, instruments, smaPeriod, cash):

    # Download the bars.
    # In the instruments,I can provide more instruments.The instruments name can be got from yahoo finance.
    #instruments = ["c07.si","C09.SI","C31.SI","E5H.SI"]
    #instruments = ["h78.si"]
    #feed is a Feed type defined in yahoofeed.py
    feed = yahoofinance.build_feed(instruments, 2008, 2009, "./Historical_Price")

    for instrument in instruments:
        myStrategy = MyStrategy(feed, instrument, smaPeriod, cash)

        if plot == True :
            # Attach a returns analyzers to the strategy.
            returnsAnalyzer = returns.Returns()
            myStrategy.attachAnalyzer(returnsAnalyzer)

            # Attach the plotter to the strategy.
            plt = plotter.StrategyPlotter(myStrategy)
            # Include the SMA in the instrument's subplot to get it displayed along with the closing prices.
            #plt.getInstrumentSubplot(instrument).addDataSeries("SMA", myStrategy.getSMA())
            # Plot adjusted close values instead of regular close.
            plt.getInstrumentSubplot(instrument).setUseAdjClose(True)
            # Plot the strategy returns at each bar.
            #plt.getOrCreateSubplot("returns").addDataSeries("Net return", returnsAnalyzer.getReturns())
            #plt.getOrCreateSubplot("returns").addDataSeries("Cum. return", returnsAnalyzer.getCumulativeReturns())

        myStrategy.run()
        print "Result for %s : %.2f" % (instrument, myStrategy.getResult())

        # Plot the strategy.
        if plot == True :
            plt.plot()
开发者ID:wygold,项目名称:HelloWorld,代码行数:33,代码来源:candleAnalyze.py


示例7: main

def main(plot):
    initialCash = 10000
    instrumentsByClass = {
        "US Stocks": ["VTI"],
        "Foreign Stocks": ["VEU"],
        "US 10 Year Government Bonds": ["IEF"],
        "Real Estate": ["VNQ"],
        "Commodities": ["DBC"],
    }

    # Download the bars.
    instruments = ["SPY"]
    for assetClass in instrumentsByClass:
        instruments.extend(instrumentsByClass[assetClass])
    feed = yahoofinance.build_feed(instruments, 2007, 2013, "data", skipErrors=True)

    strat = MarketTiming(feed, instrumentsByClass, initialCash)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)
    returnsAnalyzer = returns.Returns()
    strat.attachAnalyzer(returnsAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, False, False, True)
        plt.getOrCreateSubplot("cash").addCallback("Cash", lambda x: strat.getBroker().getCash())
        # Plot strategy vs. SPY cumulative returns.
        plt.getOrCreateSubplot("returns").addDataSeries("SPY", cumret.CumulativeReturn(feed["SPY"].getPriceDataSeries()))
        plt.getOrCreateSubplot("returns").addDataSeries("Strategy", returnsAnalyzer.getCumulativeReturns())

    strat.run()
    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)
    print "Returns: %.2f %%" % (returnsAnalyzer.getCumulativeReturns()[-1] * 100)

    if plot:
        plt.plot()
开发者ID:grayfox7744,项目名称:quantLibrary,代码行数:35,代码来源:test1.py


示例8: main

def main(plot):
    entrySMA = 200
    exitSMA = 5
    rsiPeriod = 2
    overBoughtThreshold = 90
    overSoldThreshold = 10

    # Download the bars.
    instrument = "tcehy"
    feed = yahoofinance.build_feed([instrument], 2014, 2016, ".")

    strat = RSI2(feed, instrument, entrySMA, exitSMA, rsiPeriod, overBoughtThreshold, overSoldThreshold)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, True, False, True)
        plt.getInstrumentSubplot(instrument).addDataSeries("Entry SMA", strat.getEntrySMA())
        plt.getInstrumentSubplot(instrument).addDataSeries("Exit SMA", strat.getExitSMA())
        plt.getOrCreateSubplot("rsi").addDataSeries("RSI", strat.getRSI())
        plt.getOrCreateSubplot("rsi").addLine("Overbought", overBoughtThreshold)
        plt.getOrCreateSubplot("rsi").addLine("Oversold", overSoldThreshold)

    strat.run()
    strat.info("Final portfolio value: $%.2f" % strat.getResult())

    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)

    if plot:
        plt.plot()
开发者ID:upbit,项目名称:pyalgotrade-step-by-step,代码行数:30,代码来源:rsi2_test.py


示例9: main2

def main2(plot):
    instrument = "ivv"
    smaPeriod = 20
    
    # Download the bars.
    feed = yahoofinance.build_feed([instrument], 2013, 2014, ".")
    
    # Evaluate the strategy with the feed's bars.
    myStrategy = SMACrossOver(feed, instrument, smaPeriod)
    
    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    myStrategy.attachAnalyzer(returnsAnalyzer)
    
    # Attach the plotter to the strategy.
    plt = plotter.StrategyPlotter(myStrategy)
    # Include the SMA in the instrument's subplot to get it displayed along with the closing prices.
    plt.getInstrumentSubplot(instrument).addDataSeries("SMA", myStrategy.getSMA())
    # Plot the simple returns on each bar.
    plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())
    
    # Run the strategy.
    myStrategy.run()
    myStrategy.info("Final portfolio value: $%.2f" % myStrategy.getResult())
    
    # Plot the strategy.
    plt.plot()    
开发者ID:luosz,项目名称:quant,代码行数:27,代码来源:sma_crossover.py


示例10: main

def main(plot):
    instrument = "yhoo"
    bBandsPeriod = 20

    # Download the bars.
    feed = yahoofinance.build_feed([instrument], 2011, 2015, ".")
    # feed = ts.get_hist_data('601198')
    print type(feed)
    # import sys;sys.exit(0)

    strat = BBands(feed, instrument, bBandsPeriod)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, True, True, True)
        plt.getInstrumentSubplot(instrument).addDataSeries("upper", strat.getBollingerBands().getUpperBand())
        plt.getInstrumentSubplot(instrument).addDataSeries("middle", strat.getBollingerBands().getMiddleBand())
        plt.getInstrumentSubplot(instrument).addDataSeries("lower", strat.getBollingerBands().getLowerBand())

    strat.run()
    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)

    if plot:
        plt.plot()
开发者ID:johnsonhongyi,项目名称:pyQuant,代码行数:25,代码来源:talib-tools.py


示例11: testBuildDailyFeed

 def testBuildDailyFeed(self):
     with common.TmpDir() as tmpPath:
         instrument = "orcl"
         bf = yahoofinance.build_feed([instrument], 2010, 2010, storage=tmpPath)
         bf.loadAll()
         self.assertEqual(bf[instrument][-1].getOpen(), 31.22)
         self.assertEqual(bf[instrument][-1].getClose(), 31.30)
开发者ID:JimSnead,项目名称:pyalgotrade,代码行数:7,代码来源:yahoo_test.py


示例12: main

def main(plot):
    initialCash = 1000000
    commodity_tickers=["B","TA","BR"]
    instrumentsByClass = {
        "commodity": commodity_tickers
    }

    # Download the bars.
    instruments = []
    for assetClass in instrumentsByClass:
        instruments.extend(instrumentsByClass[assetClass])
    feed = yahoofinance.build_feed(instruments, 2007, 2013, "data", skipErrors=True)

    strat = MarketTiming(feed, instrumentsByClass, initialCash)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)
    returnsAnalyzer = returns.Returns()
    strat.attachAnalyzer(returnsAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, False, False, True)
        plt.getOrCreateSubplot("cash").addCallback("Cash", lambda x: strat.getBroker().getCash())
        # Plot strategy vs. SPY cumulative returns.
        plt.getOrCreateSubplot("returns").addDataSeries("SPY", cumret.CumulativeReturn(feed["SPY"].getPriceDataSeries()))
        plt.getOrCreateSubplot("returns").addDataSeries("Strategy", returnsAnalyzer.getCumulativeReturns())

    strat.run()
    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)
    print "Returns: %.2f %%" % (returnsAnalyzer.getCumulativeReturns()[-1] * 100)

    if plot:
        plt.plot()
开发者ID:JayDeng2837,项目名称:WorkSpace,代码行数:32,代码来源:dual_momentum.py


示例13: pickAsFunToLoop

def pickAsFunToLoop(instrument,usevir=0):

    #code = pickle.load(open(r'C:\Users\pmhgms\Desktop\machine_leaning\DataSet\stock_code.pickle','rb'))
    #instrument = code[randint(0, len(code))]
    # Load the yahoo feed from the CSV file
    instruments = [instrument]
    sy, ey = 2000, 2015
    p1, p2 = 20, 10
    usevir = usevir
    feed = yahoofinance.build_feed(instruments, sy, ey, "yhfeed", skipErrors=True)
    
    # Evaluate the strategy with the feed's bars.
    myStrategy = tut.MyStrategy(feed, instrument, p1, p1, usevir)
    
    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    myStrategy.attachAnalyzer(returnsAnalyzer)
    
    # Attach the plotter to the strategy.
    plt = plotter.StrategyPlotter(myStrategy)
    # Include the SMA in the instrument's subplot to get it displayed along with the closing prices.
    plt.getInstrumentSubplot(instrument).addDataSeries("high", myStrategy.getHigh())
    plt.getInstrumentSubplot(instrument).addDataSeries("low", myStrategy.getLow())
    # Plot the simple returns on each bar.
    #plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())
    
    # Run the strategy.
    myStrategy.run()
    myStrategy.info("Final portfolio value: $%.2f, Stop loss %d time, Skip buy %d time" % (myStrategy.getResult(), myStrategy.stoplosstimes, myStrategy.skipbuy))
    
    # Plot the strategy.
    directory = 'temjpg'
    picname = instrument+'_From_'+str(sy)+'_To_'+str(ey)+'_p1_'+str(p1)+'_p2_'+str(p2)+'_usevir_'+str(usevir)+'.jpg'
    path = os.path.join(directory, picname)
    plt.plot(savefige=True, path=path)
开发者ID:pmhgms,项目名称:dataScript,代码行数:35,代码来源:ana_temp.py


示例14: main2

def main2(plot, instrument, entry_sma_period, exit_sma_period):
    # Download the bars.
    feed = yahoofinance.build_feed([instrument], 2014, 2014, ".")
    
    # Evaluate the strategy with the feed's bars.
    strat = SMACrossOver2(feed, instrument, entry_sma_period, exit_sma_period)
    
    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    strat.attachAnalyzer(returnsAnalyzer)
    
    # Attach the plotter to the strategy.
    plt = plotter.StrategyPlotter(strat)
    # Include the SMA in the instrument's subplot to get it displayed along with the closing prices.
    plt.getInstrumentSubplot(instrument).addDataSeries("SMA", strat.getSMA())
    plt.getInstrumentSubplot(instrument).addDataSeries("exit SMA", strat.get_exit_SMA())
    # Plot the simple returns on each bar.
    plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())
    
    # Run the strategy.
    strat.run()
    strat.info("Final portfolio value: $%.2f" % strat.getResult())
    
    # Plot the strategy.
    plt.plot()
开发者ID:luosz,项目名称:quant,代码行数:25,代码来源:my_sma_crossover.py


示例15: main

def main(plot):
    initialCash = 10000
    instrumentsByClass = {
        "Technology": ["MSFT", "ORCL", "IBM", "HPQ"],
        "Services": ["WMT", "UPS", "TGT", "CCL"],
        "Basic Materials": ["XOM", "CVX", "COP", "OXY"],
        "Financial": ["BAC", "JPM", "WFC", "GS"],
        "Consumer Goods": ["PG", "PEP", "CL", "KO"],
    }

    # Download the bars.
    instruments = []
    for assetClass in instrumentsByClass:
        instruments.extend(instrumentsByClass[assetClass])
    feed = yahoofinance.build_feed(instruments, 2005, 2013, "data", skipErrors=True)

    strat = MarketTiming(feed, instrumentsByClass, initialCash)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, False, False, True)
        plt.getOrCreateSubplot("cash").addCallback("Cash", lambda x: strat.getBroker().getCash())

    strat.run()
    print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)

    if plot:
        plt.plot()
开发者ID:frostyplanet,项目名称:pyalgotrade,代码行数:29,代码来源:market_timing.py


示例16: main

def main(plot):
    instrument = "000300.ss"
    feed = yahoofinance.build_feed([instrument], 2013, 2015, ".")

    period = 100
    strat = HurstBasedStrategy(feed, instrument, period)

    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)

    # Attach a returns analyzers to the strategy.
    returnsAnalyzer = returns.Returns()
    strat.attachAnalyzer(returnsAnalyzer)

    if plot:
        plt = plotter.StrategyPlotter(strat, True, False, True)

        plt.getOrCreateSubplot("hurst").addDataSeries("Hurst",  strat.getHurst())
        plt.getOrCreateSubplot("hurst").addLine("random", 0.5)

        # Plot the simple returns on each bar.
        # plt.getOrCreateSubplot("returns").addDataSeries("Simple returns", returnsAnalyzer.getReturns())

    strat.run()
    strat.info("Final portfolio value: $%.2f" % strat.getResult())

    # print "Sharpe ratio: %.2f" % sharpeRatioAnalyzer.getSharpeRatio(0.05)

    if plot:
        plt.plot()
开发者ID:upbit,项目名称:pyalgotrade-step-by-step,代码行数:30,代码来源:hurst_test.py


示例17: testBuildWeeklyFeed

 def testBuildWeeklyFeed(self):
     with common.TmpDir() as tmpPath:
         instrument = "aapl"
         bf = yahoofinance.build_feed([instrument], 2013, 2013, storage=tmpPath, frequency=bar.Frequency.WEEK)
         bf.loadAll()
         self.assertEqual(round(bf[instrument][-1].getOpen(), 2), 557.46)
         self.assertEqual(round(bf[instrument][-1].getHigh(), 2), 561.28)
         self.assertEqual(round(bf[instrument][-1].getLow(), 2), 540.43)
         self.assertEqual(round(bf[instrument][-1].getClose(), 2), 540.98)
         self.assertTrue(bf[instrument][-1].getVolume() in (9852500, 9855900, 68991600))
开发者ID:JimSnead,项目名称:pyalgotrade,代码行数:10,代码来源:yahoo_test.py


示例18: acquire_daily_data

def acquire_daily_data(instrument, year):
    if year == 'all':
        this_year = date.today().year  # Get current year
        final_year = this_year
        in_business = True
        while in_business:
            try:
                yahoofinance.build_feed(
                    [instrument], this_year, this_year,
                    './data/historical/daily-atrader',
                    frequency=86400, skipErrors=False)
            except:
                in_business = False
                log_business_years(instrument, [this_year + 1, final_year])
            else:
                this_year -= 1
    else:
        yahoofinance.build_feed([instrument], year[0], year[1],
                                './data/historical/daily-atrader',
                                frequency=86400, skipErrors=False)
开发者ID:RyanEggert,项目名称:financial-signal-processing,代码行数:20,代码来源:data_handling.py


示例19: run_strategy

def run_strategy():
	# Load the yahoo feed from the CSV file
	securities = ["app"]
	feed = yahoofinance.build_feed(securities, 2006, 2014, "stockdata")

	# Evaluate the strategy with the feed.
	masterTrader = MasterTrader(feed, securities[0])
	masterTrader.run()
	print "Final portfolio value: $%.2f" % masterTrader.getBroker().getEquity()
	masterTrader.datamanager.close()
	print "Highest portfolio value: $%.2f" % masterTrader.highValue
开发者ID:Ronin11,项目名称:AI,代码行数:11,代码来源:test.py


示例20: main

def main(plot):
    instruments = ["AA", "AES", "AIG"]
    feed = yahoofinance.build_feed(instruments, 2008, 2009, ".")

    predicate = BuyOnGap(feed)
    eventProfiler = eventprofiler.Profiler(predicate, 5, 5)
    eventProfiler.run(feed, True)

    results = eventProfiler.getResults()
    print "%d events found" % (results.getEventCount())
    if plot:
        eventprofiler.plot(results)
开发者ID:363158858,项目名称:pyalgotrade-cn,代码行数:12,代码来源:eventstudy.py



注:本文中的pyalgotrade.tools.yahoofinance.build_feed函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python collections.intersect函数代码示例发布时间:2022-05-25
下一篇:
Python cross.cross_below函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap