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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    100 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    24 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    35 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X