|
|
|
|
|
TOP The TOP statement allows you to have XMIM report the top 1, 2, 10, 100, or whatever number of answers that meet your criteria. Typically the Attribute criteria used is selected from the Profit-Loss Statistics button from the Attribute Window. Example 1: LET ATTR MovgAvg = 5 TO 100 BY 5 TOP 5 equity When used with an ORDER query (Profit and Loss function) the above LET expression will only return the top 5 results that return the top 5 final equity figures. The “TOP n” constraint may be used by selecting the Options button within a LET window. After you have defined your Variable within a LET Statement select the Options button before exiting the LET window. “TOP n” requires input of a value into the text field and selection of an Attribute. For the example above we chose Profit-Loss Statistics, Final Statistics and Equity for the Attribute menu selection. Example 2: Here is a way to demonstrate TOP functionality in XMIM. This query will return the top 50 results based on the calculation you give it. Note: the query finds what individual stocks in the S&P 500 moved the most compared to the S&P 500 index. It finds the TOP 50 percent movers. LET theSym=FILE "/home/lim/dates/user/COMPONENTS/GII.SPX" LET SHOW 1: percent_move from 1
year ago to today of theSym WHEN Date is 2/13/2004
Like the TOP statement, BOTTOM allows you to filter the results so that the system only reports answers for the parameter sets that don't exceed some maximum utility. Example: LET LET
1: ORDER
WHEN
AND EXIT
Example using TOP and BOTTOM: You want to see which S&P 500 groups are the biggest movers from Thanksgiving to Christmas. You write a query that ranks the top 5 and bottom 5 S&P 500 groups based on an average of their percentage moves. TOP 5 total / counter
|