Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to offset/shift/move the plot by a certain number of candles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to offset/shift/move the plot by a certain number of candles

    is there a way to make a plot have an offset when drawing?

    this is an example from trading view using their "offset" parameter when plotting
    Click image for larger version

Name:	image.png
Views:	317
Size:	16.2 KB
ID:	1236681

    #2
    Hello LuxSpuzy,

    Yes indicators have a property called Displacement which moves the plots X bars in the direction you specify.



    This is for moving the visual only, if you access the value by code its going to still be the normal values without Displacement.

    Comment


      #3
      the example shown would suggest it works for all plots then? since it's an overall parameter and not Plots[0].Displacement

      is there a way to move one plot to the right, one to the left and leave the rest as is?

      Comment


        #4
        Hello LuxSpuzy,

        This displaces the whole indicator visual, that is the only *easy* way to displace data. If you wanted to displace a specific plot you would need to displace that plots data.

        For example if you wanted to move the plot 1 bar backwards you would set the 1 BarsAgo plot value to the current value, that would visually displace only that plot. You could also displace it the opposite direction by setting the current plot value to the previous value. This type of change would require some heavy changes to your existing calculation logic though to make sure the right values are being assigned at the right plot locations.

        Another option is to use OnRender to make custom renderings of whatever data you wanted, that would hide the plots and allow you to draw whatever way you wanted on the chart to display the data in a custom way.

        Comment


          #5
          using the method of adjusting index to the plot by the displacement value works for moving a plot to the left, but not to the right.
          as far as I know it's not possible to access Plot[-1] values, and also not possible to access Plot indexes higher than the bars on the chart

          I guess it's custom render code, gotta learn that as well it seems, thx

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          589 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          342 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          555 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X