How to create a composite benchmark index ?
Author: abegy
Creation Date: 4/16/2018 8:00 AM
profile picture

abegy

#1
Hi Eugene,

I tried without success to find in the documentation an example of how to create our benchmark composite index. Can you help me ?

I would like to create a dedicated symbol and use it after as my benchmark index with the following caracteristics :
- 10% for ^AEX
- 50% for ^FTSE
- 10% for ^IBEX
- 30% for ^FCHI

Thanks in advance for your help.
profile picture

Eugene

#2
Hi Alexandre,

1. An easy way is to build this custom index on-the-fly in your Strategy code. Once created it can be cached in program's global memory and retrieved by other Strategies during an active Wealth-Lab session. Please see post #10 for a code example:

Custom index on-the-fly

Taking the idea even further, you can serialize the new Bars object to a disk file with Bars.SaveToFile and Bars.LoadFromFile. IMHO, this all should be pretty effortless.

2. Or you can create it once and forever by developing a custom IndexDefinition as suggested here:

How to create indicator sector/industry averages?

IndexDefinition development can be recommended for power users as it can get a little bit tricky when you need to configure the percentages and symbols of your index through a GUI and serialize these settings. Solution #1 implies that you reconfigure the composite benchmark in the WealthScript code.
profile picture

abegy

#3
Thank you Eugene.
profile picture

Eugene

#4
Any time.
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).