First of all you need P/S data (or Sales per share and calculate the ratio) with enough historical range and clean data. A rare combination especially when talking about fundamentals.
Secondly you can use Rotational backtesting with PositionScore being equal to the inverse of the P/S (the higher the better). Otherwise I would recommend using a for cycle calculating the percentile for each stock in your universe and use it to both rank your stocks for proper buy/sell rules and plot also the ranking as an indicator. Be careful 'cause for large number of stocks (>500) it tends to be very slow. I hope it helps, Paolo --- In amibroker@yahoogroups.com, "sendfreetest" <sendfreet...@...> wrote: > > Hi, > > I really need coding assistance. > > I am attempting to code into AmiBroker Charles Kirkpatrick's > trading methodology for testing. > > Kirkpatrick creates a percentile rank of stocks' price-to-sales > ratio and uses it as a filter. He purchases only stocks > with a percentile rank between the 17th and 42nd level. > > When a stocks price-to-sales percentile rank goes above 67 > he sells. > > With AmiBroker's PERCENTILE function it seems to evaluate > only one market's array to determine the percentile. > > Is their an AmiBroker funtion to evaluate say 100+ > stocks P/S Ratio and give each a percentile rank. > > Thanks in advance for any help. > > Abbie >