Exclude top ranked trades using PositionScore?

Hello All, thanks for reading my question -

I'm trying to exclude the top X number (1-5) of rankings while using PositionScore. I've read a few posts on excluding top rankings in rotational systems and tried adapting the code from here -
http://www.amibroker.com/kb/2014/10/23/how-to-exclude-top-ranked-symbols-in-rotational-backtest/. But I couldn't make that work.

I've also ready quite a few posts about StaticVarGenarateRanks. But most things I read about that seem to stress that it's best used for Exploration and is resource intensive. That being said, if using StaticVarGenarateRanks is the only option for skipping the highest few rankings, then I can probably deal with the resource usage.

I've read the KB page about rankings - http://www.amibroker.com/guide/h_ranking.html
But I couldn't find exactly what I was looking for in there either. That may be my fault, when the examples are laid out as Explorations I have a hard time "translating" that into "backstesting".

I've also read these, again, they don't hit home for various reasons -
https://forum.amibroker.com/t/how-to-exclude-top-2-or-3-results-from-scan/8369

https://forum.amibroker.com/t/exclude-top-rankings-percentile-rockstar-beater/11598

Does anyone have any suggestions on skipping the highest ranked trades using PositionScore?

Again, thank you in advance for your time.

This:
http://www.amibroker.com/kb/2014/10/23/how-to-exclude-top-ranked-symbols-in-rotational-backtest/

JUST WORKS. Re-read the article and make sure that you have all parts copied correctly.

And no, you should NOT use StaticVarGenerateRanks if you can't run way simpler code that is in the KB.

StaticVarGenerateRanks is heavily abused. Don't use it if shorter/quicker ways exists.

StaticVarGenerateRanks is NOT the "best way to manipulate rankings".

It is computationally complex, memory hungry and resource consuming and should be LAST RESORT, not "go to everytime".

It is always recommended to use PositionScore in backtest without StaticVarGenerateRanks if only possible. And that particular goal is perfect example of being possible without StaticVarGenerateRanks.

Recommended reading:

4 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.