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/

    Problem adding Quandl feed with start and end dates

    General Code/Help
    2
    3
    788
    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.
    • S
      Stam last edited by

      Hi all,

      I'm new to the community and new to python.
      I've been trying to add a Quandl feed to my backtest. When I request all available data it works fine, but I can't get the data to download when I use the "fromdate" and "todate" parameters to plot a desired date range. For example:

      bt.feeds.Quandl(dataname='myticker',apikey='myapikey',fromdate='2010-1-1',todate='2012-1-1')

      Gives the following error on the \quandl.py" file:

      line 203, in start
      dtxt = self.p.fromdate.strftime('%Y-%m-%d')

      AttributeError: 'str' object has no attribute 'strftime'

      Any pointers as to how to resolve this would be really appreciated.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by ab_trader

        For all types of data feeds fromdate and todate parameters should be python datetime objects, and you have strings. It is not surprising that you are getting the error message.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        S 1 Reply Last reply Reply Quote 1
        • S
          Stam @ab_trader last edited by

          @ab_trader Thank you! Newbie error! Works fine now.

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