![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
Get message:
Error on calling 'OnBarUpdate' method for indicator '[routine name]' on bar 14: Collection was modified; enumeration operation may not execute. I occasionally need to take all drawn text off the screen, Each message has a unique tag. but RemoveDrawObject(tag) gives this message when I try to loop through all text tags. Bar 14 is just an arbitrary staring point. Message occurs for any value. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello roland_nt,
Thanks for writing in and I am happy to assist you. You cannot delete any object the collections while in a foreach loop. Thus you cannot use the RemoveDrawObjest(tag) code within the foreach loop. This is a more of a c# query and please refer here for more details http://stackoverflow.com/questions/6...ay-not-execute Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#4 |
|
Senior Member
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
Koganam
Thanks. Very helpful. Roland : |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Removing Draw Objects | djkiwi | General Programming | 6 | 03-16-2011 12:29 AM |
| Removing drawing objects | advs108 | General Programming | 3 | 05-24-2010 02:52 PM |
| Removing Text | velocity | General Programming | 5 | 12-21-2009 07:38 AM |
| removing text from screen | always4nu | Charting | 5 | 10-01-2009 08:20 AM |
| Strategy: Removing draw objects from the chart | NinjaTrader_Josh | Reference Samples | 0 | 07-23-2009 10:55 AM |