Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Remove draw objects created in Indicator in Strategy - HOW?

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

    Remove draw objects created in Indicator in Strategy - HOW?

    I have used AllowRemovalOfDrawObjects in both indi and Strat, but it does not work. What else must I do to remove arrows in Strategy? Thanks.

    #2
    Hello kenz987,

    Thanks for your post.

    From the help guide, the Property AllowRemovalOfDrawObjects is defined as, "Determines if programmatically drawn DrawObjects are allowed to remove manually from the chart" also "When set to true, the draw objects from the indicator or strategy can be deleted from the chart manually by a user. If false, draw objects from the indicator or strategy can only be removed from the chart if the script removes the drawing object, or the script is terminates. Default set to false."
    Reference link: https://ninjatrader.com/support/help...rawobjects.htm

    So the property itself does not remove the objects, it just determine if the user can manually remove them.

    To remove the objects by your script you would use either:
    RemoveDrawObject() (On a per object basis) or RemoveDrawObjects() (removes all draw objects)

    References:



    Here is a link to an educational example of removing draw objects: https://ninjatrader.com/support/help...s_from_the.htm

    Comment


      #3
      Paul, Thank you for your time, but you did not answer my question. So a very basic function of a Strategy removing an arrow after it has served it's purpose is not possible... I think you should add that as a NEW feature, as if nobody else has ever needed it before. I was hoping something simple like changing the owner from "this" to something like "all" would do the trick. Guess not.

      Comment


        #4
        Hello kenz987,

        Thanks for your reply.

        To remove the objects by your script you would use either:
        RemoveDrawObject() (On a per object basis) or RemoveDrawObjects() (removes all draw objects)

        References:
        https://ninjatrader.com/support/help...drawobject.htm
        https://ninjatrader.com/support/help...rawobjects.htm

        Another way to remove objects is if you use the same "tag" name for the same type draw object, only the latest occurrence of a draw object will remain on the chart. When you use the same tag name, the method will look for an existing object with that name and will first remove it before drawing the new one in the new location.




        Comment


          #5
          Paul_H

          I am trying to use this with Rays -I note that if I select the Ray and use the Remove menu item it gives me the standard error of do you want to remove the indicator as well.
          Is this correct behaviour?

          Comment


            #6
            Hello Mindset,

            If the drawn object is drawn by the indicator and the indicator is the owner, yes, this is expected behavior.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by kenz987 View Post
              I have used AllowRemovalOfDrawObjects in both indi and Strat, but it does not work. What else must I do to remove arrows in Strategy? Thanks.
              It happen me the same, I use AddChartIndicator to call from the strategy to any indicator... then in the indicator I use some removedrawobject but it doesnt work that in strategy... wear

              did you resolve?

              Comment


                #8
                Hello FaaZer,

                RemoveDrawObject needs to be used in the indicator that draws the object to remove it, strategies cannot remove indicators objects.

                Comment


                  #9
                  Hi Jesse, yes I see it... the problem it was more simple hahaha it was other thing. Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Yesterday, 05:17 AM
                  0 responses
                  71 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  143 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  76 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  47 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  51 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X