- ago
Hi.

I built the following strategy:



The Streategy Settings are as shown below:



The strategy executes smoothly.
But when I click Optimize, the following error is shown:



Any idea what the problem is?

Thanks.
0
501
9 Replies

Reply

Bookmark

Sort
- ago
#1
An exploded view of the strategy:

0
- ago
#2
Please click "Copy to Clipboard" and then paste the entire stack trace here. Thanks.
0
- ago
#3
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at WealthLab.Backtest.WFOOptimizer.CreateResultList(List`1 lst, Int32 intervals, Double oosPercent, WFOWindowType wt, IOptimizerHost host)
at ValueExporter.RestartAnnotation(List`1 , Int32 , Double , WFOWindowType , IOptimizerHost , ValueExporter )
at WealthLab8.ucOptimization.ReadPool()
at WealthLab8.ucOptimization.DataLoaded()
at WealthLab8.cwStrategy.OpenOptimizationUI()
at WealthLab8.cwStrategy.CancelPredicate(Object init, RoutedEventArgs selection)
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.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at CodeServer.RevertStatementObject(Object , CodeServer )
at WealthLab.WPF.WLButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.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
Cone8
 ( 28.32% )
- ago
#4
Can you post a picture of the WFO setup - showing the Optimization Method selected?
0
- ago
#5
Well, something very strange just happend.

As Cone said, I went into optimization after the bakctest as described in my post above. The error comes up before entering the optimization parameters, right at the moment I click "Optimize".

The error happened again, so I went to "continue" and proceeded to the WFO configuration screen to take the screenshot, but there was clear without parameters set.

Then I decided to do a test:

I closed Wealth Lab, opened the strategy again and went straight to "Optimize" before performing the backtest. The optimization started without errors. I closed the optimization and closed the WL.

Then I opened the WL and the strategy again. I ran the backtest and after it was done I clicked on "Optmize". Now it doesn't give errors anymore. It's like the fact that I ran the "Optimize" first without doing the backtest corrected some wrong parameter.

It seems to be working now, I am running the optimization, waiting for it to finish.
0
- ago
#6
By the way, when I first received the error, was selected Walk-Forward optimization
0
Cone8
 ( 28.32% )
- ago
#7
I had started a WFO when I posted. It's still running, no problems. That's why I was asking for the settings to see if there was something I missed.
0
- ago
#8
Well, I have no idea how this problem happened the first time I went to run the optimization, but now it seems to be normalized. I even finished a WFO.
0
- ago
#9
We'll try to protect the method more to avoid this exception.
1

Reply

Bookmark

Sort