Skip to content

Commit

Permalink
Merge pull request #44 from patbaumgartner/master
Browse files Browse the repository at this point in the history
Improved 0% Reports and Alert message
  • Loading branch information
brianleect authored Aug 16, 2021
2 parents cd1428a + b7eefda commit 20a164b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion alerter/BinancePumpAndDumpAlerter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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 20a164b

Please sign in to comment.