47 lines
1.7 KiB
Python
47 lines
1.7 KiB
Python
|
||
from cryptoai.monitors.volume_growup import VolumeGrowupMonitor
|
||
from cryptoai.monitors.technical_indicators import TechnicalIndicatorsMonitor
|
||
import schedule
|
||
|
||
|
||
def run_monitor():
|
||
volume_growup_monitor = VolumeGrowupMonitor()
|
||
# volume_growup_monitor.run(time_interval="5m")
|
||
|
||
technical_indicators_monitor = TechnicalIndicatorsMonitor()
|
||
# technical_indicators_monitor.run(time_interval="15m")
|
||
|
||
# return
|
||
|
||
try:
|
||
print("☕️ 加密货币监控程序已启动")
|
||
|
||
# 5分钟监控,交易量增长
|
||
for time in [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]:
|
||
schedule.every().hour.at(time).do(volume_growup_monitor.run, time_interval="5m")
|
||
|
||
|
||
# 15分钟监控,技术指标
|
||
for time in [":00", ":15", ":30", ":45"]:
|
||
schedule.every().hour.at(time).do(technical_indicators_monitor.run, time_interval="15m")
|
||
|
||
# 每小时整点监控,技术指标
|
||
for time in ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"]:
|
||
schedule.every().day.at(time).do(technical_indicators_monitor.run, time_interval="1h")
|
||
|
||
# 4小时监控,技术指标
|
||
for time in ["00:00", "04:00", "08:00", "12:00", "16:00", "20:00"]:
|
||
schedule.every().day.at(time).do(technical_indicators_monitor.run, time_interval="4h")
|
||
|
||
|
||
while True:
|
||
schedule.run_pending()
|
||
import time
|
||
time.sleep(1)
|
||
except Exception as e:
|
||
print(f"程序运行出错: {e}")
|
||
import traceback
|
||
traceback.print_exc()
|
||
|
||
|