- ago
While creating a Building Blocks strategy, when adding a condition "Indicator Compare to Value" when I start typing "ind...", I get this exception:
QUOTE:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at WealthLab.Norgate.IndexConstituentTimeSeries.PopulateInternal()
at WealthLab.Norgate.IndexConstituentTimeSeries.Populate()
at WealthLab.Indicators.IndicatorFactory.ReconcileIndicator(IndicatorBase ib, BarHistory bh, List`1 indicators)
at WealthLab.Indicators.IndicatorFactory.ReconcileDummy(IndicatorBase ib)
at WealthLab.Core.Parameter.GetIndicatorDesc()
at WealthLab.Backtest.IndicatorValue.get_Description()
at WealthLab8.ucBuildingBlockPanel.StartPolicy()
at WealthLab8.BuildingBlockContainer.RegisterThread()
at WealthLab8.ucBuildingBlockPanel.paramValueChanged(Object sender, EventArgs e)
at WealthLab.WPF.ParameterEditorPanel.SelectService(Parameter var1)
at WealthLab.WPF.ParameterEditorPanel.ManageService(Object reference, SelectionChangedEventArgs cont)
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.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetCurrentValueInternal(DependencyProperty dp, Object value)
at System.Windows.Controls.ComboBox.TextUpdated(String newText, Boolean textBoxUpdated)
at System.Windows.Controls.ComboBox.OnEditableTextBoxTextChanged(Object sender, TextChangedEventArgs e)
at System.Windows.Controls.TextChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
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.Primitives.TextBoxBase.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
at System.Windows.Documents.TextContainer.EndChange(Boolean skipEvents)
at System.Windows.Documents.TextRangeBase.EndChange(ITextRange thisRange, Boolean disableScroll, Boolean skipEvents)
at System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose()
at System.Windows.Documents.TextEditorTyping.DoTextInput(TextEditor This, String textData, Boolean isInsertKeyToggled, Boolean acceptControlCharacters)
at System.Windows.Documents.TextEditorTyping.TextInputItem.Do()
at System.Windows.Documents.TextEditorTyping.ScheduleInput(TextEditor This, InputItem item)
at System.Windows.Documents.TextEditorTyping.OnTextInput(Object sender, TextCompositionEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnTextInput(TextCompositionEventArgs e)
at System.Windows.UIElement.OnTextInputThunk(Object sender, TextCompositionEventArgs 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.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(Tuple`2 postProcessInput, ProcessInputEventArgs processInputEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(Tuple`2 postProcessInput, ProcessInputEventArgs processInputEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
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
735
Solved
9 Replies

Reply

Bookmark

Sort
- ago
#1
I was able to recreate the problem. Steps...

Drag 'Indicator Compare to Value' into a block.
Click the down-arrow on the Indicator field
Type Ind
Exception occurs

Here's the stack trace...
System.InvalidCastException: Unable to cast object of type 'System.String' to type 'WealthLab.Core.TimeSeries'.
at WealthLab.Core.Parameter.get_AsTimeSeries()
at WealthLab.Indicators.SMA.Populate()
at WealthLab.Indicators.IndicatorFactory.CreateIndicator(String name, ParameterList parameters, BarHistory bh)
at WealthLab.Indicators.IndOnInd.Populate()
at WealthLab.Indicators.IndicatorFactory.ReconcileIndicator(IndicatorBase ib, BarHistory bh, List`1 indicators)
at WealthLab.Indicators.IndicatorFactory.ReconcileDummy(IndicatorBase ib)
at WealthLab.Core.Parameter.GetIndicatorDesc()
at WealthLab.Backtest.IndicatorValue.get_Description()
at WealthLab8.ucBuildingBlockPanel.StartPolicy()
at WealthLab8.BuildingBlockContainer.RegisterThread()
at WealthLab8.ucBuildingBlockPanel.paramValueChanged(Object sender, EventArgs e)
at WealthLab.WPF.ParameterEditorPanel.SelectService(Parameter var1)
at WealthLab.WPF.ParameterEditorPanel.ManageService(Object reference, SelectionChangedEventArgs cont)
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.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetCurrentValueInternal(DependencyProperty dp, Object value)
at System.Windows.Controls.ComboBox.TextUpdated(String newText, Boolean textBoxUpdated)
at System.Windows.Controls.ComboBox.OnEditableTextBoxTextChanged(Object sender, TextChangedEventArgs e)
at System.Windows.Controls.TextChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
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.Primitives.TextBoxBase.OnTextChanged(TextChangedEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
at System.Windows.Controls.TextBox.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e)
at System.Windows.Documents.TextContainer.EndChange(Boolean skipEvents)
at System.Windows.Documents.TextRangeBase.EndChange(ITextRange thisRange, Boolean disableScroll, Boolean skipEvents)
at System.Windows.Documents.TextRange.System.Windows.Documents.ITextRange.EndChange(Boolean disableScroll, Boolean skipEvents)
at System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose()
at System.Windows.Documents.TextEditorTyping.DoTextInput(TextEditor This, String textData, Boolean isInsertKeyToggled, Boolean acceptControlCharacters)
at System.Windows.Documents.TextEditorTyping.TextInputItem.Do()
at System.Windows.Documents.TextEditorTyping.ScheduleInput(TextEditor This, InputItem item)
at System.Windows.Documents.TextEditorTyping.OnTextInput(Object sender, TextCompositionEventArgs e)
at System.Windows.Controls.Primitives.TextBoxBase.OnTextInput(TextCompositionEventArgs e)
at System.Windows.UIElement.OnTextInputThunk(Object sender, TextCompositionEventArgs e)
at System.Windows.Input.TextCompositionEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
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.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(Tuple`2 postProcessInput, ProcessInputEventArgs processInputEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(Tuple`2 postProcessInput, ProcessInputEventArgs processInputEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
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
Glitch8
 ( 12.10% )
- ago
#2
Please update the Norgate extension to Build 2 to fix this.
0
- ago
#3
Thanks, Glitch. I don't know if this will help, but I've never installed Norgate.
0
Glitch8
 ( 12.10% )
- ago
#4
Hi Paul, I can't duplicate your exception locally. This is Build 32?
0
- ago
#5
I also wasn't able to reproduce neither in B32 which has Norgate's plugin nor in B33 which hasn't. Neither the AOOR nor the InvalidCast exceptions.
0
- ago
#6
I had the Norgate installed and the upgrade to Build 2 seems to have solved it indeed.

Thank you once again!
0
- ago
#7
WL 8 build is 32. It happened on my junky laptop. I had a hard time recreating it on my main machine (no Norgate there either), but finally figured out what causes it...

Create a new BB strategy with only Buy At Market and Sell At Market blocks.
Drag an 'Indicator Crosses Signal Line' into the Buy At Market block. Ok the defaults.
Drag an 'Indicator Crosses Value' into the Buy At Market block. Click on the Indicator field drop-down arrow.
Type Ind.
Exception occurs.

I was able to recreate this problem multiple times.

Hope that helps.
1
- ago
#8
I can confirm what paul1986 reports. I followed his instructions and got the exception:

QUOTE:
System.InvalidCastException: Unable to cast object of type 'System.String' to type 'WealthLab.Core.TimeSeries'.
at WealthLab.Core.Parameter.get_AsTimeSeries()
at WealthLab.Indicators.SMA.Populate()
at WealthLab.Indicators.IndicatorFactory.CreateIndicator(String name, ParameterList parameters, BarHistory bh)
at WealthLab.Indicators.IndOnInd.Populate()
at WealthLab.Indicators.IndicatorFactory.ReconcileIndicator(IndicatorBase ib, BarHistory bh, List`1 indicators)
at WealthLab.Indicators.IndicatorFactory.ReconcileDummy(IndicatorBase ib)
at WealthLab.Core.Parameter.GetIndicatorDesc()
at WealthLab.Backtest.IndicatorValue.get_Description()
at WealthLab8.ucBuildingBlockPanel.StartPolicy()
at WealthLab8.BuildingBlockContainer.RegisterThread()
at WealthLab8.ucBuildingBlockPanel.paramValueChanged(Object sender, EventArgs e)
at WealthLab.WPF.ParameterEditorPanel.SelectService(Parameter var1)
at WealthLab.WPF.ParameterEditorPanel.ManageService(Object reference, SelectionChangedEventArgs cont)
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
Glitch8
 ( 12.10% )
- ago
#9
Thanks, that did it. Fixed it for Build 33.
0
Best Answer

Reply

Bookmark

Sort