Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error message

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

    Error message

    I received this below error message for the first time in Ninjascript Output Window. What could be the reason why this is triggering?

    Market analyzer column 'Realized profit loss': Error on calling 'OnAccountItemUpdate' method: Collection was modified; enumeration operation may not execute.

    #2
    Hello AgriTrdr,

    Thank you for your post.

    Please be sure that you have added event handlers to subscribe to account item updates. Additionally, it is important to remove the event handler as cleanup when the script terminates. As a test, are you able to reproduce this message using the code shown in the help guide for AccountItemUpdate? Here is the link:



    Another item that may cause this type of error is creating a collection of items, such as a list, and the collection is changed/modified in flight. An example is trying to loop through a list, and the list is updated while the loop is in progress. Something you could do to prevent this is to make a copy of the list with ToList() and then loop through the copied list.

    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    59 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X