How can I access Wealth-Lab preferences/settings from a visualizer?
Author: kribel
Creation Date: 6/2/2016 5:34 AM
profile picture

kribel

#1
Hi!

I am looking for a way to access the WelathLab preferences/settings from my visualizer. In particular I am interested in the following information:

- Pricing Decimal Places
- Indicator Decimal Places
- Apply Commissions to simulated trades
- Commission Settings

Is this possible? If yes, how?

Thanks
Konstantin
profile picture

Eugene

#2
Hi Konstantin,

Sure it's possible.

1. To read Wealth-Lab's preferences use the unsupported SettingsManager class. Add a reference to Fidelity.Components.dll in your visualizer (there's no need in it to run the sample Strategy though).
2. To get the selected commission plan's name use Reflection.

I like to do my prototyping straight in Wealth-Lab so here's a demo strategy for you:

CODE:
Please log in to see this code.


To get commission settings you'll have to review the WealthLabConfig.txt file and query the appropriate lines exactly like I show above for ApplyCommissions, IndicatorDecimalPlaces and PricingDecimalPlaces. There's no automation for it so it's going to be your small DIY project. Nevertheless it's pretty trivial when you know what commission you typically select. You're interested in the lines starting with "ux" e.g. uxDollarsPer., uxIB. (for IB Bundled) etc.
profile picture

kribel

#3
Hi Eugene,

thanks for your example! I will test it.