Click here to Login




Trading Indicators using the Rank and Percentile functions

Updated on 2010-09-21





With several calculation methods, the composite function allows you to create a variety of composites, indices or market breadth indicators.

This is the forth part of a series that presents the different calculation methods available in the composite function of QuantShare. In the first, second and third posts, we have introduced six methods which are: "Count", "Sum", "Avg", "Max", "Min" and "Sdv". All these methods have something in common: they all create a unique time series that is the same for all symbols/stocks.

The Rank and Percentile function are different from the other methods in that they do not really create composites or indices but rather use data or quotes from all your symbols and return a unique value for each one of them based on how a specific value for a particular stock compares to other values from other stocks for the same date.

Rank and Percentile

The Rank function calculates the symbol's rank based on the time series you provide. Note that the symbol's rank will vary from date to date. This means that a stock could be ranked number one on a particular date and then ranked two, three or any other rank on the next day.

The Percentile function works as the Rank function. However, instead of providing ranks, the Percentile returns values that vary between 0% and 100%. A value of 100% is the equivalent of the rank number 1 and a value of 0% correspond to the worst rank a symbol or stock may have.

Let us use an example to further explain the Rank and Percentile functions. Imagine, we want to rank S&P 500 stocks based on their daily volume. The trading software will read S&P 500 stock quotes and then compare the volume time series of these stocks for each trading day. If Google had the biggest volume on August 12, 2010, then Google rank will be equal to 1. If we had used the Percentile function then Google percentile value would be equal to 100%.

In the improbable case where there is only one stock for a particular date, this stock will get a rank value of one. The stock that has the lowest volume value, for day Y, will get a rank value that is equal to the number of stocks (with quotes) for that day Y minus one.

Example of Rank and Percentile functions uses

Comp(perf(close, 1), "Rank") <= 5

The above trading rule returns the top 5 stocks that have the highest one-bar rate of return.

Comp(volume, "Percentile") >= 90

This volume-based trading rule gets stocks that are in the top 10% of stocks with the highest volume value. Unlike the above Rank function which returns only 5 stocks, the current one returns 10% of all stocks included in the analysis. If you have included 5000 stocks in your trading system then this volume rule will return 500 stocks.

We'll see advanced uses of this powerful composite function later.











one comment (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1233 days ago

Profile Graphs
Posted 1338 days ago

QuantShare
Previous Posts

How to search for a trading item
Posted 4973 days ago


More Posts

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.