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 Hwop38, 05-04-2026, 07:02 PM
                0 responses
                164 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Started by CaptainJack, 04-24-2026, 11:07 PM
                0 responses
                319 views
                0 likes
                Last Post CaptainJack  
                Started by Mindset, 04-21-2026, 06:46 AM
                0 responses
                246 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                350 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                179 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Working...
                X