For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:


  • Hello
    When i try to run a just this test on Spyder , i have this error :
    File "/Users/jxx/.spyder-py3/", line 25, in <module>

    File "/Users/jxx/anaconda3/lib/python3.7/site-packages/backtrader/", line 1127, in run
    runstrat = self.runstrategies(iterstrat)

    File "/Users/jxx/anaconda3/lib/python3.7/site-packages/backtrader/", line 1210, in runstrategies

    File "/Users/jxx/anaconda3/lib/python3.7/site-packages/backtrader/", line 203, in _start

    File "/Users/jxx/anaconda3/lib/python3.7/site-packages/backtrader/feeds/", line 352, in start
    super(YahooFinanceData, self).start()

    File "/Users/jxx/anaconda3/lib/python3.7/site-packages/backtrader/feeds/", line 94, in start
    super(YahooFinanceCSVData, self).start()

    File "/Users/jxxx/anaconda3/lib/python3.7/site-packages/backtrader/", line 674, in start
    self.f =, 'r')

    FileNotFoundError: [Errno 2] No such file or directory: 'BTC-USD'


    from datetime import datetime
    import backtrader as bt

    class SmaCross(bt.SignalStrategy):
    def init(self):
    sma1, sma2 = bt.ind.SMA(period=10), bt.ind.SMA(period=30)
    crossover = bt.ind.CrossOver(sma1, sma2)
    self.signal_add(bt.SIGNAL_LONG, crossover)

    cerebro = bt.Cerebro()

    data0 = bt.feeds.YahooFinanceData(dataname='BTC-USD', fromdate=datetime(2018, 1, 1),
    todate=datetime(2019, 12, 31))

  • Thanks you for your help

Log in to reply