OO Diagrams? - Difficultly understanding BT from documentation alone



  • 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


  • administrators

    @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)



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


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.