Runtime error: Object reference not set to an instance of an object
Author: pestocat2
Creation Date: 12/11/2019 1:34 AM
profile picture

pestocat2

#1
I'm working to convert my code from daily to Weekly. It compiles OK but has a run message.
"Runetime error: Object reference not set to an instance of an object. at WealthLab.Strategies.MyStrategy().Execute()
profile picture

Eugene

#2
Having encountered an error message or an issue, please always check out these pages first:

1. Known Errors
2. Open Issues

In particular, this error message is too general and does not indicate much by itself. At the bottom of this page you'll find a troubleshooting procedure to get it fixed quickly:

Known Errors | Strategy > Object reference not set to an instance of an object
profile picture

kelvinyip

#3
I am running this code on symbol CTL

CODE:
Please log in to see this code.


I get "Object reference not set to an instance of an object"

When I run this code say on ROKU, it works fine. Then,
I look at C:\Users\k\AppData\Roaming\Fidelity Investments\WealthLabPro\1.0.0.0\Data\FidelityWSODFundamentalProvider\C
and I see CTL.WLF what should I check next ?


profile picture

Eugene

#4
This code badly peeks into the future and must be fixed:
CODE:
Please log in to see this code.


Having encountered an error message or an issue, please always check out these pages before reporting it:

1. Known Errors
2. Open Issues

In particular, here's a starting point for your own troubleshooting:

Known Errors > (scroll down to) "Object reference not set to an instance of an object"
profile picture

kelvinyip

#5
hmm, somehow the symbol got data from 1980 and it is like a line....

open, high, low, close =0,0.34,0.35,0.35. If I get rid of these strange data, it works fine.
profile picture

kelvinyip

#6
Like this in the screen shot, it is coming from yahoo finance after adjusting for dividend I suppose
profile picture

Eugene

#7
profile picture

kelvinyip

#8
Checking for null fixed it, I think Fidelity only provides like 5 yrs or 10 yrs of fundamental data

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

hplein

#9
"Error processing symbol SPG Object reference not set to an instance of an object."

This error together with the same message for several other symbols has began to appear. The symbol is valid.

The code being executed is:

CODE:
Please log in to see this code.


Is there a way to isolate which variable is null?
profile picture

Eugene

#10
Have you followed suggestion in the Wiki? Please see post #2 above.

If so, what steps you've taken and what are the results (step by step)?
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).