[Build 135] Weighted Fitness results sometimes make no sense

Please look at the attached screenshot, it's in the "Builder". There you can see 2 strategies (red circles), sorted by "Fitness" where one of them is ranked higher than the other, although the second one has better values for ALL of my 3 Weighted Fitness criteria - Stability, Ret/Open DD, Stagnation. It hence makes no sense that the first strategy has a higher fitness value if all 3 criteria are actually better in the second strategy.


Interestingly, when moving both strategies to the Retester with the exact same settings and running a new backtest there with the same ranking criteria, it´s sorted the other way around (correctly).

Attachments
Untitled.png
(269.88 KiB)
Untitled3.png
(83.43 KiB)
  • Votes +5
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

g
#1

geektrader

21.01.2022 02:04

Task created

g
#2

geektrader

21.01.2022 02:04
Voted for this task.
g
#3

geektrader

21.01.2022 08:59

Description changed:

Please look at the attached screenshot, it's in the "Builder". There you can see 2 strategies (red circles), sorted by "Fitness" where one of them is ranked higher than the other, although the second one has better values for ALL of my 3 Weighted Fitness criteria - Stability, Ret/Open DD, Stagnation. It hence makes no sense that the first strategy has a higher fitness value if all 3 criteria are actually better in the second strategy.


Interestingly, when moving both strategies to the Retester with the exact same settings and running a new backtest there with the same ranking criteria, it´s sorted the other way around (correctly).

Here is one more screenshot where the fitness should *not* be higher for the first strategy than the second strategy. The second strategy has much higher stability, higher return/dd ratio, and a much lower stagnation. I am using the same ranking criteria as in the screenshot in the initial post.

b
#4

bentra

21.01.2022 22:53
Voted for this task.
E
#5

Emmanuel

29.01.2022 14:51
Voted for this task.
g
#6

geektrader

05.02.2022 22:27

Attachment Untitled.png added

Untitled.png
(78.53 KiB)
Here is one more example of such a case. Again, I am using the ranking settings from "Untitled3.png" in the initial post. All values are better in the second strategy in the following screenshot: higher stability, higher ret/dd ratio, lower stagnation, yet it gives the other strategy, with worse values, a better fitness ranking. Makes absolutely no sense.
b
#7

bentra

06.02.2022 15:12

Attachment Fitness4d.sxp added

Attachment 2022-02-06.png added

Fitness4d.sxp
(1.26 KiB)
2022-02-06.png
(78.63 KiB)
I created a fitness4d with 4 decimals and confirmed the sort by databank column only sorts with an accuracy of the column snippet. The databank sort problem can be fixed with a more accurate fitness column snippet. So probably the builder and optimizer engine get more accuracy than the databank fitness column (hopefully) as actual fitness is stored in the "raw results" with more accuracy than the default fitness column and so most likely this is just a "cosmetic" rounding/accuracy issue present only in the databank view. 






g
#8

geektrader

06.02.2022 22:53
Thanks for the snippet + efforts, I will test it, but seems you are right. SQX should always display at least 3 decimals for Fitness and stability right out of the box, better 4 digits like in your snippet. Of course, as you said, this all only makes sense if the fitness is internally calculated with more than 2 digits for the genetic evolution, etc., so that this really is only a cosmetic issue.
g
#9

geektrader

09.02.2022 03:33

Attachment Stability4d.java added

Stability4d.java
(4.51 KiB)
Thanks again bentra, this works very well - I´ve also created "Stability with 4 decimals" now as well, that helps too. I think SQX should default to use 4 digits for the Stability and Fitness out of the box.
a
#10

astral

18.02.2022 12:12
Voted for this task.
TT
#11

Tamas

25.03.2022 10:32

Status changed from New to Fixed

Attachment image-0.png added

image-0.png
(57.93 KiB)
There is a special column FitnessExact to display the exact value of the fitness without rounding.
CG
#12

Chris G

18.04.2022 18:55
Voted for this task.

Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please