auto-sync: 2026-04-06 22:50:02
This commit is contained in:
@@ -9,27 +9,55 @@ echo "📊 目标: 下载5500只A股的15min数据"
|
||||
echo "⏱️ 开始时间: $(date)"
|
||||
|
||||
# 使用稳定下载器开始下载
|
||||
python3 -c "
|
||||
python3 << 'EOF'
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.append('/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/zhaoyun-data/scripts/data_acquisition')
|
||||
|
||||
from minute_kline_collector import MinuteKlineCollector
|
||||
from minute_kline_collector import MinuteKlineCollector, TimeFrame
|
||||
|
||||
collector = MinuteKlineCollector(
|
||||
base_dir='/Users/chufeng/nas/stock/minute_kline',
|
||||
timeframe='15min',
|
||||
base_dir='/Users/chufeng/nas/stock/minute_kline'
|
||||
)
|
||||
|
||||
print('🎯 赵云开始全量15min数据下载任务...')
|
||||
# 获取股票列表
|
||||
import json
|
||||
stock_list_file = '/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live/zhaoyun-data/data/raw/stock_info/stock_basic_info_raw_20260326_113530.json'
|
||||
with open(stock_list_file, 'r', encoding='utf-8') as f:
|
||||
stock_data = json.load(f)
|
||||
|
||||
# 提取股票代码列表,添加sh/sz前缀
|
||||
symbols = []
|
||||
for stock in stock_data:
|
||||
code = stock['code']
|
||||
if code.startswith('6'):
|
||||
symbol = f'sh{code}'
|
||||
elif code.startswith('0') or code.startswith('3'):
|
||||
symbol = f'sz{code}'
|
||||
else:
|
||||
continue # 跳过其他代码
|
||||
symbols.append(symbol)
|
||||
print(f'📊 总共 {len(symbols)} 只股票需要下载')
|
||||
|
||||
# 使用分批下载
|
||||
result = collector.batch_download_stocks(
|
||||
symbols=symbols,
|
||||
timeframe=TimeFrame.MIN15,
|
||||
start_date='2021-01-01',
|
||||
end_date='2026-03-27',
|
||||
batch_size=100,
|
||||
max_workers=5,
|
||||
retry_count=3
|
||||
max_workers=5
|
||||
)
|
||||
|
||||
print('🎯 赵云开始全量下载任务...')
|
||||
collector.download_all_stocks()
|
||||
print('✅ 全量下载任务完成!')
|
||||
"
|
||||
print(f'✅ 全量下载任务完成!成功: {result["success_count"]}, 失败: {result["failed_count"]}')
|
||||
# 保存结果
|
||||
result_file = '/Users/chufeng/nas/stock/minute_kline/reports/15min_download_result.json'
|
||||
with open(result_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(result, f, ensure_ascii=False, indent=2)
|
||||
print(f'📝 下载结果已保存到: {result_file}')
|
||||
|
||||
EOF
|
||||
|
||||
echo "⏱️ 结束时间: $(date)"
|
||||
echo "📈 下载总结: 请查看 /Users/chufeng/nas/stock/minute_kline/reports/"
|
||||
|
||||
Reference in New Issue
Block a user