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 TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    541 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    3 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Working...
    X