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:
                  Draw.HorizontalLine(this, "hline1", Close[0], true, "");
                  Thanks.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by JTizz, Today, 03:32 PM
                  1 response
                  35 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by ebaydan777, Today, 02:41 PM
                  1 response
                  28 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by aligator, Today, 02:28 PM
                  1 response
                  27 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Started by daniel_weber8, Today, 01:21 PM
                  1 response
                  45 views
                  0 likes
                  Last Post NinjaTrader_ChristopherS  
                  Started by jungsoohuh, Today, 12:07 PM
                  1 response
                  37 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Working...
                  X