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 change data source of a data feed every day

    General Code/Help
    2
    3
    594
    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.
    • B
      brettelliot last edited by

      Hi there!

      Let's say I want to trade US stocks based on earnings announcements. This means there are approximately 5000 stocks in the universe. My current understanding of BT is that to backtest or trade a strategy that uses earnings announcements for any of the stocks in the universe I have to setup a data feed for each stock. That's a lot of data feeds!

      In this post Add and remove data feeds on the flyt there is some hope...

      "nothing prevents a feed from switching to delivering data from a different underlying source."

      Is there an example of this anywhere?

      Here's what I'm thinking... I pre-create a certain number of data feeds (say 5) and everyday I get the list of announcements, pick 5 that are interesting, and attach each to one of the data sources.

      I would have to liquidate on close every night which is fine. I also understand indicators won't work, which is also fine. Anything else I should be aware of?

      Thanks!

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

        @brettelliot said in How to change data source of a data feed every day:

        Is there an example of this anywhere?

        No. You would have to develop it and have an API in the data feed itself to allow changing what it actually delivers.

        1 Reply Last reply Reply Quote 1
        • B
          brettelliot last edited by

          OK thanks!

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