Problem adding Quandl feed with start and end dates



  • 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.



  • 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.



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


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.