22. 5. 2022

5 8

Rank and Select Strategies by Strategy Metric

This custom analysis sorts and selects x strategies according to the Strategy Metric.

 

To use it, you need to unpack commons-math3-3.6.1 from the jar file and import it into the strategyquant/user/libs folder.

 

The snippet is easily modifiable and can be rewritten to rank strategies by IS/OS, Direction, and Sample Types:


String stratMetric = “MAFEProfitFactor”; int numStrats = 10; 

for(ResultsGroup strategyRG : databankRG) { /// Single or Portfolio? 

Result mainResult = strategyRG.subResult( strategyRG.getMainResultKey() );  //single results 

//Result mainResult = strategyRG.portfolio(); // portfolio result

 

16/03/2023 -> Code is updated for ranking by fitness and Monte Carlo Ratios.

 

 

 

Subscribe
Notify of
8 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Emmanuel
23. 5. 2022 4:58 am

Excellent ! Thank you Clonex !!!

Emmanuel
23. 5. 2022 5:16 am

Thanks to your example, I was able to build my code and make my article on how to select better building blocks !!!

trader4711
11. 3. 2023 1:14 pm

Thanks clonex for very helpful custom analysis.
How is string for “NetProfit (MC retest, Conf. level 95%)”
You can help. please.

Hector MONDELO GOMEZ
Hector MONDELO GOMEZ
26. 11. 2023 12:51 pm

Hello Ivan. When I tried to compile it the message (package org.apache.commons.math3.stat.descriptive.rank does not exist) is displayed in Code Editor Log. Related to Line 14 of PercRankStrats.java file (import org.apache.commons.math3.stat.descriptive.rank.Percentile;)
Could you guide me to debug this problem ?
Regards,

Jordan
2. 12. 2023 12:51 am

There are three errors in compiling on version 138. Can you debug it?

Jordan
Reply to  clonex / Ivan Hudec
3. 12. 2023 1:16 am

Thank you very much.