From e993512d7c39cf0c14121e1f9d5732a29cc4c0b1 Mon Sep 17 00:00:00 2001 From: Patrick Baumgartner Date: Mon, 16 Aug 2021 19:08:11 +0200 Subject: [PATCH 1/2] Shifts report generation by 1 seconds and omit 0% Top Reports --- alerter/BinancePumpAndDumpAlerter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerter/BinancePumpAndDumpAlerter.py b/alerter/BinancePumpAndDumpAlerter.py index 20807f4..c2e4c8d 100644 --- a/alerter/BinancePumpAndDumpAlerter.py +++ b/alerter/BinancePumpAndDumpAlerter.py @@ -288,7 +288,7 @@ def check_and_send_top_pump_dump_statistics_report( if ( current_time > top_report_intervals[interval]["start"] - + top_report_intervals[interval]["value"] + + top_report_intervals[interval]["value"] + 1 ): # Update time for new trigger top_report_intervals[interval]["start"] = current_time From dc456fcc419b8d01624269848964fb2f9520d0e4 Mon Sep 17 00:00:00 2001 From: Patrick Baumgartner Date: Mon, 16 Aug 2021 19:08:36 +0200 Subject: [PATCH 2/2] More simplification on alerts --- reporter/ReportGenerator.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/reporter/ReportGenerator.py b/reporter/ReportGenerator.py index 38417c2..a336080 100644 --- a/reporter/ReportGenerator.py +++ b/reporter/ReportGenerator.py @@ -62,9 +62,7 @@ def send_pump_dump_message( outlier_intervals, dump_enabled=True, ): - change_last = 0 change_biggest_delta = 0 - interval_last = 0 no_of_alerts = 0 message = "" @@ -91,7 +89,6 @@ def send_pump_dump_message( # Remember the total number of alerts no_of_alerts += 1 - interval_last = interval if change > 0: message += "{0} *[{1} Interval]* Change: _{2:.3f}%_ | Price: _{3:.10f}_\n".format( @@ -118,27 +115,8 @@ def send_pump_dump_message( ) return - if no_of_alerts == 1: - - if change_last > 0: - self.send_pump_message( - asset["symbol"], - interval_last, - change_last, - asset["price"][-1], - ) - if change_last < 0 and dump_enabled: - self.send_dump_message( - asset["symbol"], - interval_last, - change_last, - asset["price"][-1], - ) - - # Send summarized alert if multiple at the same extraction - if no_of_alerts > 1: - news_message = """\ -*{0}* | {1} Summarized Alerts + news_message = """\ +*{0}* | {1} Alert(s) {2} Open in [Binance Spot](https://www.binance.com/en/trade/{0})\ @@ -146,7 +124,7 @@ def send_pump_dump_message( asset["symbol"], no_of_alerts, message ) - self.telegram.send_news_message(news_message) + self.telegram.send_news_message(news_message) def send_top_pump_dump_statistics_report( self,