新增: - README.md: 完整的项目说明文档 - 系统简介和核心特性 - 技术栈和目录结构 - 快速开始和配置说明 - 使用示例和开发文档 - 数据表设计和扩展指南 - 更新日志和常见问题 整理: - 移动临时测试脚本到 tests/temp/ 目录 - check_1m_data.py - check_indicators.py - check_precision.py - check_tables.py - check_table_structure.py - test_calc_indicators.py
33 lines
939 B
Python
33 lines
939 B
Python
"""检查1m周期数据"""
|
|
|
|
import pymysql
|
|
|
|
conn = pymysql.connect(
|
|
host="localhost", user="root", password="1234", database="qtrade_backtest"
|
|
)
|
|
cursor = conn.cursor()
|
|
|
|
# 查看1m周期表中的股票代码
|
|
cursor.execute("SELECT DISTINCT symbol FROM klines_1m")
|
|
symbols = cursor.fetchall()
|
|
print("1m周期表中的股票代码:")
|
|
for s in symbols:
|
|
print(f" {s[0]}")
|
|
|
|
# 查看159915.SZ的数据量
|
|
cursor.execute("SELECT COUNT(*) FROM klines_1m WHERE symbol='159915.SZ'")
|
|
count = cursor.fetchone()[0]
|
|
print(f"\n159915.SZ的1m数据量: {count}")
|
|
|
|
# 查看159915.SZ在1d周期的数据量
|
|
cursor.execute("SELECT COUNT(*) FROM klines_1d WHERE symbol='159915.SZ'")
|
|
count = cursor.fetchone()[0]
|
|
print(f"159915.SZ的1d数据量: {count}")
|
|
|
|
# 查看601658.SH在1m的数据量
|
|
cursor.execute("SELECT COUNT(*) FROM klines_1m WHERE symbol='601658.SH'")
|
|
count = cursor.fetchone()[0]
|
|
print(f"601658.SH的1m数据量: {count}")
|
|
|
|
conn.close()
|