Indexes are constructed from a basket of securities. For example, the S&P500 index takes the 500 biggest US companies ordered by market capitalization and then average the market capitalization of these stocks (before averaging, the market capitalization is multiplied by the free float factor). The market capitalization is simply the product of the stock price by the number of shares outstanding. The free float factor is used to include only the part of the company value that is not restricted or held by company insider.
The S&P500, the NASDAQ 100, the Russell 2000 are called Market value-weighted indexes. Most known indexes use this type of weighting, but some other methods exist. Instead of weighting the close price by the stock market capitalization, we could use any other value, ratio or time-series. We will discuss three other methods in the next paragraph.
Because the indexes we have listed above use their own component of stocks, and this list varies in time, we cannot build an index that uses the same components if we don't have an historical database that lists the universe of stocks that were used for each date.
Instead, we will define a simple filter to select our universe of stocks. It is generally better to discard low priced stocks and thus we will filter stocks whose stock price is below 5 dollars (filter = close >= 5).
Here is a list of some weighting methods you can use to build your own indexes:
Capitalization-weighted index: You must have an historical database of the number of shares outstanding or the market capitalization of the index stock components.
Equal-weighted index or Price-weighted index: This type of index gives the same weight to each stock in the index or composite. Small and large companies will have the same importance in the index price. The formula for this type of index is very simple (composite = close) and it doesn't need any historical database of fundamental data.
Volume-weighted index: This method also doesn’t need any historical database, besides the stock prices database. Stocks are weighted by the traded volume. This could be the volume of the current trading session, the recent ones or older ones. This is the index formula: composite = close * sma(volume, 10). This will create a composite index that weights stocks based on the average volume of the last 10 bars.
Fundamental-weighted index: If you have access to a fundamental database, you can create what is called a Fundamental-weighted index. These indexes weight stocks by fundamental factors like book value, revenues or sales. Bear in mind, that it is easy to import any database into the QuantShare application.
All these indexes must use 'Average' as composite calculation function.
Here is an article that may help you better understand how to create composite indicators: Composite Indicators