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/

    whats the difference between a line delay and negative lookup

    General Code/Help
    2
    2
    265
    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.
    • greg nwosu
      greg nwosu last edited by

      just reading through the documentation and i get the impression i can get yesterdays close for example two ways

      data.lines.close[-1] 
      

      or

      data.lines.close(-1)
      

      one being a delay and the other backwards lookup, i wonder if there is any difference in performance. I'm guessing that the delay isnt actually calculated until later and the negative lookup is precalculated in which case perhaps the delay runs faster. your thoughts please

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

        @greg-nwosu said in whats the difference between a line delay and negative lookup:

        your thoughts please

        Run a speed test and use the syntax which better suits you.

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