Hi,

This topic has been touched upon a number of times in the past. There are 
basically two approaches:

1. Sort on the fly, repeating the sort all over again for each symbol as it 
gets processed (very slow, but viable "one pass" solution for small watchlists)

2. Sort first using a sorting script, then go back and run the intended script, 
referencing the pre-sorted values.

A lengthy, but informative thread, on the topic can be found here (starting 
with option 1, then meandering towards option 2)

http://finance.groups.yahoo.com/group/amibroker/message/126335

Mike

--- In [email protected], "sdwcyberdude" <scwalker1...@...> wrote:
>
> 
> Many thanks to the world class participants of this blog who help others
> learn how to use Amibroker.  I have been reading many interesting posts
> as I learn Amibroker, and I would greatly appreciate help on a difficult
> problem - code to calculate the Rankr2 below . . .
> 
> Portfolio of 25 symbols
> 
> Objective: calculate, as a filter for later steps, the position of each
> stocks ranked within an indicator.
> For example:
> 
> R2 = rsi(2);
> Rankr2 = percentrank of symbol X of the portfolio basket of all R2
> values period [i]
> 
> if Rankr2 == top 10%, then
> execute other rules . . .
> 
> finally
> buy/sell rules
> 
> 
> -------------
> 
> Thanks very much for your help!
> Scott
>


Reply via email to