This commit is contained in:
aaron 2025-05-03 22:26:42 +08:00
parent 7ab58d1d87
commit c7f59cd616
4 changed files with 17 additions and 15 deletions

View File

@ -5,6 +5,7 @@ import schedule
def run_monitor():
volume_growup_monitor = VolumeGrowupMonitor()
# volume_growup_monitor.run(time_interval="5m")
try:
print("☕️ 加密货币监控程序已启动")

View File

@ -45,16 +45,17 @@ class VolumeGrowupMonitor:
volume_growth = processed_data['volume'].iloc[-2] / average_volume
print(f"{symbol} 过去 30 根 K 线的平均交易量为 {average_volume:.2f},当前交易量为 {processed_data['volume'].iloc[-1]:.2f},增长率为 {volume_growth:.2%}")
# 如果增加 5倍以上则发送消息
if volume_growth >= 5:
# 如果增加 10倍以上则发送消息
if volume_growth >= 10:
# markdown 格式带上emoji
message = f"""🚀交易量暴涨提醒🚀
监控交易对*** {symbol} ***
时间周期***{time_interval}***
30根K线平均交易量***{average_volume:.2f}***
当前交易量***{processed_data['volume'].iloc[-2]:.2f}***
增长率为 ***{volume_growth:.2%}***
message = f"""## 🚨 交易量暴涨提醒 - {symbol}
**周期**: `{time_interval}`
**30根K线平均量**: `{average_volume:.2f}`
**当前量**: `{processed_data['volume'].iloc[-2]:.2f}`
**增长倍数**: **{volume_growth:.2f} **
"""

View File

@ -31,11 +31,11 @@ def task_start():
schedule.every().day.at("16:00").do(CryptoAgent().start_agent)
schedule.every().day.at("20:00").do(CryptoAgent().start_agent)
schedule.every().day.at("00:00").do(GoldAgent().start_agent)
schedule.every().day.at("08:00").do(GoldAgent().start_agent)
schedule.every().day.at("12:00").do(GoldAgent().start_agent)
schedule.every().day.at("16:00").do(GoldAgent().start_agent)
schedule.every().day.at("20:00").do(GoldAgent().start_agent)
# schedule.every().day.at("00:00").do(GoldAgent().start_agent)
# schedule.every().day.at("08:00").do(GoldAgent().start_agent)
# schedule.every().day.at("12:00").do(GoldAgent().start_agent)
# schedule.every().day.at("16:00").do(GoldAgent().start_agent)
# schedule.every().day.at("20:00").do(GoldAgent().start_agent)
while True:
schedule.run_pending()

View File

@ -18,7 +18,7 @@ services:
cryptoai-monitor:
build: .
container_name: cryptoai-monitor
image: cryptoai-monitor:0.0.4
image: cryptoai-monitor:0.0.5
restart: always
command: python run_monitor.py
environment: