Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator bars with different starting points?

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

    Indicator bars with different starting points?

    Hi,

    Is it possible to have an indicator drawing vertical lines, but not from 0 to specific value, but from specific value to specific value?
    That is showing two variable values on one bar, not only one... Something DrawLine can do, but for the whole chart, for every pricebar.

    Thanks

    #2
    Zapzap,

    Have you tried just using DrawLine() and just using the same startBarsAgo and endBarsAgo values?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Yes, I have tried, but I haven't managed to draw the indicator lines for all the previous pricebars, only for the pricebars being drawn after attaching the indicator.
      So Plot can go back in time (but can't do the job), DrawLine cannot (?) go back in time(but can do the job). Or maybe DrawLine can go back too, but I don't know how.

      Comment


        #4
        Zapzap,

        Please ensure you are using unique ID names for each of your draw objects.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Yes, I do.

          But how can I go back in time, and draw the lines for all pricebars on the chart without Plot?
          By using a for cycle?

          Comment


            #6
            Zapzap,

            Not following you. As you load up an indicator onto a chart it will already process each and every bar. It will go through and draw a line on each of your bars.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hm, then it should work...
              I thought I need to use Plot dataseries to draw for all visible bars, not only for the new ones...

              Well, I keep on trying then.

              Comment


                #8
                Zapzap,

                Plots do not influence DrawLine() objects. If in OnBarUpdate() you only had one line of code for the DrawLine() it will draw on every single bar it processes.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                646 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                367 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                107 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                569 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X