update
This commit is contained in:
parent
7ab58d1d87
commit
c7f59cd616
@ -5,6 +5,7 @@ import schedule
|
|||||||
|
|
||||||
def run_monitor():
|
def run_monitor():
|
||||||
volume_growup_monitor = VolumeGrowupMonitor()
|
volume_growup_monitor = VolumeGrowupMonitor()
|
||||||
|
# volume_growup_monitor.run(time_interval="5m")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("☕️ 加密货币监控程序已启动")
|
print("☕️ 加密货币监控程序已启动")
|
||||||
|
|||||||
@ -45,16 +45,17 @@ class VolumeGrowupMonitor:
|
|||||||
volume_growth = processed_data['volume'].iloc[-2] / average_volume
|
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%}")
|
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
|
# markdown 格式,带上emoji
|
||||||
message = f"""🚀交易量暴涨提醒🚀
|
message = f"""## 🚨 交易量暴涨提醒 - {symbol}
|
||||||
|
|
||||||
监控交易对:*** {symbol} ***
|
**周期**: `{time_interval}`
|
||||||
时间周期:***{time_interval}***
|
**30根K线平均量**: `{average_volume:.2f}`
|
||||||
30根K线平均交易量:***{average_volume:.2f}***
|
**当前量**: `{processed_data['volume'].iloc[-2]:.2f}`
|
||||||
当前交易量:***{processed_data['volume'].iloc[-2]:.2f}***
|
|
||||||
增长率为 ***{volume_growth:.2%}***
|
**增长倍数**: **{volume_growth:.2f} 倍**
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -31,11 +31,11 @@ def task_start():
|
|||||||
schedule.every().day.at("16:00").do(CryptoAgent().start_agent)
|
schedule.every().day.at("16:00").do(CryptoAgent().start_agent)
|
||||||
schedule.every().day.at("20: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("00:00").do(GoldAgent().start_agent)
|
||||||
schedule.every().day.at("08: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("12:00").do(GoldAgent().start_agent)
|
||||||
schedule.every().day.at("16: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("20:00").do(GoldAgent().start_agent)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
schedule.run_pending()
|
schedule.run_pending()
|
||||||
|
|||||||
@ -18,7 +18,7 @@ services:
|
|||||||
cryptoai-monitor:
|
cryptoai-monitor:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-monitor
|
container_name: cryptoai-monitor
|
||||||
image: cryptoai-monitor:0.0.4
|
image: cryptoai-monitor:0.0.5
|
||||||
restart: always
|
restart: always
|
||||||
command: python run_monitor.py
|
command: python run_monitor.py
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user