Automatic selection of securities for your own index. Historical volumes and volatility.

Automatic selection of securities for your own index. Historical volumes and volatility.

Let's continue talking about how to create your own indices that only you (and your robots) can see.

What methods of automatic selection of securities into the index exist in OsEngine? What should you pay attention to.

 

1. There are a lot of securities (surprisingly!).

Usually, there are not just a hundred securities on each platform. And if we need to gather the index of the most traded (or volatile) securities on the platform, we need to add the entire platform to the index builder. It is not necessary to add very illiquid securities (we talked about this here)

In the end, your list of securities will look something like this:

Of course, for most types of indices, securities from this list should be selected automatically.

 

2. Types of securities selection for the index formula that exist in OsEngine.

Currently, there are four of them:

1. First in Array - the first N securities from the list are selected.

2. Volume Weighted - N securities with the highest volumes over the last M days are selected.

3. Max Volatility Weighted - N securities with the highest volatility over the last M days are selected.

4. Min Volatility Weighted - N securities with the lowest volatility over the last M days are selected.

In the interface, you can see this in the following setting:

3. First in Array.

Means that no sorting is needed and you just need to take the first securities from the list. This method should be chosen only if you know exactly which securities will be in your index. For example, for the auto-formula type "Cointegration", when we only have two securities. Or if you are duplicating a well-known index.

It may look something like this:

In the image, you can see the sorting of securities in the index by "First in Array" with weighting through "Cointegration". This results in the "Graph of minimal deviations between two price series with an optimal multiplier".

 

4. Volume Weighted.

N securities with the highest volumes over the last M days are selected for the formula.

It may look like this:

What happened here:

1. The algorithm sorted the securities by volume over the last 20 days. The top 15 were selected for the index.

2. Next, these securities were evenly weighted (Equal Weighted) in the formula.

3. As a result, we have our personal index MOEX TOP 15 with equal weighting, which will be recalculated for you and your robots every morning.

 

5. Max Volatility Weighted.

N securities with the highest volatility over the last M days are selected.

It may look like this:

What happened here:

1. The algorithm sorted the securities by maximum volatility over the last 3 days. The top 5 based on speed of movement.

2. Next, these securities were evenly weighted (Equal Weighted) in the formula.

3. As a result, we have our personal index MOEX TOP 5 based on speed of movement with equal weighting, which will be recalculated for you and your robots every morning.

 

6. Min Volatility Weighted.

N securities with the lowest volatility over the last M days are selected.

What happened here:

1. The algorithm sorted the securities by minimum volatility over the last 3 days.

2. Next, these securities were evenly weighted (Equal Weighted) in the formula.

 

7. Source code in OsEngine.

The selection of securities for the index formula takes place in the BotTabIndex file, in the IndexFormulaBuilder class:

https://github.com/AlexWan/OsEngine

In the method:

* If you find errors in the source code, be sure to write to support:

https://t.me/osengine_support_english

Successful algorithms!