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 KenneGaray, Today, 03:48 AM
    0 responses
    3 views
    0 likes
    Last Post KenneGaray  
    Started by thanajo, 05-04-2021, 02:11 AM
    4 responses
    470 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by aa731, Today, 02:54 AM
    0 responses
    4 views
    0 likes
    Last Post aa731
    by aa731
     
    Started by Christopher_R, Today, 12:29 AM
    0 responses
    10 views
    0 likes
    Last Post Christopher_R  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    166 responses
    2,237 views
    0 likes
    Last Post sidlercom80  
    Working...
    X