
In this article we will talk about the simplest way of weighting indices - Price Weighted Index. In OsEngine, this type of weighting can be created in just a few clicks with recalculation once an hour, day, or week for any securities available from your broker.
1. Index calculation.

Actually, this is the simplest type of indices. No calculations are done other than adding them together. The prices of securities included in the index are added up, creating a new chart. The index is weighted by price.
2. How to enable a price weighted index in OsEngine.
In the index settings window, you need to select the desired weighting type, Price Weighted:

As a result, you get a candlestick chart of the index, where you can add any indicators available in OsEngine and receive trading signals from it.

3. Source code.
Index weighting is done in the BotTabIndex file, in the IndexFormulaBuilder class:
https://github.com/AlexWan/OsEngine
In the method:

The logic is broken down into different weighting types. By methods.
* If you find any mistakes in the source code, be sure to contact support.
https://t.me/osengine_official_support
Good luck with algorithms!