Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Fix bug where fitness function assigned higher fitness to worse results. #1043

Merged
merged 1 commit into from
Jan 4, 2018

Conversation

ricktonoli
Copy link
Contributor

The fitness calculation does not appear to work correctly when win < loss AND buyvsHold value is negative. It results in a higher fitness value being assigned to worse results. In generation runs where ONLY negative results are returned, each subsequent generation gets progressively worse, not better. To test this I ran trend_ema, 60 days on cexio.ETH_USD and the results now assign the best fitness to the best result correctly, where it was incorrect before.

The fitness calculation does not appear to work correctly when win < loss AND buyvsHold value is negative. It results in a higher fitness value being assigned to worse results. In generation runs where ONLY negative results are returned, each subsequent generation gets progressively worse, not better. To test this I ran trend_ema, 60 days on cexio.ETH_USD and the results now assign the best fitness to the best result correctly, where it was incorrect before.
Copy link
Owner

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍

@DeviaVir DeviaVir merged commit fb8526b into DeviaVir:unstable Jan 4, 2018
@@ -68,7 +68,8 @@ module.exports = {
if (typeof phenotype.sim === 'undefined') return 0;

var vsBuyHoldRate = (phenotype.sim.vsBuyHold / 50);
var wlRatioRate = 1.0 / (1.0 + Math.pow(2.71828, -(phenotype.sim.wins - phenotype.sim.losses)));
var wlRatio = phenotype.sim.wins - phenotype.sim.losses

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ';'?

@DarkShimy00
Copy link

Why not use Math.abs for clarity?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants