Custom Scorecard throws OutOfRange exception
Author: timprice7
Creation Date: 10/17/2013 7:57 AM
profile picture

timprice7

#1
I've implemented a custom performance visualizer report and that works fine.
I'm now trying to develop a custom scorecard to use in strategy rankings but I'm having trouble getting even a simple test to work so I must be overlooking something obvious. Any help would be appreciated. Thanks.

Windows 7
WealthLab 6.5.20 (64 bit edition)
Visual Studio 2012

Here is a summary of the steps I took in the test...
1) Created a new project and added the MS123Scorecard , PerformanceEngine and ListViewSortManager cs files provided in the downloaded open source (_WealthLab.Visualizers.MS123.2012.07.demo.zip)
2) In all 3 files, modified namespace to MyScorecardPV
3) In the MS123Scorecard cs file, modified the friendly name string to MyScorecard1
4) Added required references, successfully built the assembly DLL (.NET 4.0) and placed it into the wealthlab directory
5) Started WealthLab
6) Open a strategy that creates a few trades
7) Go to tools dropdown and start 'Strategy Rankings' window.
8) Go to the scorecard dropdown to look at list of available scorecards
9) Select scorecard. I created... MyScorecard1
10) Index out of range exception occurs immediately in System.SzArrayHelper .get_Item, ... Strategy Scorecard.ListViewColumns(see attachment)

I've repeated this more than a dozen times, changing various aspects... renaming items, restarting projects....
Any help would be appreciated.
Thanks.



profile picture

timprice7

#2
Here's the attachment ...
profile picture

Eugene

#3
You modified the namespace and friendly name, but make sure that you have renamed the class itself too. It should not duplicate the name of an existing Scorecard.
profile picture

timprice7

#4
Hi Eugene. Thanks for the fast response. I did change the class name so that wasnt the problem. I also tried changing the name of the PerformanceEngine class to see if that made a difference and tried eliminating the ListViewSortManager from the build. Neither helped - problem was the same. Any other ideas?
profile picture

Eugene

#5
Also make sure that the solution's Guid and the DLL file name are different.
profile picture

timprice7

#6
Gave my scorecard project a new Guid, rebuilt,redeployed, restated WealthLab - same result.

Looking at the error message, it looks like there might be 2 arrays with mismatched sizes potentially.
I went to the MS123Scorecard cs file and saw that there are4 string arrays...
_rawProfitHeaders
_portSimHeaders

_rawProfitTypes
_portSimTypes

I'm using portfolio simulation mode, so I counted the number of strings in portSimHeaders and portSimTypes.
There were 40 and 35 strings in them respectively so I tried an experiment.
I added 5 more strings to portSimTypes so that both arrays had same number of items.
Rebuilt, redeployed and restarted WealthLab and exception is gone.
I was kind of flying blind so I'm not real confident in the solution even though it appeared to work.
I also would need to accept that the MS123Scorecard has a bug that hasn't been reported.
Thoughts?
Thanks again for the help.
profile picture

Eugene

#7
MS123 Scorecard has no bugs to be reported, the problem was in the demo attachment of the library's previous generation. The array mismatch in the demo version must have occurred when I made quite a bit of on-the-fly manual editing when adding some stuff on request earlier this year. I've just uploaded an updated attachment. Thanks for nailing down the problem and sorry for the inconvenience.
profile picture

timprice7

#8
Thanks again for the fast response.
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).