Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enumeration Operation - Issue # 11671

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

    Enumeration Operation - Issue # 11671

    Dear Support,

    Issue # 11671 was resolved in NT 8.0.8.0 for some scenarios where global drawing objects could result in the error "Collection was modified; enumeration operation may not execute."

    I have a custom indicator that compiles fine but when applied to a chart it will not plot and generates a similar error:

    "Error on calling 'OnBarUpdate' method on bar 1652: Collection was modified; enumeration operation may not execute."

    Since there is no error # reported, have no clues what scenario might have caused this enumeration operation error.

    Any Ideas please.

    Thanks.

    #2
    Hello aligator,

    In general the error is caused when you are iterating a collection and modifying it at the same time. for example if you were using a foreach loop on a list, and removing an item or adding an item to that list in the loop. In this specific example a for loop may be able to be used instead.

    I would suggest to try and locate the specific line of syntax that generates the error, this would provide more detail on the reason. As noted earlier in the example, this is often caused by trying to do an action to the collection you are iterating over. I would try replacing any for loop with a value of 10 rather than a collection variable/object.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 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
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X