From 2c9a519c5e359ba2fea353bfd29155c06c8a2d3b Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Wed, 22 May 2019 14:21:36 +0300 Subject: [PATCH 1/3] edge: handle properly the 'No trades' case --- freqtrade/edge/__init__.py | 1 + freqtrade/optimize/edge_cli.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/freqtrade/edge/__init__.py b/freqtrade/edge/__init__.py index 4801c6cb3..5c7252d88 100644 --- a/freqtrade/edge/__init__.py +++ b/freqtrade/edge/__init__.py @@ -139,6 +139,7 @@ class Edge(): # If no trade found then exit if len(trades) == 0: + logger.info("No trades created.") return False # Fill missing, calculable columns, profit, duration , abs etc. diff --git a/freqtrade/optimize/edge_cli.py b/freqtrade/optimize/edge_cli.py index 9b628cf2e..818c1e050 100644 --- a/freqtrade/optimize/edge_cli.py +++ b/freqtrade/optimize/edge_cli.py @@ -73,9 +73,10 @@ class EdgeCli(object): floatfmt=floatfmt, tablefmt="pipe") def start(self) -> None: - self.edge.calculate() - print('') # blank like for readability - print(self._generate_edge_table(self.edge._cached_pairs)) + result = self.edge.calculate() + if result: + print('') # blank like for readability + print(self._generate_edge_table(self.edge._cached_pairs)) def setup_configuration(args: Namespace) -> Dict[str, Any]: From 406e266bb4ea12caaaaf86b6ddde5369e7450fea Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Wed, 22 May 2019 14:34:35 +0300 Subject: [PATCH 2/3] typo in comment fixed --- freqtrade/optimize/edge_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/edge_cli.py b/freqtrade/optimize/edge_cli.py index 818c1e050..d37b930b8 100644 --- a/freqtrade/optimize/edge_cli.py +++ b/freqtrade/optimize/edge_cli.py @@ -75,7 +75,7 @@ class EdgeCli(object): def start(self) -> None: result = self.edge.calculate() if result: - print('') # blank like for readability + print('') # blank line for readability print(self._generate_edge_table(self.edge._cached_pairs)) From 6e1da13920eb3b1ed7ce501cf0c13f5c11a667df Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Wed, 22 May 2019 17:19:11 +0300 Subject: [PATCH 3/3] Log message changed --- freqtrade/edge/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/edge/__init__.py b/freqtrade/edge/__init__.py index 5c7252d88..053be6bc3 100644 --- a/freqtrade/edge/__init__.py +++ b/freqtrade/edge/__init__.py @@ -139,7 +139,7 @@ class Edge(): # If no trade found then exit if len(trades) == 0: - logger.info("No trades created.") + logger.info("No trades found.") return False # Fill missing, calculable columns, profit, duration , abs etc.