"Interacting with Equity" error message after upgrading to 6.2
Author: elliottp
Creation Date: 7/21/2011 1:56 PM
profile picture

elliottp

#1
This page has a sample on it that loads a strategy by name and executes it: http://www2.wealth-lab.com/WL5Wiki/kbInteractingWithPortfolioEquity.ashx. However, when I run the sample, I get a null pointer exception with the following stack trace:

at Community.Components.Utility.runDonor(WealthScript yourStrategy)
at WealthLab.WealthScript.SetContext(String symbol, Boolean synchronize)
at WealthLab.Bars.ctor(Bars b)

I think the offending line of code is:
// Loop through the DataSet to collect its symbols for MS
obj.SetContext(obj.DataSetSymbols[b], false);

I'm not sure why I'm getting this error, my thought is that it may have something to do with the upgrade to version 6.2. It doesn't seem to matter what strategy I try to run.
profile picture

Eugene

#2
Have you upgraded to the latest build of the library?

Community Components Change Log

v.2011.07, first line
profile picture

elliottp

#3
Yes, I just checked the extension manager and I am using 2011.07
profile picture

Eugene

#4
Everything works for me.

Please provide more information: data provider, which strategies, symbols, data loading range... in other words, anything that can help reproduce the effect.
profile picture

elliottp

#5
I'm running WL dev 6.2 with Community Components 2011.07.

Data provider: Yahoo
Symbols: Yahoo S&P100 basket
Data Range: 10 years
Scale: Daily
Position Size: $5,000 (RP)

The sub-strategy I'm trying to run it the built-in "RSI Rotation" strategy (just for testing). If you run it on a single symbol you can see the full stack trace for the null pointer exception. If you run it on the basket the debug log shows the same for each symbol (but without the full stack trace).

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

Eugene

#6
It works for me on any DataSet w/o an error, regardless of settings, strategy type etc.

1. Make sure you're executing the code on the first symbol of the DataSet.
2. Run "Bad history data check" on the DataSet and exclude any symbols with 0 bars.

Optionally, you might want to add ClearGlobals() on top of the code to clear any garbage in the GOP from unsuccessful runs. (Remove it after the strategy has run fine.)
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).