- ago
When dealing with this tab I usually get this exception (not actually sure it’s the same one every time). I didn’t get the idea of the context for reproducing it, but some details: I’m debugging with Visual Studio 2019, using Edit and Continue feature, after starting a backtesting process if you somehow interact with Equity Curve tab you’ll sometimes will get this exception. Something like selecting different tabs and zooming previous equity will help to meet this exception.


System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at WealthLab.Backtest.Backtester.get_WinningPositions()
at WealthLab.Backtest.BasicScoreCard.Initialize(Backtester bt)
at WealthLab.Backtest.MetricsBundle.GetMetric(String metricName)
at WealthLab.Backtest.MetricsBundle.TryGetMember(GetMemberBinder binder, Object& result)
at CallSite.Target(Closure , CallSite , Object )
at WealthLab7.visEquityCurve.PublishTest(Object reference, MouseEventArgs col)
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
524
8 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.41% )
- ago
#1
I shored up this code for Build 9, let's see if that eliminates these issues.
1
- ago
#2
Glad to hear that, I was sure that I'm not the only one to meet this).
0
- ago
#3
Those exceptions were gone, but I've just met one, that was somewhere near:

What I was doing befor:
I was backtesting), the Equity Curve tab was open.

System.ArgumentException: Destination array was not long enough. Check the destination index, length, and the array's lower bounds. (Parameter 'destinationArray')
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at WealthLab.Backtest.BasicScoreCard.Initialize(Backtester bt)
at WealthLab.Backtest.MetricsBundle.GetMetric(String metricName)
at WealthLab.Backtest.MetricsBundle.TryGetMember(GetMemberBinder binder, Object& result)
at CallSite.Target(Closure , CallSite , Object )
at WealthLab7.visEquityCurve.ListValue(Object setup, MouseEventArgs connection)
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
- ago
#4
So it happened when you moused over the chart. There's quite a lot of things going on in this domain. Can you give an insight into that backtest's details? Can you take a screen capture? Is this reproducible or a one-time event?
0
- ago
#5
It was one time event, I have no idea how to reproduse it).

Ok, I'll attach a screenshot next time if it helps.
0
- ago
#6
I think this one looks different. Maybe this difference will help somehow, because still this is a rare event, nothing to add to help reproducing. I was backtesting and I'm pretty sure Equity Curve tab was open.

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
at System.Linq.Set`1.UnionWith(IEnumerable`1 other)
at System.Linq.Enumerable.DistinctIterator`1.FillSet()
at System.Linq.Enumerable.DistinctIterator`1.ToList()
at WealthLab.Backtest.BasicScoreCard.Initialize(Backtester bt)
at WealthLab.Backtest.MetricsBundle.GetMetric(String metricName)
at WealthLab.Backtest.MetricsBundle.TryGetMember(GetMemberBinder binder, Object& result)
at CallSite.Target(Closure , CallSite , Object )
at WealthLab7.visEquityCurve.ListValue(Object setup, MouseEventArgs connection)
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
- ago
#7
Yes, this one's different and isn't coming from the Equity Curve. Can you start a new topic and include the backtest settings?
1
- ago
#8
Oops, I've closed WL7 already).
0

Reply

Bookmark

Sort