Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 AnnBarnes, Today, 12:17 PM
                0 responses
                1 view
                0 likes
                Last Post AnnBarnes  
                Started by Lopat, 03-05-2023, 01:19 PM
                4 responses
                166 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by f.saeidi, Today, 12:14 PM
                0 responses
                2 views
                0 likes
                Last Post f.saeidi  
                Started by giulyko00, Today, 12:03 PM
                0 responses
                4 views
                0 likes
                Last Post giulyko00  
                Started by AttiM, 02-14-2024, 05:20 PM
                12 responses
                213 views
                0 likes
                Last Post DrakeiJosh  
                Working...
                X