CreateParameter scope: marked as protected
Author: jalalfeghhi1
Creation Date: 1/25/2012 11:50 AM
profile picture

jalalfeghhi1

#1
Eugene, Cone
The method CreateParameter, for a strange reason, is defined protected within Wealthscript; all other methods are naturally defined public. This is creating a big problem for me: I have successfully created a lib (dll) for my wlp applications. Within my app, I initialize the lib with passing my instance of Wealthscript and then use my dll components. This approach is similar to WealthLab.Components.Community.dll. However, because CreateParameter is defined protected, I cannot access it within my DLL (I can of course access all the other methods). For the same reason, WealthLab.Components.Community.dll can never access CreateParameter if it ever wanted to.

I don't want to jump to conclusions, but because CreateParameter is the ONLY method that is defined protected, I am assuming this is a bug. Would it be possible to provide a patch asap? Do you know of any workarounds?

-thanks, J
profile picture

Eugene

#2
Let's start with that there's nothing to fix "asap" here as WealthScript works for what it was designed: in everyone's code-based, rule-based, Combo Strategies and compiled Strategy libraries.

The developers could have a good reason for marking the method as protected. Since it only affects your library, I suggest you use System.Reflection with the proper BindingFlags to access the protected method.
profile picture

jalalfeghhi1

#3
Eugene,
I brought up an issue that I felt might be important to WLP. The reason that it only affects my lib is that no one else has tried to use CreateParamter in a separate dll. For example, try to use it within WealthLab.Components.Community.dll and see that it won't work. All the other methods within WS are public except for CreateParameter. Now everyone who wants to use CreateParamter must subclass WS and use it within the subclass, which prevents the creation of components.

It might be worthwhile checking with the developers; I would appreciate that.

-best, j
profile picture

Eugene

#4
J,
Important to WLP you say? It's probably the most uncommon request of those thousands I heard in these four years of Wealth-Lab .NET!
profile picture

jalalfeghhi1

#5
Eugene, b/c CreateParameter cannot be put into a component, now it is impossible to use optimization capability of WLP in a component library. This is very important to me and might be to the community in the future, not sure.

At any rate, it would have not hurt to ask the developers why all the WS methods are public except just ONE method, CreateParameter. After all, they are humans and this might have been an oversight...

-j
profile picture

Eugene

#6
J,

Let me disagree. It is possible to use optimization capability using the open and documented Optimizer API. This is how it should be properly accomplished. And even without the API, it's still possible as proven by Dave Aronow's unreleased WFO optimization library (created before the API arrived in v5.4).
profile picture

jalalfeghhi1

#7
Ok, thanks, I'll look into it.
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).