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

Remove Globally Drawn Object

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

    Remove Globally Drawn Object

    When I use Draw.Ray in NT8 and I set isGlobal to True, it seems to create 2 drawing objects with the same tag. If I try to use removeDrawObject(), the object won't go away.

    It seems like the drawing template I use may have an impact. I only want the drawing template to store the color, but it seems to be storing alot of different information.

    Thoughts?

    #2
    Hello,

    Thank you for the question.

    As there are two overloads that include IsGlobal, could you provide the syntax you are currently using?

    For the template, it should store the properties of the drawing tool, are you seeing other items that are not associated with the tool being saved?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse

      I am using this syntax:
      "Draw.Ray(NinjaScriptBase owner, string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)"

      I noticed that when I saved the template I wanted to use, if the object was attached to all charts or not was having an impact on my custom coded drawing object using isGlobal.

      Let me restate that...isGlobal seems to be conflicting with the
      "<IsGlobalDrawingObjectDefault>true or false</IsGlobalDrawingObjectDefault>"
      from within the template.
      Whether I had true or false in there had different behavior.
      Either way...when I drew the ray, I was getting 2 instances of each tag.

      Comment


        #4
        Update: I even created a very simple indicator. I used Draw.VerticalLine and Draw.Ray
        When I made isGlobal true in both of those functions, there were 2 rays but only 1 vertical line.
        I tried to remove them through their tag. RemoveDrawObject("tag"). Neither removed.
        Now, when I make isGlobal false, they both remove fine.
        What does work, is when I use RemoveDrawObjects()...but that is very intensive as I have to redraw all my other drawing objects.

        Please Advise.

        Comment


          #5
          Hello,

          Thank you for posting the additional details.

          I do also see a duplicate ray while using a template and overload set, for this I will report it to development for further review.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Thank you. I look forward to your update. Keep in mind, the vertical line wasn't removing either even though it didn't have a duplicate.

            Comment


              #7
              Hello,

              Thank you for the reply.

              I had noted this as well in the information provided to development on this issue. If I have further information relayed to me I will post back here.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Awesome. Much Appreciated!

                Comment


                  #9
                  I want to report that I am experiencing duplicate tags/objects as well with global horizontal lines drawn with

                  Code:
                  [COLOR=#080808]Draw[/COLOR][COLOR=#000000].[/COLOR][COLOR=#080808]HorizontalLine[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]this[/COLOR][COLOR=#000000], [/COLOR][COLOR=#b22222]"hline1"[/COLOR][COLOR=#000000], [/COLOR][COLOR=#080808]Close[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff8c00]0[/COLOR][COLOR=#000000]], [/COLOR][COLOR=#0000ff]true[/COLOR][COLOR=#000000], [/COLOR][COLOR=#b22222]""[/COLOR][COLOR=#000000]);[/COLOR]
                  Thanks.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NRITV, Today, 01:15 PM
                  2 responses
                  6 views
                  0 likes
                  Last Post NRITV
                  by NRITV
                   
                  Started by frankthearm, Today, 09:08 AM
                  7 responses
                  30 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by maybeimnotrader, Yesterday, 05:46 PM
                  5 responses
                  25 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by quantismo, Yesterday, 05:13 PM
                  2 responses
                  18 views
                  0 likes
                  Last Post quantismo  
                  Started by adeelshahzad, Today, 03:54 AM
                  5 responses
                  33 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X