HomeReady-2-GoPortfolioRankingScreenerStockETFToolsCommunityHelp
ForumsEmail UserPollsFeature RequestsGroups


  Index  | Recent Threads  | Who's Online  | User List  | Search
  Search  
Quick Go »
Thread Status: Normal
Total posts in this thread: 4
[Request a Feature] [Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 1163 times and has 3 replies Next Thread
Koronbock
Advanced Member
Member's Avatar

GERMANY
Joined: Jun 11, 2006
Posts: 166
Status: Offline
Feature Request: TOP number of stocks Reply to this Post
Reply with Quote

Hi Marco,

here is my request (which has been voiced similarly by others as well):

A TOP function, which will select the TOP number of stocks according to a criteria:

Condition A (for example: MktCap > 500),

from the remaining stocks

Select the TOP(n) stocks

This would give us complete control over the number of stocks that are chosen for a backtest. At the moment there are differing numbers at each selection point of time.
View the feature request here.
[Sep 26, 2006 6:51:16 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
jerrodmason
Advanced Member
Member's Avatar

UNITED STATES
Joined: Jan 14, 2005
Posts: 599
Status: Offline
Re: Feature Request: TOP number of stocks Reply to this Post
Reply with Quote

I heartily endorse, with one embellishment. The TOP function's parameter should permit either an integer or a percentage. Thus
TOP(5) would keep the top five stocks
TOP(50%) would keep the top half of the current set.

Alternate implementation is a separate function eg TOP%(50)
----------------------------------------
The smart money was on Goliath.
"He's not the Messiah. He's a very naughty boy."

[Sep 26, 2006 11:38:55 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
jerrodmason
Advanced Member
Member's Avatar

UNITED STATES
Joined: Jan 14, 2005
Posts: 599
Status: Offline
Re: Feature Request: TOP number of stocks Reply to this Post
Reply with Quote

After thinking about this request some more, I believe that two operators are needed, not just one.

The screener now allows keeping the top N stocks, but only after all filters have been executed, and only sorted by Rank. This is a very liimited implementation. What's needed is the ability to keep the top N (or N%) of the current set based on any specified factor, and then allow further filtering and/or sorting.

A new pair of operators would do the trick:
  • SORT(Factor) sorts the current set in descending order of Factor. (Note: use SORT(-Factor) for ascending order.
  • TOP(N) keeps only the first N items in the ordered set. (Note: Useful extension allows specifying N or N%.)

These operators would be used in Screen, Buy and Sell rules. In a Sell rule, the term "list" refers to the current holdings; in a Buy or Screen rule, the term refers to the set of candidates defined by the preceding rules.

Example set of Screen or Buy rules:
 
Rank>98
MktCap>50
Sort(-PEG)
Top(25%)
Creates list of stocks with Rank>98 and MktCap>50, then from that list keeps the 25% with the lowest PEG.

Example of Sell rules:
 
NoDays>20
Sort(-Close(0)/Close(5))
Top(1)
Sells the stock with the worst weekly performance among those held for at least 20 days.

Note to Marco: This request enhancement supersedes Item 3 of this request , which was limited to Sell rules.
----------------------------------------
The smart money was on Goliath.
"He's not the Messiah. He's a very naughty boy."

[Oct 31, 2006 12:10:41 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
marco


UNITED STATES
Joined: Jan 1, 1970
Posts: 3980
Status: Offline

Feature Request Closed Reply to this Post
Reply with Quote

I believe this is possible using FOrder() and using #Previous in the universe parameter
----------------------------------------
Portfolio123 Staff
[Apr 7, 2010 11:51:26 PM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
[Show Thread Printable Version]

Free Trial  /  Log In
Username or Email
Password
Stay logged in
Can't remember username or password?