From 474932c05df0f3ebc719b75d5dbf26c89ed8e01e Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Sat, 9 Nov 2024 09:41:16 -0500 Subject: [PATCH] fix: fix the error when profits are zeros --- starbot/painter/LiveReportGenerator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starbot/painter/LiveReportGenerator.py b/starbot/painter/LiveReportGenerator.py index b00d443..3bd02b0 100644 --- a/starbot/painter/LiveReportGenerator.py +++ b/starbot/painter/LiveReportGenerator.py @@ -671,7 +671,7 @@ class LiveReportGenerator: length = len(profits) indexs = list(range(0, length)) - abs_max = math.ceil(max(max(profits), abs(min(profits)))) + abs_max = math.ceil(max(max(profits), abs(min(profits)), 0.01)) start = -abs_max - (-abs_max % 10) end = abs_max + (-abs_max % 10) step = int((end - start) / 10)