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/

    how to use generic csv file

    General Discussion
    2
    4
    2491
    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.
    • D
      Devinderjeet Singh last edited by

      hello,
      my CSV file date format is 13-12-2016 09:15, and it show error while uploading file
      https://drive.google.com/file/d/0B_cy3mMpatfZSi1NMUFWME9ZMHc/view

      please help

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        When seeking ...

        @Devinderjeet-Singh said in how to use generic csv file:

        please help

        it is usually helpful to show what one has tried (the code, at least the part that loads the data) and what Python told you (the error)

        The GenericCSVData is documented. See Docs - Data Feeds Reference

        Quoting from it:

          - dtformat: Format used to parse the datetime CSV field. See the python strptime/strftime documentation for the format.
        
            If a numeric value is specified, it will be interpreted as follows
        
              1: The value is a Unix timestamp of type int representing the number of seconds since Jan 1st, 1970
              2: The value is a Unix timestamp of type float
              If a callable is passed
        
                 it will accept a string and return a datetime.datetime python instance
        

        An example which already includes the solution for the no timeframe specified

        • Community - Backtest running but no trade happening
        1 Reply Last reply Reply Quote 0
        • D
          Devinderjeet Singh last edited by backtrader

          here is the error picture. it just simple adding data to any strategy
          https://drive.google.com/open?id=0B_cy3mMpatfZVmxYcU5uVjB2bjQ

          it's 10 day's - minute data
          where am I getting wrong?

          0_1501916500942_d57838cb-603f-437d-a243-74012eccad37-image.png

          1 Reply Last reply Reply Quote 0
          • B
            backtrader administrators last edited by backtrader

            Pictures are nice, but if you use the facilities of a forum (like pasting text and quoting it to highlight it, as pointed out above) it could help more.

            It will also be of no help to future users, when you remove the picture from your google drive share. Your post has been edited to add the figure for future reference.

            In any case it seems you are pretty new to Python. Your error has nothing to do with backtrader. See

            • Python - Docs - 8.1. datetime — Basic date and time types
            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors