From 9ecd7400c8316469fd3ae981dc86e4732a991df7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 22 Jan 2022 08:10:09 +0100 Subject: [PATCH] Allow NaN when calculating digests --- freqtrade/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/misc.py b/freqtrade/misc.py index f09e5ee47..2a27f1660 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -248,8 +248,10 @@ def get_strategy_run_id(strategy) -> str: if k in config: del config[k] + # Explicitly allow NaN values (e.g. max_open_trades). + # as it does not matter for getting the hash. digest.update(rapidjson.dumps(config, default=str, - number_mode=rapidjson.NM_NATIVE).encode('utf-8')) + number_mode=rapidjson.NM_NAN).encode('utf-8')) with open(strategy.__file__, 'rb') as fp: digest.update(fp.read()) return digest.hexdigest().lower()