This commit is contained in:
aaron 2025-04-29 17:03:38 +08:00
parent 9bd2148cf8
commit 483f358972
3 changed files with 17 additions and 9 deletions

View File

@ -25,11 +25,14 @@ alltick:
# 加密货币设置 # 加密货币设置
crypto: crypto:
base_currencies: base_currencies:
# - "BTC" - "BTC"
# - "ETH" - "ETH"
# - "SOL" - "SOL"
# - "SUI" - "SUI"
- "CETUS" - "DOGE"
- "XRP"
- "ADA"
# - "CETUS"
quote_currency: "USDT" quote_currency: "USDT"
time_interval: "4h" # 可选: 1m, 5m, 15m, 30m, 1h, 4h, 1d time_interval: "4h" # 可选: 1m, 5m, 15m, 30m, 1h, 4h, 1d
historical_days: 30 historical_days: 30

View File

@ -19,9 +19,14 @@ from cryptoai.utils.config_loader import ConfigLoader
def main(): def main():
try: try:
print("定时程序启动") print("定时程序启动")
CryptoAgent().start_agent('BTCUSDT') CryptoAgent().start_agent()
# 设置每个4小时运行一次 # 设置 00:00, 04:00, 08:00, 12:00, 16:00, 20:00 运行一次
schedule.every(4).hours.do(CryptoAgent().start_agent) schedule.every().day.at("00:00").do(CryptoAgent().start_agent)
schedule.every().day.at("04:00").do(CryptoAgent().start_agent)
schedule.every().day.at("08:00").do(CryptoAgent().start_agent)
schedule.every().day.at("12: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)
# 启动定时任务 # 启动定时任务
while True: while True:

View File

@ -6,7 +6,7 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: cryptoai container_name: cryptoai
image: cryptoai:0.0.5 image: cryptoai:0.0.6
restart: unless-stopped restart: unless-stopped
volumes: volumes:
# 挂载配置文件 # 挂载配置文件