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/

    YahooFinanceData Issue - TypeError: 'module' object is not callable

    General Code/Help
    beginner yahoofinancedat
    2
    2
    95
    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.
    • N
      neoyipeng last edited by

      Not sure if anyone else is facing this issue, but I can't seem to use YahooFinanceData properly - google search on the error suggests I'm importing the class improperly.

      d = bt.feeds.YahooFinanceData(dataname='MSFT', fromdate=datetime(2011, 1, 1), todate=datetime(2012, 12, 31))

      Anything wrong with this? I copied it from one of the examples so was surprised it was not working

      1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld last edited by

        You are probably not importing the datetime class from datetime module correctly . Either import it using:

        from datetime import datetime
        

        or use:

        import datetime
        

        and then

        datetime.datetime(...)
        
        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }