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

triangle Draw objects and remove object issue

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

    triangle Draw objects and remove object issue

    I have an issue deleting triangle objects.
    For some reason it will not allow me to delete. the Picture below is my error.
    It is simple logic but it will not delete the object.

    // no more than 200 triangles to be printed on chart
    if (nTriangleCount > 200)
    {
    nTriangleCount = 0;
    bTriangleGraphicReached = true;
    }


    if(bTriangleGraphicReached == true)
    RemoveDrawObject("Tangle"+ nTriangleCount.ToString());

    Draw.TriangleDown(this, "Tangle" + nTriangleCount.ToString(), true, 16, dSwingHigh + 1 * TickSize, Brushes.Tomato);
    nTriangleCount++;
    Attached Files

    #2
    Hello ballboy11,

    Thank you for your note.

    Which drawing object are you trying to remove, the last drawn or all drawing objects?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      No I am not removing ALL objects
      I am removing the object by tag ID.


      My triangle list is from 0 to 199

      when the max is reached I reset the count to zero, then I start removing the Triangle object 1 at a time when needed.

      ie RemoveDrawObject("Tangle0");

      then Draw.Triange( this, "Tangle0",,,,,

      Comment


        #4
        Hello Ballboy,

        Without the full code we're unable to test on our end.

        If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Here is the zip file but I think I found the issue.

          I don't think remove draw object is working or does it actually remove a draw object.

          "Tangle" + nNumber.ToString(); would be my tag.

          If I only draw one type of object such as triangle up only, I will have no issues. Same as triangle down i will have no issues.

          If i use the Same Tag name, try to delete the tag name and draw a DIFFERENT object it will give me an error.


          I can ONLY draw 1 type of Object per tag name.

          Example

          TangleUp + nNumber.ToString() for up triangle
          TangleDown + nNumber.ToString() for donw triangle

          Result. NO ISSUES

          DeleteDrawObject("Tangle" + nNumber.ToString());

          Then Draw one or the other.

          Tangle + nNumber.ToString() for up triangle OR
          Tangle+ nNumber.ToString() for down triangle

          ERROR Will result.

          In Conclusion Delete DrawObject has no effect or DeleteDrawObject does not work.
          Attached Files

          Comment


            #6
            Hello ballboy11,

            Yes, you should not use the same tag name for two different drawing objects, up vs down triangles. The error from the log screen shot looks related to this rather than RemoveDrawObject not working.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Kaledus, Today, 01:29 PM
            5 responses
            12 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by alifarahani, Today, 09:40 AM
            5 responses
            23 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            16 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PhillT, Today, 02:16 PM
            2 responses
            7 views
            0 likes
            Last Post PhillT
            by PhillT
             
            Working...
            X