b130 fitness is not calculated correctly in custom projects builder

b130 fitness is not calculated correctly in custom projects builder task. It appears to be working correctly in regular builder. Same config give totally different results.

To reproduce select number of trades as the only weight in fitness. Sort by fitness then sort by number of trades. they are different.

EDIT: This effects simple fitness calculations based on for instance number of trades, not just custom columns.
Attachments
  • Votes +8
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

bentra

29.12.2020 12:07

Task created

b
#2

bentra

29.12.2020 12:07
Voted for this task.
k
#3

Karish

29.12.2020 12:57
Voted for this task.
k
#4

Karish

29.12.2020 12:59
I can confirm i noticed that too,

When i set only Maximize # of Trades, The fitness Column wont sort the # of Trades Column correctly, they wont got from the highest to lowest, as if they was not following the fitness function..


Please fix this..

IH
#5

clonex / Ivan Hudec

29.12.2020 15:34
Voted for this task.
h
#6

hankeys

29.12.2020 16:48
Voted for this task.
m
#7

Martin

29.12.2020 18:22
Voted for this task.
b
#8

bentra

29.12.2020 18:51
A restart of SQX was able to get this working.
AT
#9

AngelTalavera

30.12.2020 14:50
Voted for this task.
b
#10

bentra

31.12.2020 00:29
hmm now it's not working again even after a restart.
b
#11

bentra

31.12.2020 17:25
Maybe a hint:
When I copied config from a task it copied the config correctly except for the "strategy Quality Ranking Fitness" settings were from a different task.
b
#12

bentra

11.01.2021 18:25
Also not working in custom project optimizer task.

b
#13

bentra

31.01.2021 18:30

Subject changed from b130 fitness is not calculated correctly in custom projects builder with a custom column to b130 fitness is not calculated correctly in custom projects builder

Description changed:

b130 fitness is not calculated correctly in custom projects builder task. It appears to be working correctly in regular builder. Same config give totally different results.

I have a custom column involved which severely penalizes the fitness of any strategies that do not have 500 trades as seen in the screenshot. It works in the standard builder (screenshot) but same cfg does not work the same way in custom project build task. Gives some kind of generic fitness and or just clearly ignores my custom column and fitness settings.

EDIT: This effects simple fitness calculations based on for instance number of trades, not just from custom columns.

b
#14

bentra

31.01.2021 18:30

Attachment NumberOfTradesAtLeast.java deleted

b
#15

bentra

31.01.2021 18:30

Attachment Screenshot 147.png deleted

b
#16

bentra

31.01.2021 18:30

Attachment gen.cfx deleted

b
#17

bentra

31.01.2021 18:31

Description changed:

b130 fitness is not calculated correctly in custom projects builder task. It appears to be working correctly in regular builder. Same config give totally different results.

I have a custom column involved which severely penalizes the fitness of any strategies that do not have 500 trades as seen in the screenshot. It works in the standard builder (screenshot) but same cfg does not work the same way in custom project build task. Gives some kind of generic fitness and or just clearly ignores my custom column and fitness settings.

EDIT: This effects simple fitness calculations based on for instance number of trades, not just custom columns.

b
#18

bentra

31.01.2021 18:33

Description changed:

b130 fitness is not calculated correctly in custom projects builder task. It appears to be working correctly in regular builder. Same config give totally different results.

To reproduce select number of trades as the only weight in fitness. Sort by fitness then sort by number of trades. they are different.

EDIT: This effects simple fitness calculations based on for instance number of trades, not just custom columns.

KW
#19

Sean

01.02.2021 01:25
Voted for this task.
MO
#20

mareko

02.02.2021 09:49
Voted for this task.
MF
#21

Mark Fric

08.02.2021 10:08

Status changed from New to Waiting for information

can you attach your roject? 


there could be reason for this discrepancy, ut it works the same in Builder and Custom project Builder.


Fitness is always computed from the configured metrics - be it number of trades, Profit factor, or whatever else.


But there is a special handling that applies a coefficient to the fitness if number of trades is too small, see below.

The reason is to penalize strategies that have very good result (for exmaple Net profit) but on low number of trades, which makes the results strategically insignificant.


The coefficient applied to the computed fitness is:

if(trades < 20) {

fitness *= 0.3;

} else if(trades < 30) {

fitness *= 0.4;

} else if(trades < 50) {

fitness *= 0.6;

} else if(trades < 70) {

fitness *= 0.8;

} else if(trades < 100) {

fitness *= 0.85;

} else if(trades < 150) {

fitness *= 0.9;

}


b
#22

bentra

09.02.2021 04:27

Attachment bugged_fitness.cfx added

bugged_fitness.cfx
(26.08 KiB)
Any single weight fitness seems to be giving incorrect calculations in custom project tasks. In this sample builder config I have attached, the fitness is sharpe ratio only. If I sort by fitness it's totally not the same as sort by sharpe ratio. It should be the same except for maybe a few rounding issues. But you can see for yourself it's not even close. 

But if I use this same config in main builder then the fitness sort matches the sharpe ratio sort as expected. Fitness in custom project is clearly not calculated the same way as main builder.




MF
#23

Mark Fric

09.02.2021 10:14
as I said in previous comment - THERE IS a coefficient applied to the computed fitness value if number of trades is too small.


It is applied the same for both simple and weighted fitness, and as same in custom project and main builder.


If you think it is not please attach a screenshot of databanks from main builder and custom project builder where I can see this..



b
#24

bentra

09.02.2021 16:31

Attachment Screenshot 176.png added

Attachment Screenshot 177.png added

Screenshot 176.png
(156.05 KiB)
Screenshot 177.png
(301.38 KiB)
There is a filter on number of trades no strategies have such few trades. Many with lower number of trades AND smaller Sharpe ratio are rated higher fitness so nope it's definitely not caused by such a coefficient applied to  number of trades. 

Screenshot 176.png = project build task
177 = regular builder.

Both the same config which I posted above.

Custom project fitness is bugged.

BTW the number of trades coefficient is good idea but can I change the number of trades coefficient formula in a snippet somewhere? 150 trades is way to low for me usually.
MF
#25

Mark Fric

10.02.2021 11:58

Status changed from Waiting for information to Fixed

I can no longer reproduce it, it is most possible that it was already fixed. I'm not sure if it works in 131 Dev 1 build already, but it will work in Dev 2

Votes: +8

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please