Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trouble removing Text objects

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

    trouble removing Text objects

    Get message:
    Error on calling 'OnBarUpdate' method for indicator '[routine name]' on bar 14: Collection was modified; enumeration operation may not execute.

    I occasionally need to take all drawn text off the screen, Each message has a unique tag. but
    RemoveDrawObject(tag) gives this message when I try to loop through all text tags.

    Bar 14 is just an arbitrary staring point. Message occurs for any value.

    #2
    Hello roland_nt,
    Thanks for writing in and I am happy to assist you.

    You cannot delete any object the collections while in a foreach loop. Thus you cannot use the RemoveDrawObjest(tag) code within the foreach loop.

    This is a more of a c# query and please refer here for more details
    http://stackoverflow.com/questions/6...ay-not-execute

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by roland_nt View Post
      Get message:
      Error on calling 'OnBarUpdate' method for indicator '[routine name]' on bar 14: Collection was modified; enumeration operation may not execute.

      I occasionally need to take all drawn text off the screen, Each message has a unique tag. but
      RemoveDrawObject(tag) gives this message when I try to loop through all text tags.

      Bar 14 is just an arbitrary staring point. Message occurs for any value.
      This thread deals with that exact issue. If you read it, you will get the code to do what you want. http://www.ninjatrader.com/support/f...ad.php?t=44194

      Comment


        #4
        deleting draw objects

        Koganam

        Thanks. Very helpful.
        Roland
        :

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by wildleanketosale, Today, 03:49 AM
        0 responses
        1 view
        0 likes
        Last Post wildleanketosale  
        Started by wildleanketosale, Today, 03:48 AM
        0 responses
        2 views
        0 likes
        Last Post wildleanketosale  
        Started by hiltonvarai, Today, 03:10 AM
        0 responses
        1 view
        0 likes
        Last Post hiltonvarai  
        Started by afyuwi, Today, 02:33 AM
        0 responses
        2 views
        0 likes
        Last Post afyuwi
        by afyuwi
         
        Started by wushutrades, Today, 01:41 AM
        0 responses
        4 views
        0 likes
        Last Post wushutrades  
        Working...
        X