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 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
    Paul H.NinjaTrader Customer Service

    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.




        Paul H.NinjaTrader Customer Service

        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

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            19 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            181 views
            0 likes
            Last Post jeronymite  
            Working...
            X