Extracting the PositionScore Rank

I have searched through the ranking tags and have reviewed the ranking features. I prefer to do the "first kind of ranking" that uses the rank of the PositionScore. My current code uses the PositionScore to Buy (Long Only) ("first kind of ranking). I buy the top 5 ranked stocks based on the highest PositionScore. I sell a stock when the PositionScore drops. I am using the "third kind" of ranking in order to rank the PositionScore. If a stock falls below a specific rank, I sell and buy the top ranked stock that I do not already own. I suspect that AmiBroker already knows the rank on a bar by bar of the PositionScore. Is there a way to get access to the PositionScore ranking to do a sell in a backtest so I do not have to do a "third kind" of ranking to extract the PositionScore rank that probably has already been calculated?

Use Rotational trading mode. It will buy top-ranked stocks and sell them when rank falls below 'worstrankheld' (user specified).

https://www.amibroker.com/guide/afl/enablerotationaltrading.html

1 Like