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/

    Get a list of close prices data

    General Code/Help
    2
    2
    993
    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.
    • E
      exg last edited by

      I've used the following code to get the last 100 close prices:
      self.price_list = self.datas[-100:][0]
      But the size of the list increment every next() called. There is any way to get the last close data on list format?

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        See the comment in the thread: Community - Porting a pandas dataframe dependent indicator

        In any case:

        self.datas[-100:]
        

        is not going to give you data points. It would give you the data feeds 100 and greater which are in the system.

        See Docs - Platform Concepts

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