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/

    Portfolio situation

    Indicators/Strategies/Analyzers
    2
    2
    744
    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
      Alessandro Di Piazza last edited by

      Dear all,
      I have some problem, maybe I do some mistake.
      At the end of simulation, I printed two values:

      print('Final Cash Value: %.2f' % cerebro.broker.getcash())
      print('Final Account Value: %.2f' % cerebro.broker.getvalue())

      If I understood well
      the getvalue returns the entire value of the account
      the getcash returns the free cash not used to buy stocks

      I need to do a double check.
      How can I print the portfolio situation in a table ?
      The sum of portfolio and the cash value must be equal to the getvalue results?

      Thank you
      A

      P 1 Reply Last reply Reply Quote 0
      • P
        Paska Houso @Alessandro Di Piazza last edited by Paska Houso

        @Alessandro-Di-Piazza said in Portfolio situation:

        How can I print the portfolio situation in a table ?

        Go over the positions with getposition(xxx) where xxx is a data feed.

        • https://www.backtrader.com/docu/strategy.html

        The sum of portfolio and the cash value must be equal to the getvalue results?

        Should be.

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