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

Multiple Draw Objects with same Tag name

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

    Multiple Draw Objects with same Tag name

    If you run NinjaPriceAction on a chart and use your pointer to move a HH or LL label, you will see multiple labels overlapping each other, even though the code is making a Tag name for the object unique per bar number. There should only be 1 instance of an object per unique name, so why is this happening?

    #2
    Hello,

    What is NinjaPriceAction? If it is a custom program, this is beyond our level of support.
    DenNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ben View Post
      Hello,

      What is NinjaPriceAction? If it is a custom program, this is beyond our level of support.
      The indicator can be found here


      Even under it's default Calc on Bar Close = true, this occurs.

      The code that draws the "HH", "LL" labels uses the standard convention of (Prefix)"HH"+CurrentBar to create a unique TagName for each label object per bar. However, multiple instances of the label appear on the same bar (move the topmost away with the pointer), apparently using the same "unique" TagName. Shouldn't there only be 1 object created using that name?

      Comment


        #4
        marketmasher, correct it uses unique tags to show the history of drawn objects - as for the overlap, you would either need to debug this code or ask the original author via PM directly if he has an input.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          marketmasher, correct it uses unique tags to show the history of drawn objects - as for the overlap, you would either need to debug this code or ask the original author via PM directly if he has an input.

          Thanks for the reply. However, there is not really anything to debug, because the naming convention is standard in NT to ascribe a drawing object a unique name. It can't be made simpler, so there is nothing to change.

          My suspicion is that using the current bar to name an object positioned on a previous bar in history is not sitting right with NT's internal tagname tracking, but that's only a guess at this point.

          BTW - the reason I noticed this was because the indicator seemed to take an unusually long time to load, and after inspection, it must be all the superfluous labels it is drawing.
          Last edited by marketmasher; 08-24-2009, 06:47 AM.

          Comment


            #6
            I meant debug in a sense to optimize for what you're looking for, correct long loading time can be attributed to many drawing objects being placed historically, you can add a block to do this only for the current trading day to achieve better performance.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              I meant debug in a sense to optimize for what you're looking for, correct long loading time can be attributed to many drawing objects being placed historically, you can add a block to do this only for the current trading day to achieve better performance.
              Ok - thx. "Debug" is a word I usually associate with a coding error. "Work-around" is more like doing something to get around a glitch.
              I will look at limiting the execution period to limit the problem.

              Comment


                #8
                FYI to anyone interested, there is a fix. I was correct - NT is not tracking the object tagname of a label drawn on a historical bar correctly if using CurrentBar (for whatever reason). The solution is to replace the code DrawText("HH"+CurrentBar,"HH",...etc with DrawText("HH"+(CurrentBar-barsback),"HH",....etc so that the label is associated with the bar it is actually sitting on. Don't know why this is the case, as an identifying number is an identifying number (or so one would think), but it removes all the superfluous label drawing and resource consumption.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by elirion, Today, 01:36 AM
                0 responses
                3 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by gentlebenthebear, Today, 01:30 AM
                0 responses
                4 views
                0 likes
                Last Post gentlebenthebear  
                Started by samish18, Yesterday, 08:31 AM
                2 responses
                9 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by Mestor, 03-10-2023, 01:50 AM
                16 responses
                391 views
                0 likes
                Last Post z.franck  
                Started by rtwave, 04-12-2024, 09:30 AM
                4 responses
                34 views
                0 likes
                Last Post rtwave
                by rtwave
                 
                Working...
                X