1
This commit is contained in:
parent
2a401a4066
commit
57fd75d0f5
@ -38,31 +38,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- PYTHONPATH=/app
|
- PYTHONPATH=/app
|
||||||
# 运行数据采集脚本
|
# 运行数据采集脚本
|
||||||
command: >
|
command: python scripts/data_collector.py
|
||||||
python -c "
|
|
||||||
import time;
|
|
||||||
import schedule;
|
|
||||||
from src.strategy.kline_pattern_strategy import KlinePatternStrategy;
|
|
||||||
from src.utils.config_loader import ConfigLoader;
|
|
||||||
from loguru import logger;
|
|
||||||
|
|
||||||
def run_strategy():
|
|
||||||
try:
|
|
||||||
config = ConfigLoader();
|
|
||||||
strategy = KlinePatternStrategy(config);
|
|
||||||
logger.info('开始运行策略扫描...');
|
|
||||||
logger.info('策略扫描完成');
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(f'策略运行失败 {e}');
|
|
||||||
|
|
||||||
schedule.every().day.at('09:00').do(run_strategy);
|
|
||||||
schedule.every().day.at('15:00').do(run_strategy);
|
|
||||||
logger.info('数据采集服务已启动');
|
|
||||||
|
|
||||||
while True:
|
|
||||||
schedule.run_pending();
|
|
||||||
time.sleep(60);
|
|
||||||
"
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- trading-web
|
- trading-web
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user