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:
base_currencies:
# - "BTC"
# - "ETH"
# - "SOL"
# - "SUI"
- "CETUS"
- "BTC"
- "ETH"
- "SOL"
- "SUI"
- "DOGE"
- "XRP"
- "ADA"
# - "CETUS"
quote_currency: "USDT"
time_interval: "4h" # 可选: 1m, 5m, 15m, 30m, 1h, 4h, 1d
historical_days: 30

View File

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

View File

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