I hope you are doing well.
This morning i got the following error in an automatic strategy that I have running and made the strategy to disconnect:
Error on calling 'OnBarUpdate' method on bar 5100: Collection was modified; enumeration operation may not execute.
I've never had this issue before and i was wondering if you could provide some guidelines on what creates this issue and how to avoid it next time.
Below the Log of this morning. Error is in time 10:00:53 (highlighted in red):
05/03/2024 10:00:53 | Order | Order='162379006/PRACTICEFeb193454011' Name='MMDOS2E' New state='Cancelled' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18057.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162378533/PRACTICEFeb193454011' Name='MMDOS1E' New state='Cancelled' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18059.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162376909/PRACTICEFeb193454011' Name='MMDOS5' New state='Cancelled' Instrument='NQ MAR24' Action='Sell short' Limit price=18073.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162376906/PRACTICEFeb193454011' Name='MMDOS4' New state='Cancelled' Instrument='NQ MAR24' Action='Sell short' Limit price=18071.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162379006/PRACTICEFeb193454011' Name='MMDOS2E' New state='Cancel submitted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18057.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162378533/PRACTICEFeb193454011' Name='MMDOS1E' New state='Cancel submitted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18059.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162376909/PRACTICEFeb193454011' Name='MMDOS5' New state='Cancel submitted' Instrument='NQ MAR24' Action='Sell short' Limit price=18073.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162376906/PRACTICEFeb193454011' Name='MMDOS4' New state='Cancel submitted' Instrument='NQ MAR24' Action='Sell short' Limit price=18071.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162379083/PRACTICEFeb193454011' Name='MMDOS3E' New state='Working' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18059.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='162379083/PRACTICEFeb193454011' Name='MMDOS3E' New state='Accepted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18059.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Order | Order='2c967158d63a4ccead7b39c2801d57d9/PRACTICEFeb193454011' Name='MMDOS3E' New state='Submitted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18059.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:53 | Default | Disabling NinjaScript strategy 'Prod_DonchianMMOverextALLv4/320688240' |
05/03/2024 10:00:53 | Default | Strategy 'Prod_DonchianMMOverextALLv4': Error on calling 'OnBarUpdate' method on bar 5100: Collection was modified; enumeration operation may not execute. |
05/03/2024 10:00:53 | NinjaScript | NinjaScript strategy 'Prod_DonchianMMOverextALLv4/320688240' submitting order |
05/03/2024 10:00:53 | Execution | Execution='1205759|162376905|162376905' Instrument='NQ MAR24' Account='PRACTICEFeb193454011' Exchange=Globex Price=18069.25 Quantity=1 Market position=Short Operation=Operation_Add Order='162376905' Time='3/5/2024 10:00 AM' |
05/03/2024 10:00:53 | Order | Order='162376905/PRACTICEFeb193454011' Name='MMDOS3' New state='Filled' Instrument='NQ MAR24' Action='Sell short' Limit price=18069.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=1 Fill price=18069.25 Error='No error' Native error='' |
05/03/2024 10:00:53 | Position | Instrument='NQ MAR24' Account='PRACTICEFeb193454011' Average price=18066.58333333 Quantity=3 Market position=Short Operation=Update |
05/03/2024 10:00:52 | Order | Order='162379006/PRACTICEFeb193454011' Name='MMDOS2E' New state='Working' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18057.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:52 | Order | Order='162379006/PRACTICEFeb193454011' Name='MMDOS2E' New state='Accepted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18057.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:52 | Order | Order='12d4f239628f4cfeb0cc062c9ad06b1c/PRACTICEFeb193454011' Name='MMDOS2E' New state='Submitted' Instrument='NQ MAR24' Action='Buy to cover' Limit price=18057.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
05/03/2024 10:00:52 | Order | Order='162376903/PRACTICEFeb193454011' Name='MMDOS2' New state='Filled' Instrument='NQ MAR24' Action='Sell short' Limit price=18067.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=1 Fill price=18067.25 Error='No error' Native error='' |
05/03/2024 10:00:52 | Position | Instrument='NQ MAR24' Account='PRACTICEFeb193454011' Average price=18065.25 Quantity=2 Market position=Short Operation=Update |
05/03/2024 10:00:52 | NinjaScript | NinjaScript strategy 'Prod_DonchianMMOverextALLv4/320688240' submitting order |
05/03/2024 10:00:52 | Execution | Execution='1217973|162376903|162376903' Instrument='NQ MAR24' Account='PRACTICEFeb193454011' Exchange=Globex Price=18067.25 Quantity=1 Market position=Short Operation=Operation_Add Order='162376903' Time='3/5/2024 10:00 AM' |
Please let me also know if you need to check the strategy code or something else.
Thank you in advance!
Comment