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/

    OO Diagrams? - Difficultly understanding BT from documentation alone

    General Code/Help
    2
    3
    948
    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.
    • Richard O'Regan
      Richard O'Regan last edited by Richard O'Regan

      Hey backtrader,

      Firstly, after looking a many platforms to develop on, I've settled on yours as I like what you have achieved, how active you are in this forum and BT meets my overall needs better than other platforms.

      I've been looking through your code over the last two weeks. I've made a number changes on my GitHub fork (e.g. added the Kelly Percentage analyzer).. though I'm still having difficultly getting a deep grasp of how BT functions.

      I wish to know BT on a deeper level because I wish to add more functionality that is non trivial. Hence will require understanding structure of BT.

      Your documentation is better than other platform documentation, e.g. Quant Connect, though I'm struggling to get a OVERALL VIEW, e.g. a hierarchy of how your code works.

      Is there a UML diagram of BT you could put up?
      Or would anybody know any good software that could generate this? (I googled, so many to choose from and the ones I tried I couldn't get to work)

      Also, could anyone recommend a great util that I could step thro the Python code at runtime, and see all the objects created and the values in them?
      Then I could run through a strategy from start to finish and see how everything works.

      Appreciate all your effort

      Regards
      Rich

      You can take the man out of the army, but you can't take the army out of the man.

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @Richard O'Regan last edited by

        @Richard-O'Regan said in OO Diagrams? - Difficultly understanding BT from documentation alone:

        Is there a UML diagram of BT you could put up?

        No there isn't. The hierarchy is rather simple. LineRoot -> (LineSingle, LineMultiple). LineSingle is meant for on-the-spot operations (like a - b), and LineMultiple subclasses are meant to for Data Feeds, Indicators, Observers and Strategies. The rest of things are isolates where classes help with the encapsulation and keeping a mostly consistent interface (python is simply too dynamic and for something like backtrader allows for quick experimentation by changing things at any level of the hierarchy)

        LineSingle and LineMultiple share basically the same exact interface and can mostly be used in place of each other. And that where it cannot be, a LineSingle can be wrapped to look like a LineMultiple

        Or would anybody know any good software that could generate this? (I googled, so many to choose from and the ones I tried I couldn't get to work)

        It will probably break due to the use of metaclasses which do too much magic in the background (same as tools try to detect code smells fail to understand the absence of parameters)

        Richard O'Regan 1 Reply Last reply Reply Quote 0
        • Richard O'Regan
          Richard O'Regan @backtrader last edited by

          @backtrader Thanks for your reply. After playing with BT a couple of weeks, never paid much attention to LineSingle/Multiple.. I will take a closer look.
          Thanks for feedback

          You can take the man out of the army, but you can't take the army out of the man.

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