- ago
Hello.

I am using the last build of WL8 and I am getting very frequent "Index out of range. Most be non-negative and less than the size of the collection" error on aleatory basis when trying to run backtests after making drag and drops blocks strategies.

There is not a specific action, this error could happen anytime when I modify any of the drag and drop blocks, regardless of the condition or indicator.
When I save the strategy and restart, it performs the backtest okay but when I modify anything I get the error again, so I most to save the work and restart and then it performs the backtest, and so on.

1
278
10 Replies

Reply

Bookmark

Sort
- ago
#1
Can you copy and paste the complete stack trace from the error dialog?
1
- ago
#2
I was running into that problem, too. I didn't report it, because I was too busy trying various modifications to a strategy. But, yea, it was random.
1
- ago
#3
Where is this error displayed, in the strategy's status bar? Is there something recorded in the Tools > Log viewer?
1
- ago
#4
QUOTE:
Can you copy and paste the complete stack trace from the error dialog?


Do you mean the screenshot?

a) I open a strategy.


b) I backtest it.


c) I modify any bock, random, and when I want to backtest I get the error.


d) I save the work and restart and it performs backtest okay until I randomly modify anything. Then I have to save and restart if I want to get rid of the error message.


Dataset is Wealthdata's SP500


These are the strategy settings but as I said the error is random after modifying any block and when I want to do a backtest (after modifying any block), and after saving and restarting I can backtest until I modify something else.
0
- ago
#5
@Eugene - I reported a problem here: https://wealth-lab.com/Discussion/Building-Block-Strategy-with-ScaleInd-causes-exception-if-edited-9604

Perhaps the issue that espodumenus reported in this thread is related.

Earlier, I had saved the strategy referenced in the above link, with the "AveragePriceHL" modification (see the thread). So, I closed WL and restarted it. I loaded the aforementioned strategy and ran it and immediately got an index out of range exception, which appears to be the same one I reported in the linked post. Glitch indicated he fixed the problem for the next WL release. In any case, here's the stack trace that appeared in the dialog:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at WealthLab.ChartWPF.PriceValuesLabel.AwakeSingleton()
at WealthLab.ChartWPF.PriceValuesLabel.set_BarNumber(Int32 value)
at WealthLab.ChartWPF.ChartPane.TriggerMouseMoveBarNumber(Int32 barNumber)
at WealthLab.ChartWPF.CoreChart.CreateFilter(Int32 num_task, ChartPane reg)
at WealthLab.ChartWPF.CoreChart.AssignBars(BarHistory value, Boolean setOffsetZero, Boolean force, Boolean calledFromStreaming)
at WealthLab.ChartWPF.CoreChart.set_Bars(BarHistory value)
at WealthLab8.cwStrategy.MoveHelper(BarHistory value, StrategyBase b)
at WealthLab8.cwStrategy.ChangeHelper(Object def, EventArgs pred)
at System.Windows.Threading.DispatcherTimer.FireTick()
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
#6
QUOTE:
Where is this error displayed, in the strategy's status bar? Is there something recorded in the Tools > Log viewer?


There is nothing special in the Log.
IB Datafarm connection is ok
0
- ago
#7
@paul, the issue you reported is different.

@espodumenus, looks like that bad data may have something to do about this error.
1
- ago
#8
Where you able to reproduce the error? The dataset is Wealthdata.

I will post here if I get the error with a different dataset
0
- ago
#9
On my machine I created the strategy shown in the above post(s). I set my sole data source to TD Ameritrade and used a dataset that is TDA specific - with the NASDAQ 100 in that dataset. I forced the strategy to use only data from that dataset. The strategy ran fine. I made many modifications and re-runs of the strategy and it always worked fine.

I activated WealthData for historical data, restarted WL, opened the strategy and changed the dataset to S&P 500 (WealthData), again forcing the strategy to use only data from the selected dataset. It ran fine. I made modifications to the strategy - it still ran fine. I switched off the forcing of data to be only from the selected dataset. Lather, rinse, repeat - it always ran fine.

So, if it is a data issue, then perhaps it is data from one of the other providers that is shown by espodumenus in an above post (Yahoo, IB, or Q-Data).

Hope that helps.
0
- ago
#10
QUOTE:
@espodumenus, looks like that bad data may have something to do about this error.


I change the dataset and I am still having the erros, even if I change the strategy. Everytime I change something in a block I get an error when trying to backtest, any dataset, any provider. I can backtest without errors after saving the strategy.
0

Reply

Bookmark

Sort