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/

    Order update still unavailable?

    General Discussion
    2
    12
    1329
    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
      arrr last edited by

      Hi
      I've got a strategy, where I need to update my order (or cancel and immediately place a new one) almost every period, however it seems to be impossible with backtrader right now. The only thing I can do is: cancel my order => wait for the next() run => place a new order, which means I've got a period without any live orders.
      Is there any way to handle this properly?

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

        @arrr said in Order update still unavailable?:

        Please see: https://community.backtrader.com/topic/376/eodevelopment-1-x

        Yes still unavailable. It was never there as something to be "already" in the first place.

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

          I see. Any time estimates on v2?

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

            Not really.

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

              Btw is it possible to use 2 sets of data: daily bars for indicators and smaller (hourly, 15 min or whatever) to place and process orders? In this case updating order (cancel + placing the new one) will take 2 small bars instead of skipping a full day.

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

                You can buy/sell any asset. The platform doesn't know that the minute-resolution data and the daily-resolution are the same asset. Buy/Sell the minute one.

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

                  I've googled about using multiple datafeeds with backtrader and it seems, that all available examples (including the docs) are looping thru the datasets, however I would like to use them simultaneously, is that possible?

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

                    @arrr said in Order update still unavailable?:

                    however I would like to use them simultaneously

                    You will have to explain what you mean by simultaneously. If examples loop is because you want to check them all. Nothing prevents you from using direct pointers to each data feed.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      arrr @backtrader last edited by

                      @backtrader I mean, that if you run it with 2 data feeds, but without looping them. So it will basically mix data from both sources in a single output. Long story short: is there any way to determine which feed a bar comes from?

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

                        I guess you have to elaborate. It may all make sense to you, but it doesn't make any sense here. What you can do with backtrader

                        • Add as many data feeds as you wish
                        • Mix timeframes

                        Looping is just an artifact which the end user can do in cases like for example: 10 data feeds all in the same timeframe.

                        If you have the same data feed twice with 2 timeframes (15-minutes and 1-day) you may refer directly to them in the self.datas array or with the self.dataX (where X is the index) aliases.

                        @arrr said in Order update still unavailable?:

                        So it will basically mix data from both sources in a single output

                        That seems like a new data feed you would have to develop. Unless you mean something else.

                        A 1 Reply Last reply Reply Quote 1
                        • A
                          arrr @backtrader last edited by

                          @backtrader When using 2 data feeds backtrader will call next() on every bar in each feed. Since bt takes bars from both feeds, sorts them from oldest to newest and then runs in a single flow, feeds become "mixed". My problem is that I don't know which bar from which feed is currently calling next() and therefore I can't call indicator functions on daily feed and skip them on minute one. So my question is how do I know which feed a certain bar comes from?

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

                            You have to check the length of the data feed. It changes when a new bar is delivered. This can happen for both data feeds at the same time, but with different timeframes, it will obviously happend a lot more often for the smaller timeframe

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