Custom HelloWorldPositionSizer prevents WL from starting up
Author: Supersol
Creation Date: 10/28/2015 5:36 PM
profile picture

Supersol

#1
Hello!

We tried to develop a "hello-world" Position Sizer. The only thing our class does is to return 1 for the SizePosition method. We have made a reference to Fidelity.Components and WealthLab.dll.

When copying the dll into the walthLab Folder, wealth lab does not start anymore. When deleting the file, WealthLab is starting again..

thx
Supersol
profile picture

Eugene

#2
Hello,

You made an error in the code or in the build process. Like question like answer. To a developer this should be pretty obvious but if you need assistance please don't suppose that we're good at guessing what you're doing wrong. Instead, give us something to work with:

1. In the first place, show your code (which may be incorrectly implemented, may throw an exception which will cause WL to crash on startup etc.).
2. Indicate your WLD bitness and if you have two WL editions installed (have you double checked that you referenced the DLLs of appropriate bitness?)
3. Tell us how you referenced the DLLs (maybe they belong to WLD of different bitness or different version or even WLP?) I see that you're using v6.6 alongside with 6.8 but they use different .NET frameworks (4.0 and 4.5).
profile picture

Supersol

#3
Hi Eugene,

Sorry for not being specific enough..

- We are using WealtLab version 6.6.13 and
- MS Visual Studio Community Edition 2015, version 14.0.23107.0 D14REL,
- based on MS .NET Framework version 4.6.81
- the code compiles without any errors in Visual Studio
- referred references are wealthlab.dll and fidelity.components


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

Supersol

#4
maybe there is something wrong with references? autocomplete does not find BasicPosSizer, only Base64FormatingOptions as class, which for sure is not from WL.

CODE:
Please log in to see this code.


when trying

CODE:
Please log in to see this code.


autocomplete finds WealthLab.PosSizer but not e.g WealthLab.BasicPosSizer
profile picture

Supersol

#5
found. stupid error ;-)

instead of

CODE:
Please log in to see this code.


i did return

CODE:
Please log in to see this code.

profile picture

Supersol

#6
however, thx!
profile picture

Eugene

#7
Hi Mathias,

QUOTE:
found. stupid error ;-)

Glad you sorted it out. As your example above in fact didn't show what your code actually had, I couldn't help you with that anyway. ;)

QUOTE:
autocomplete does not find BasicPosSizer,

Your understanding is correct: there is something wrong with the references. As you could read in the PosSizer API manual, it's the WealthLab.PosSizers assembly that contains an abstract class called BasicPosSizer, not WealthLab.dll. To make your learning curve less steeper, please review the fully functioning example specifically crafted to demontrate both the implementation of BasicPosSizer and PosSizer:

MS123.PosSizers demo