Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Can't find the folder

    General Code/Help
    1
    1
    7
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      IHaveNoClue last edited by

      Although my folder is in the correct path, the function can't find it.

      I am new relatively new to programming, maybe some obvious mistakes?

      import backtrader as bt
      
      cerebro = bt.Cerebro()
      
      data = bt.feeds.GenericCSVData(dataname='D:\Programme\Visual Studio Code\Projekte\D_Candles.csv', dtformat=2)
      
      cerebro.adddata(data)
      
      cerebro.run()
      
      cerebro.plot()
      

      All dependencies and packages were installed.

      Error Message:

      Traceback (most recent call last):
       line 9, in <module>
          cerebro.run()
        line 1127, in run
          runstrat = self.runstrategies(iterstrat)
        line 1210, in runstrategies
          data._start()
        line 203, in _start
          self.start()
        line 88, in start 
          super(GenericCSVData, self).start()
       line 674, in start
          self.f = io.open(self.p.dataname, 'r')
      FileNotFoundError: [Errno 2] No such file or directory: 'D_Candles.csv'
      PS D:\Programme\Visual Studio Code\Projekte> 
      

      What I tried so far:

      • just tiping the folder name
      • switching the backslashes
      • copied the folder in an other path
      • changed the folders name

      I really appreciate your help.
      Even if you know an alternative function I could try...

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors