Something is wrong with the ICustom Settings in my custom Optimizer that I derived from the open source Average Volume Limitation PosSizer in the WIKI. The relevant code in my Optimizer is:
CODE:
Please log in to see this code.
When I click on Settings in my Optimizer, the Optimizer Settings dialog box is empty, instead of being populated with my Options User Control. Also, nothing is being written to WealthLabConfig.txt. Obviously, I'm doing something wrong, but I can't find the problem.
Size:
Color:
I don't think you're executing your initialization code because you've instantiated _settings at its declaration so it isn't null in GetSettingsUI. Declare it simply as "private Options _settings;", then add the indicated line in GetSettingsUI.
CODE:
Please log in to see this code.
Size:
Color:
Thanks, but that is now giving me an unhandled null reference exception at
CODE:
Please log in to see this code.
this.numberOfSteps is null.
I need to get away from this for awhile, but thank you for holding my hand for the last two days.
Size:
Color:
I decided to go back to basics and use a simple optimizer and add the ICustomSettings implementation from Community.Commissions to make sure I hadn't screwed something else up. That is now giving me a new error message 'Abacus_User_Interface.UserControls.numberOfSteps' is inaccessible due to its protection level.
Here's the full code:
Edited by Eugene: fixed overquoting of MS123 LLC intellectual propertyCODE:
Please log in to see this code.
Size:
Color:
The line...
CODE:
Please log in to see this code.
seems to be trying to directly set a variable.
PSO is rather calling a Setter. So, an equivalent line from PSO
CODE:
Please log in to see this code.
is calling the following code...
CODE:
Please log in to see this code.
Look at me, teaching Windows Forms!
Size:
Color:
Thanks again. The problem was even more basic than that. In my Options form, the variables are private by default. Changing them to public eliminated the problem.
Size:
Color:
Hi Panache,
I have detected an unhandled exception.
To produce it, starts WLD and open a strategy and go to the optimizer. Select one optimizer and go to another one (without running it). Do it several time by selecting different optimizers. When you select ABACUS by this way, you have the unhandled exception :
System.ArgumentOutOfRangeException: InvalidArgument=Value '34' is not valid in 'SelectedIndex'.
Parameter name : SelectedIndex
This unhandled exception doesn't appear if you do the same action without selected ABACUS.
I hope you will be able to reproduce it.
I take this opportunity to tell you that I very like your optimizer ! It helps me a lot.
Size:
Color:
Panache,
For your information, I see that the value (34) for the unhandled exception is the same value in the WealthLabConfig.txt file (line Abacus.Optimizer.Metric=34). I think you don't take into account the line Optimization.Scorecard=Basic Scorecard in the WealthLabConfig.txt which gives you the scorecard selected.
Size:
Color: