Click here to Login

                                                   Percent Rank Function Needed


2010-06-19 20:42:16

Perhaps I have missed this, but I can't seem to locate a percent rank function. Could you please help indicate the appropriate code.

That is, I need to create a function that transforms any vector array into a percent rank array.
For example, I need to look at the last 200 bar of the closing price, and for each bar, know what % that bar's closing price is within the prior 200 bars
(so, a price of 110, if it were the high of last 200 bars would be 100, if the low, it would be 0, etc.).
Typically, the function would be called as X = PERCENTRANK(CLOSE, 200);
Of course, variable close could be swapped for any other variable.

Also, could you kindly show how I would "call" this function within your other features (ranking systems, simulator, etc.)

Thanks - hopefully I can then use this as a learning step also.

2010-06-21 06:53:28


Best Answer

This function can be created using the "Create Functions" feature. However, I prefer to add it to the list of indicators so it can be highly optimized.
It will be available in the next release.

If you want me to create this function using "Create Functions" and send you the trading object, please let me know.

To use this function and any other function in ranking system or simulator, just type it:

2010-06-21 13:08:06


Thanks for the quick follow-up. Indicator would be fine, as long as it is "editable", so that I can test creating modified versions of the code (i.e., expanded to PERCENTRANK on multiple variables together, etc.).

I will also take a further look at your "Create Functions" feature - might be a good topic for an upcoming post :)


2010-06-22 06:29:54


Here is the PercentRank function:
Percentile - Percent Rank of a Trading Indicator

And here is a post about custom indicators:

Percentile - Percent Rank of a Trading Indicator (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

2010-06-22 09:05:35


Everything I could ask for and more!

I believe Percent Rank is a fundamental building block of time series analysis that will benefit many users.


No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Percentile - Percent Rank of a Trading Indicator
Trading System Based on the CloseHL Percent Rank Oscillator
CloseHL Percent Rank Oscillator
Percent Rank Market Indicator
Trading Indicator Rank

How-to Lessons
Difference between the watchlist and the screener tools
How to detect stocks trading near all time highs
How to plot two different time frames in the same chart
How to plot arrows below/above candlesticks on a chart
How to create a hatched area in a chart

Related Forum Threads
Composite Function
Calling a Function from another Function
2 rank engines
Question on Swing Point function sp()
Function Call

Blog Posts
Fundamental Stock Analysis: Rank stocks based on a valuation rati...
3 ways to rank stocks in a trading system - Simulator and Potfoli...
Buy the best/top rated stocks or how to create powerful rank base...
Trading Indicators using the Rank and Percentile functions
Trading System: Buy Stocks based on their Sharpe Ratio Rank

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.