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/

    Is there a way to offset my plotted line?

    General Code/Help
    1
    2
    57
    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.
    • Wayne Filkins 0
      Wayne Filkins 0 last edited by

      What is the best way to offset a line? Currently it's sort of lagging because I'm doing pivot points and since I don't know future prices I can't exactly plot a pivot until like 10 candles go by, but then I end up with offset dots:

      745487c1-d62b-4db2-a9b1-2323bc2034e1-image.png

      1 Reply Last reply Reply Quote 0
      • Wayne Filkins 0
        Wayne Filkins 0 last edited by

        Nevermind I figured it out. I wanted to do line[-5] as the value because this would fit the offsetting problem but it always gives errors, but I just had to basically skip the beginning of the line (where line[-5] didn't exist yet) and that fixed it. Sorry idk how I didn't figure this out last night guess I was just burned out. So yeah if anyone comes across this problem just basically do:

        line[-5] = value you normally would put at line[0]
        

        and if you have a situation like mine, I had to use the pivot period so it was like above but had to convert the period to Int

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