How to filter stocks in a market composite
Updated on 2012-02-25 03:26:37
If you have not yet created a composite, please read the following how-to article for instructions on how to create one:
How to create a composite index/indicator
Let us image a trader who wants to calculate the number of stocks trading above the moving average.
This trader wants also a composite based only on stocks whose volume is higher than 100,000 shares.
In the "Formula" editor of the "Create Composite" form, we can use the "filter" variable.
Its role is to prevent the composite from using stocks or securities on bars where the filter value is FALSE (or equal to 0).
composite = close > sma(30);
filter = volume > 100000;
The "filter" variable is calculated for each bar. This means that a Stock "Y" can be used in the composite in a particular bar/date; and then dismissed the next bar if its volume decreases below 100,000.
The number of stocks used by the composite or index will vary each day depending on the volume criterion.
Of course, you can use any indicator or combination of indicators to implement your filter variable.