"Object reference not set to an instance of an object" when changing Data Range
Author: Shourui
Creation Date: 11/8/2010 2:06 PM
profile picture

Shourui

#1
CODE:
Please log in to see this code.


I created DataSource from CSV files, which has OHLC and some custom fields, like current market cap "CUR_MKT_CAP". When I run the code above on some index such as (S5TELS, S&P telecome sector index)using "All Data" or some selcted "Date Range" like 9/27/2009 to today" or "Most recent 24 Months", it is fine. However, sometimes it threw out runningtime error "Object reference not set to an instance of an object" when I choose other data range, ex: "Most recent 25 Months" or "10/1/2009 to today". I can't figure out why it is not working on some selected date. I opened the files. All "CUR_MKT_CAP" data has valied value.
Also, the code is always working on SPX INDEX itself.
Any thoughts? Thx.
profile picture

Cone

#2
Since you synchronized in SetContext it shouldn't matter, but if you RestoreContext() after assigning SPXMktCap[Bars.Count-1]; does it help? Assuming that it doesn't, we'll need a support ticket with the data, please.
profile picture

Shourui

#3
how to create a support ticket with data? thx.
profile picture

Cone

#4
Send the data files to zip file and attach it to the ticket using the controls at the bottom of the ticket form.
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).