- ago
Steps to reproduce
1) Open a building Block Strategy (ie: Simple Channel Breakout 50)
2) Run backtest
3) interact with various visualizers... equity curve, metrics, distribution
4) Change strategy values on design surface tab
5) Start new Backtest
6) Before back test completes, interact with visualisers
- change distribution metric drop box, zoom equitycurve, change scorecard, etc

NOTE: You may need to repeat steps 4-6 more than once to cause exception.

I have noticed a similar error caused by changing scorecards, zooming (or resetting zoom) on drawdown and equity charts etc. I believe it has to do with the underlying data being "dumpped" or binding object set to nothing or .clear during the new backtest ready for populating again. Suggest adding a safety that disables visualizer controls (so you can view tab but not intereact with components) until populated with new data.



QUOTE:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at WealthLab7.visDistributions.SearchAuthentication()
at WealthLab7.visDistributions.Populate(Backtester backtester, Backtester backtesterBenchmark)
at CreatorDatabase.StopMapper(Object , Backtester , Backtester , CreatorDatabase )
at WealthLab7.visDistributions.FillAuthentication(Object reference, SelectionChangedEventArgs vis)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.ComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
at System.Windows.Controls.ComboBox.NotifyComboBoxItemMouseUp(ComboBoxItem comboBoxItem)
at System.Windows.Controls.ComboBoxItem.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
0
247
Solved
9 Replies

Reply

Bookmark

Sort
- ago
#1
I saw something similar to this with compiled strategies too I guess. And I guess this exception is from one of new builds.
0
- ago
#2
QUOTE:
6) Before back test completes, interact with visualisers
...
NOTE: You may need to repeat steps 4-6 more than once to cause exception.

Well it takes some patience and effort to cause this exception :)
0
- ago
#3
Secret Ingredients to success (in programing, trading and life)

Patience and Effort. ;-)
0
- ago
#4
This exception is like a good Easter egg - only takes 1/2 year to discover :)
0
- ago
#5
haha... Not for me. I did my Masters in "Breaking Stuff"
1
Glitch8
 ( 10.94% )
- ago
#6
While this is a legit report, I’d consider it a lower priority especially since Visualizers are potentially third party code. Let’s call it a known issue and stick to best practice of just letting the backtest complete before manipulating the Visualizers.

I mean, if I try hard enough I can even get Visual Studio to break.
0
Best Answer
- ago
#7
That's entirely your call.

My "quickfix" suggestion would be to disable the container on visualizer tabs (Or the tabs) that hold charting controls while a BT is undwerway - and enable once complete.

This would prevent user interaction with the charts along with associated checkbox and combobox controls And, it would enforce your "best practice usage model"
0
Glitch8
 ( 10.94% )
- ago
#8
I agree that would be the solution, we're already doing that for optimizations.

Feel free to submit this as a request and the community can help decide its priority.
0
- ago
#9
well played... :-)
0

Reply

Bookmark

Sort