Object reference not set to an instance of an object error message
Author: fastrade
Creation Date: 1/16/2010 12:48 PM
profile picture

fastrade

#1
when I run the code bellow in wl5.6 I get the following error message:
"Error processing symbol VIV Object reference not set to an instance of an object."
Where VIV is the last symbol in the dataset. In general this error message is generated for the last symbol in any list that I use. I was not getting any error messages with wl 5.5. Do you know why? TIA

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Some guidance on this new error from our Wealth-Lab Wiki FAQ: Object reference not set to an instance of an object.

Remove 2 (why 2?) calls to Bars.Cache.Clear(), they aren't necessary here at all.

Which data provider? Does that happen with a particular provider e.g. Fidelity, and does not with another e.g. Yahoo ?
profile picture

fastrade

#3
I did remove the calls to Bars.Cache.Clear(). It did not fix the problem. I am using Fidelity as my data source. This code worked without producing error message in wl 5.5!
profile picture

Eugene

#4
Have you restarted WLP?

Does it work without errors when using a dataset by some other data provider e.g. Yahoo?

Data range, time frame, which symbols, how exactly do you run this code?
profile picture

fastrade

#5
I restarted wl. I don't have anyother data provider other than Fidelity. I use 1 minute time fram. I select the dataset that I want to export then I select this strategy then I selct "backtest on Symbols in" dataset. What I don't understand is that why did it work in 5.5 with no error and it produces error in 5.6?
profile picture

Eugene

#6
QUOTE:
I selct "backtest on Symbols in" dataset.

May I ask why?

The code is designed to be executed on just 1 symbol only. It loops by DataSetSymbols on its own. When you run it by clicking "Backtest on all symbols...", it runs DataSetSymbols ^ 2 times.
profile picture

fastrade

#7
The only two ways that I know to run this strategy is to pick the desired dataset or symbol (if I want to limit to one symbol) then select strategy. From here then I have two choices, either select multi symbol backtest or go inside editor and select run strategy. Is there any other way? I guess I don't understand your question!
profile picture

Eugene

#8
You can't limit this Strategy to the desired symbol. It always processes the whole DataSetSymbols list. Hence, it makes no sense to run it in MSB mode.

Take a look in the QuickRef > DataSetSymbols. If you're familiar with WL4, then this is how we used to loop by WatchListCount there.

P.S. To be able to limit this Strategy to run on a single symbol, the DataSetSymbols loop should be removed.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).