Getting WL to recognize a custom PosSizer
Author: streak
Creation Date: 5/7/2012 2:22 AM
profile picture

streak

#1

Just compiled a new PosSizer, having copied much from the open source Random2.cs and Fidelity's Creating a PosSizer in Wealth-Lab Pro

The instructions in the above, for when the PosSizer will next be available in the dropdown are quite clear, however I cannot get mine to appear.

Seem to have all the refernces, and associated directives, the dll builds ok, and it is in the WLD folder, but it does not appear in the PosSizer dropdown.

Before posting all the code wondered if there are any suggestions that could be provided like just what WLD needs other than that mentioned in the Fidelity pdf to have WLD see it & load it in the dropdown, please?

I made the namespace; WLjonmac.PosSizers
the class; StockBoundedPosSizer (including deriving PosSizer & ICustomSettings)
and class; StockBoundedPosSizerSettings (incl UserControl)
but haven't furnised SizePosition() with anything appropriate at this stage, other than returning a useless number.
profile picture

Eugene

#2
profile picture

Eugene

#3
streak:
QUOTE:
Have compiled with .Net 2.0 and the dll is in the main folder?

Have you restarted Wealth-Lab after putting the DLL in the main folder?
profile picture

streak

#4
Yes, restarted each time the build is redone from vs (I have the build outputting directly to the main WLD folder - so WLD is required to be closed as the build is made).
profile picture

Eugene

#5
Make sure you're starting the right Wealth-Lab, in case x86 and x64 editions are installed side by side.

If still no go, grab the attachment from this page, and try it with the 100% working library - after making the adjustments to the target folder, .NET version etc.
profile picture

streak

#6

Woops... your reply was very fast. I haven't followed up on your suggestion yet. Thanks. (I only have the x86 (32bit version?)).


Eugene

Should this thread be consolidated on the end of "PosSizer recognition" ?

Maybe I am not understanding how PosSizer interacts with WLD...

I've noticed in the MS123.PosSizers.Demo that the two .cs scripts RandomPosSizer and AverageVolumeLimitationPosSizer both have as their last statement in their settings class InitializeComponent() method the statement;
CODE:
Please log in to see this code.
and the statement;
CODE:
Please log in to see this code.
in their GetSettingsUI() method, while the other two demos Random2PosSizer and PctEqtScriptPosSizer do not have these, but their settings class inherits from UserControl whereas the former 2 PosSizers inherit from PosSizerSettingsBase

My code inherits from UserControl and I figure I am missing 'whatever' to have the small form initiated, invoked or (not sure of the correct term)?

Also noticed the 'Reference' to ControlLibrary is associated with some type of custom user control named NumEdit .... CtrlLib.NumEdit Are these settings properties completed automatically via ControlLibrary?


profile picture

Eugene

#7
QUOTE:
Should this thread be consolidated on the end of "PosSizer recognition" ?

If only we could split and append threads. But let's continue cracking your problem here.
QUOTE:
Also noticed the 'Reference' to ControlLibrary is associated with some type of custom user control named NumEdit .... CtrlLib.NumEdit Are these settings properties completed automatically via ControlLibrary?

CtrlLib.NumEdit is a class from ControlLibrary.dll (that ControlLibrary reference).
QUOTE:
My code inherits from UserControl and I figure I am missing 'whatever' to have the small form initiated, invoked or (not sure of the correct term)?

I strongly suggest you to start by plugging your code into the available demo solution and telling me if compiling from this project worked.
profile picture

streak

#8
Ah, picked your instruction incorrectly... I built the MS123.PosSizers.Demo and copied into the main folder (without my class(es)). It loads as expected. I'll try planting my code into the same namespace and try again.
profile picture

Eugene

#9
The namespace doesn't really matter, as well as things like the logic behind SizePosition, having a UserControl or having custom settings implemented. As long as the DLL file is planted in the right place, the compiler "liked" your implementation, and (for WL 5.6-6.3) target framework version is 3.5 or below - the PosSizer should at least appear in the list. Looking forward to hear what mistake you made. :)
profile picture

streak

#10
Krikey's. No mistake as far as WLD loading the class. Just my slackness; Named it StockBounded but gave it a 'Friendly Name' of "Bound (min and max size)", and so looked for it in the wrong alphabetic place. Sorry to waste your time.

It throws an exception error as I click 'Configure...' though. So have plenty to do (with no experience at reading the "...xxxx Exception Text xxxx...".

Past midnight here so signing off for awhile.

Thanks Eugene.

profile picture

Eugene

#11
Good to hear you finally have it sorted out. I probably couldn't think of this possibility. ;)
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).