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/

    Saving datafeeds to CSV

    General Discussion
    2
    3
    1900
    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.
    • ?
      A Former User last edited by A Former User

      Is there an easy way to save data feeds to CSV? I'm building a framework based around backtrader and I'd like to save the Yahoo finance data feed so I don't need to hit the network every time.

      Ideally, I'd have something like this:

      feed = YahooFinanceData(...,cache=True)
      

      This would use a hash of the URL to save the CSV locally and avoid needing to hit the network every time. If this is something that you might accept as PR, let me know and I'll see if there is something I can do.

      Thanks in advance.

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

        Currently you have a yahoodownload.py in the source which will download any ticker to file. See: GitHub - Repository/yahoodownload.py

        The concept of caching would actually need a store wrapper around the YahooFinance family. With the store deciding where the cache actually goes, making it look like other online providers.

        1 Reply Last reply Reply Quote 2
        • ?
          A Former User last edited by

          Thank you. I'll create a store and post it for review if anyone finds it useful.

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