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

fix phenotype win loss ratio weighting #1251

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

krystophv
Copy link
Contributor

Current calculation in the phenotype fitness are incorrect. The wlRatio isn't currently a ratio, but as the variable name suggests, it should be. The result being that the scaling for wlRatioRate goes properly from 0.5 for all losses compared to wins to 1.0 for all wins compared to losses.

Since 0/0 in JS is NaN, there's a special case for no trades made where it will set it to 1 (basically 1/1 ratio of wins to losses, even if both were zero).

Also, Euler's number is a built-in mathematic constant in JS, so we can just use it since it's more precise.

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.

👍

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.

2 participants