Skip to content

Commit

Permalink
More simplification on alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
patbaumgartner committed Aug 16, 2021
1 parent e993512 commit dc456fc
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions reporter/ReportGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand All @@ -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(
Expand All @@ -118,35 +115,16 @@ 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})\
""".format(
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,
Expand Down

0 comments on commit dc456fc

Please sign in to comment.