Backtrader Community

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

    MultiData Strategy

    Blog
    2
    9
    2656
    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
      backtrader administrators last edited by

      Use the link below to go the original post

      Click here to see the full blog post

      1 Reply Last reply Reply Quote 0
      • V
        vivalavida1982 last edited by

        If i do arbitrage, means i need to trade two different instruments based on the spread. How to execute the two or multi orders at the same time?

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

          @vivalavida1982 said in MultiData Strategy:

          How to execute the two or multi orders at the same time?

          self.buy(self.data0, size=x)
          self.sell(self.data1, size=y)
          

          Or is it something else? The operational methods to buy and sell are described in the docs: Docs - Strategy

          1 Reply Last reply Reply Quote 0
          • V
            vivalavida1982 last edited by

            I need to check these two orders' sitution before starting the new trading? So I need to put 2 parameters(order1, order2) with def notify_order()?

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

              No. You cannot out of thin air receive 2 arguments in a method when only 1 is defined.

              1 Reply Last reply Reply Quote 0
              • V
                vivalavida1982 last edited by

                It seems doesn't work.

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

                  @vivalavida1982 said in MultiData Strategy:

                  It seems doesn't work.

                  ??

                  1 Reply Last reply Reply Quote 0
                  • V
                    vivalavida1982 last edited by

                    Do you have email , as i can send codes to you for a check.

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

                      You may post code snippets. That's what this is for. In any case this is not a code check service.

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