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/

    InteractiverBrokers get portfolio info?

    General Code/Help
    2
    6
    549
    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.
    • R
      Rami Ramich last edited by

      hello, how to get account/portfolio information with all details from IB - any sample there?

      S 1 Reply Last reply Reply Quote 0
      • S
        sylvain @Rami Ramich last edited by

        @rami-ramich try cerebro.broker.getvalue() ?

        1 Reply Last reply Reply Quote 0
        • R
          Rami Ramich last edited by

          @backtrader, i added support to select the default account

          fix for ibbroker.py

          0_1550616813940_Screen Shot 2019-02-20 at 00.52.52.png

          that allows setting default account for portfolio information

          cerebro.broker = store.getbroker(account = "U7348923")
          

          could you please merge into branch?

          S 1 Reply Last reply Reply Quote 0
          • S
            sylvain @Rami Ramich last edited by

            @rami-ramich
            you can try adding the following in your next()

                print('The current account value is %s' % self.broker.getvalue(self.data))
            

            I

            R 1 Reply Last reply Reply Quote 0
            • R
              Rami Ramich @sylvain last edited by

              @sylvain this will work only for 1st account, not for any other.

              S 1 Reply Last reply Reply Quote 0
              • S
                sylvain @Rami Ramich last edited by

                @rami-ramich I see your question now. After reading through the source code, I feel in your case some customized code needed to accomplish this.

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