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/

    Data Structure for Holding Metrics

    General Code/Help
    1
    1
    14
    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.
    • Z
      Z last edited by

      I am having a hard time coming up with a data structure that can hold metrics in a nice clean way. I might be a little slow and am just overthinking it, but either way figured asking here might help me get some clarification or some valuable insight into how to approach a problem like this.

      So, I would like to have a data structure that can hold metrics based on what I call "Data Scope" as well as what I call "Data Slice". Data Scope is just what I use to refer to the size of the data (whole portfolio, stock sector, individual stock). Data Slice is just what I use to refer to the time period of the data (whole period, yearly, monthly).

      The thing I am having a tough time wrapping my head around is how I can create an overall data structure that I can organize without giving Data Scope or Data Slice larger importance. For example, if Overall Data Structure> Data Slice > Data Scope, then I can look at the year 2019 for the stock AAPL. But, what if now I don't care about the Data Slice (time period)? What if I just want to look at everything relating to AAPL? Data Scope isn't the larger structure so I have to access all the AAPL info through different time periods.

      As I said, I might be overcomplicating things (I probably am), but I would enjoy a solution as well as an explanation of where I am going wrong with my thinking.

      Thanks Much!
      Z

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