From 5af3d58ce9fb34653eedcef1f0e11e63b240ae7c Mon Sep 17 00:00:00 2001 From: emabo <3024205+emabo@users.noreply.github.com> Date: Mon, 6 Nov 2017 11:50:12 +0100 Subject: [PATCH] Add all needed options for running trust_distrust strategy on genetic_algo (#683) --- .gitignore | 2 ++ scripts/genetic_algo/evaluation.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6f79966fa6..73fde157a9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ models/*.json models/*.html *.pyc *.swp +temp.html +logs diff --git a/scripts/genetic_algo/evaluation.py b/scripts/genetic_algo/evaluation.py index 03e90f5aa8..2e8cc9729d 100644 --- a/scripts/genetic_algo/evaluation.py +++ b/scripts/genetic_algo/evaluation.py @@ -88,23 +88,29 @@ def convert(self, param, value): if param == 'period': res = minutes(int(value/2)) elif param == 'min_periods': - res = int(value * 20) + res = int(value*20) elif param == 'trend_ema': - res = int(value*15 ) + res = int(value*15) elif 'period' in param: - res = int(value *10) + res = int(value*10) elif 'pct' in param: res = pct(value) elif 'rate' in param: res = pct(value) elif 'rsi' in param: res = float(value) + elif 'sell' in param: + res = value/10.0 + elif 'buy' in param: + res = value/10.0 elif 'threshold' in param: res = value/100000.0 elif 'sar_af' == param: - res = value / 1000.0 + res = value/1000.0 elif 'sar_max_af' == param: res = pct(value) + elif 'greed' == param: + res = value/10.0 else: raise ValueError(colored(f"I don't understand {param} please add it to evaluation.py", 'red')) return param, res