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/

    How to find out the closing price an hour ago?

    General Code/Help
    2
    2
    260
    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.
    • Evgeniy
      Evgeniy last edited by

      I can not find in WiKi how can I find out the closing price some time ago.

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

        Because there is no such thing as the closing price an hour ago. Furthermore, you don't say if you are working with minutes, seconds, hours, days, quarters.

        Even if it seem a simple formulation for you as a human being, if you are working with seconds, there may be missing bars and when 1 hour ago happened cannot be determined with certainty. The same when crossing boundaries (you look backwards into the previous day for the previous hour)

        If you are really focused on time you will have to:

        • Check the current time and write it down into a list.

        When you want to check that time, you look for it in the list.

        For working with indexing (not being focused on time but on bars), please see: Documentation - Platform Concepts and the section Indexing

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }