Click here to Login




How to filter stocks in a market composite

Updated on 2012-02-25





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

Example:

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.


Solution:

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).

Formula:
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.










no comments (Log in)

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.