first commit
This commit is contained in:
commit
6986259726
|
@ -0,0 +1,253 @@
|
|||
# 股票数据分析工具
|
||||
|
||||
这是一个用于采集和分析股票数据的Python工具。主要功能包括:
|
||||
|
||||
1. 从雪球网获取股票数据并存储到数据库
|
||||
2. 分析涨幅超过1.5%的个股
|
||||
3. 按板块统计上涨股票的分布情况
|
||||
4. 识别在多个热门板块中出现的股票
|
||||
5. 对个股进行AI驱动的基本面分析并建立企业画像
|
||||
|
||||
## 环境要求
|
||||
|
||||
- Python 3.8+
|
||||
- MySQL数据库
|
||||
|
||||
## 安装依赖
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## 配置数据库
|
||||
|
||||
在运行脚本之前,请确保:
|
||||
|
||||
1. MySQL数据库已经启动
|
||||
2. 创建了名为 `db_gp_cj` 的数据库
|
||||
3. 数据库中存在 `stock_changes` 和 `gp_gnbk` 表
|
||||
|
||||
## 使用方法
|
||||
|
||||
1. 修改数据库连接信息:
|
||||
在 `src/scripts/stock_analysis.py` 中修改 `db_url` 变量为你的数据库连接信息
|
||||
|
||||
2. 运行脚本:
|
||||
```bash
|
||||
python src/scripts/stock_analysis.py
|
||||
```
|
||||
|
||||
## 主要功能
|
||||
|
||||
1. `fetch_and_store_stock_data`: 从雪球网获取股票数据并存储到数据库
|
||||
2. `get_high_performance_stocks`: 分析涨幅超过1.5%的股票及其板块分布
|
||||
3. `get_top_industries_and_stocks`: 分析在多个热门板块中出现的股票
|
||||
|
||||
## 基本面分析与企业画像
|
||||
|
||||
系统通过AI驱动的分析,对个股进行多维度基本面分析,构建全面的企业画像。每个维度分析结果都以文本形式保存,并提取关键指标形成量化评估,存储在数据库的`extra_info`字段中。
|
||||
|
||||
### 实控人和管理层持股 (management_ownership)
|
||||
|
||||
#### 持股稳定性 (shareholding)
|
||||
- `1`: 减持比例低 - 近三年减持比例低于2%,减持次数少于5次,减持后持股比例仍高于5%
|
||||
- `0`: 减持适中 - 减持比例在2%-5%之间,减持次数不超过10次,减持后持股比例仍高于5%
|
||||
- `-1`: 减持比例高 - 减持次数较多或比例较高,大股东持股比例已减持到5%以下
|
||||
|
||||
#### 管理层能力 (ability)
|
||||
- `1`: 领军人物 - 实控人或高管中存在行业领军人物
|
||||
- `0`: 一般水平 - 没有明显的行业领军人物
|
||||
- `-1`: 存在风险 - 实控人或高管存在被证监会处罚情况或司法犯罪可能性
|
||||
|
||||
### 财务报表分析 (financial_report)
|
||||
|
||||
#### 财务报表质量 (financial_report_level)
|
||||
- `2`: 优秀 - 边际向好,最新财报没有任何风险
|
||||
- `1`: 良好 - 边际变化波动不高较为稳定,风险很小
|
||||
- `0`: 一般 - 波动不高较为稳定,但存在一定财报隐患
|
||||
- `-1`: 较差 - 财报波动较大,且存在一定财报隐患
|
||||
- `-2`: 风险高 - 财报波动较大,且存在较大财报隐患
|
||||
|
||||
### 行业竞争格局 (industry_competition)
|
||||
|
||||
#### 行业发展空间 (industry_space)
|
||||
- `2`: 高增长 - 市场环境、阶段和竞争格局符合未来企业高速增长
|
||||
- `1`: 稳定增长 - 市场环境、阶段和竞争格局符合未来企业稳定经营
|
||||
- `0`: 不确定性 - 市场环境、阶段和竞争格局存在较大不确定性
|
||||
- `-1`: 不利环境 - 市场环境、阶段和竞争格局不利于企业正常经营
|
||||
|
||||
### 重大订单和项目进展 (recent_projects)
|
||||
|
||||
#### 项目进展质量 (major_events)
|
||||
- `1`: 超预期 - 项目进展顺利,且订单交付/建厂等超预期
|
||||
- `0`: 符合预期 - 进展顺利,但没有超预期
|
||||
- `-1`: 低于预期 - 进展不顺利,或按照进度进行但仍在验证中
|
||||
|
||||
### 股吧讨论分析 (stock_discussion)
|
||||
|
||||
#### 市场情绪 (emotion)
|
||||
- `1`: 乐观 - 股吧讨论情绪偏乐观
|
||||
- `0`: 中性 - 股吧讨论情绪偏中性
|
||||
- `-1`: 悲观 - 股吧讨论情绪偏悲观
|
||||
|
||||
### 产业链合作动态 (industry_cooperation)
|
||||
|
||||
#### 合作动态质量 (collaboration_dynamics)
|
||||
- `2`: 高质量 - 近期有较多且质量高的新合作动态,具备新业务拓展能力,可体现在近一年财报中
|
||||
- `1`: 一般 - 半年内合作动态频率低或质量一般,在原有业务上合作关系的衍生,对财报影响一般
|
||||
- `0`: 低质量 - 没有合作动态或质量低
|
||||
- `-1`: 负面 - 有负面合作关系,如解除合作或业务被其他厂商瓜分
|
||||
|
||||
### 券商研究与目标价 (target_price)
|
||||
|
||||
#### 券商评级 (securities_rating)
|
||||
- `2`: 买入 - 券商评级以"买入"居多
|
||||
- `1`: 增持 - 券商评级以"增持"居多
|
||||
- `0`: 中性 - 券商评级以"中性"居多或无评级
|
||||
- `-1`: 减持 - 券商评级以"减持"居多
|
||||
- `-2`: 卖出 - 券商评级以"卖出"居多
|
||||
|
||||
#### 上涨/下跌空间 (odds)
|
||||
- `1`: 上涨空间大 - 上涨空间大于下跌空间
|
||||
- `0`: 平衡 - 上涨空间和下跌空间差不多
|
||||
- `-1`: 下跌空间大 - 下跌空间大于上涨空间
|
||||
|
||||
### 投资建议 (investment_advice)
|
||||
|
||||
#### 投资建议类型 (investment_advice_type)
|
||||
- `短期`: 近期(1-3个月内)有明确利好因素、催化事件或阶段性业绩改善
|
||||
- `中期`: 无明确短期利好,但中期(3-12个月)业绩面临向上拐点或行业处于上升周期
|
||||
- `长期`: 公司具备长期稳定的盈利能力、行业地位稳固、长期成长性好
|
||||
- `不建议`: 存在风险因素、基本面恶化、估值过高或行业前景不佳
|
||||
|
||||
## 企业画像应用
|
||||
|
||||
基于上述多维度的量化指标,系统可以综合评估企业基本面状况,用于:
|
||||
|
||||
1. 筛选优质投资标的
|
||||
2. 评估投资风险
|
||||
3. 识别行业中的领先企业
|
||||
4. 预判企业未来发展趋势
|
||||
5. 辅助投资决策
|
||||
|
||||
企业基本面画像可以通过PDF报告形式输出,便于投资者快速了解企业综合情况。
|
||||
|
||||
## 企业筛选方法
|
||||
|
||||
基于基本面画像的量化指标,系统支持以下类型企业的筛选:
|
||||
|
||||
### 1. 高成长潜力企业
|
||||
- 行业发展空间 (industry_space) = 2
|
||||
- 财务报表质量 (financial_report_level) ≥ 1
|
||||
- 项目进展质量 (major_events) = 1
|
||||
- 合作动态质量 (collaboration_dynamics) ≥ 1
|
||||
- 券商评级 (securities_rating) ≥ 1
|
||||
- 上涨/下跌空间 (odds) = 1
|
||||
|
||||
筛选逻辑:选择处于高增长行业、财务状况良好、项目进展超预期、有高质量合作动态、券商看好且上涨空间大的企业。
|
||||
|
||||
### 2. 稳定型龙头企业
|
||||
- 管理层能力 (ability) = 1
|
||||
- 持股稳定性 (shareholding) ≥ 0
|
||||
- 财务报表质量 (financial_report_level) ≥ 1
|
||||
- 行业发展空间 (industry_space) ≥ 1
|
||||
- 合作动态质量 (collaboration_dynamics) ≥ 1
|
||||
- 券商评级 (securities_rating) ≥ 0
|
||||
|
||||
筛选逻辑:选择管理层能力强、持股稳定、财务状况良好、行业地位稳固、有稳定合作关系的企业。
|
||||
|
||||
### 3. 短期投资机会
|
||||
- 项目进展质量 (major_events) = 1
|
||||
- 市场情绪 (emotion) = 1
|
||||
- 券商评级 (securities_rating) ≥ 1
|
||||
- 上涨/下跌空间 (odds) = 1
|
||||
- 财务报表质量 (financial_report_level) ≥ 0
|
||||
|
||||
筛选逻辑:选择近期有超预期项目进展、市场情绪乐观、券商看好且上涨空间大的企业。
|
||||
|
||||
### 4. 价值型投资标的
|
||||
- 财务报表质量 (financial_report_level) = 2
|
||||
- 持股稳定性 (shareholding) = 1
|
||||
- 行业发展空间 (industry_space) ≥ 0
|
||||
- 合作动态质量 (collaboration_dynamics) ≥ 0
|
||||
- 券商评级 (securities_rating) ≥ 0
|
||||
|
||||
筛选逻辑:选择财务状况优秀、持股稳定、行业环境稳定、合作关系正常的企业。
|
||||
|
||||
### 5. 困境反转机会
|
||||
- 财务报表质量 (financial_report_level) = -1
|
||||
- 项目进展质量 (major_events) = 1
|
||||
- 行业发展空间 (industry_space) = 1
|
||||
- 市场情绪 (emotion) = 0
|
||||
- 券商评级 (securities_rating) = 0
|
||||
|
||||
筛选逻辑:选择当前财务状况较差但项目进展超预期、行业环境改善、市场情绪企稳的企业。
|
||||
|
||||
### 6. 风险规避标的
|
||||
- 管理层能力 (ability) = 1
|
||||
- 持股稳定性 (shareholding) = 1
|
||||
- 财务报表质量 (financial_report_level) ≥ 1
|
||||
- 行业发展空间 (industry_space) ≥ 0
|
||||
- 合作动态质量 (collaboration_dynamics) ≥ 0
|
||||
- 券商评级 (securities_rating) ≥ 0
|
||||
|
||||
筛选逻辑:选择管理层能力强、持股稳定、财务状况良好、行业环境稳定、合作关系正常的企业。
|
||||
|
||||
### 7. 创新驱动型企业
|
||||
- 行业发展空间 (industry_space) = 2
|
||||
- 合作动态质量 (collaboration_dynamics) = 2
|
||||
- 项目进展质量 (major_events) = 1
|
||||
- 财务报表质量 (financial_report_level) ≥ 0
|
||||
- 券商评级 (securities_rating) ≥ 1
|
||||
|
||||
筛选逻辑:选择处于高增长行业、有高质量新业务合作、项目进展超预期、财务状况稳定、券商看好的企业。
|
||||
|
||||
### 8. 行业整合机会
|
||||
- 行业发展空间 (industry_space) = 1
|
||||
- 合作动态质量 (collaboration_dynamics) = 2
|
||||
- 财务报表质量 (financial_report_level) ≥ 1
|
||||
- 券商评级 (securities_rating) ≥ 1
|
||||
- 上涨/下跌空间 (odds) = 1
|
||||
|
||||
筛选逻辑:选择行业环境稳定、有高质量新业务合作、财务状况良好、券商看好且上涨空间大的企业。
|
||||
|
||||
## 数据库查询示例
|
||||
|
||||
以下SQL查询示例展示了如何从数据库中筛选特定类型的企业:
|
||||
|
||||
```sql
|
||||
-- 筛选高成长潜力企业
|
||||
SELECT stock_code, stock_name, dimension, ai_response, extra_info
|
||||
FROM analysis_results
|
||||
WHERE dimension = 'industry_competition'
|
||||
AND JSON_EXTRACT(extra_info, '$.industry_space') = 2
|
||||
AND stock_code IN (
|
||||
SELECT stock_code
|
||||
FROM analysis_results
|
||||
WHERE dimension = 'financial_report'
|
||||
AND JSON_EXTRACT(extra_info, '$.financial_report_level') >= 1
|
||||
)
|
||||
AND stock_code IN (
|
||||
SELECT stock_code
|
||||
FROM analysis_results
|
||||
WHERE dimension = 'recent_projects'
|
||||
AND JSON_EXTRACT(extra_info, '$.major_events') = 1
|
||||
)
|
||||
-- ... 其他条件
|
||||
|
||||
-- 筛选稳定型龙头企业
|
||||
SELECT stock_code, stock_name, dimension, ai_response, extra_info
|
||||
FROM analysis_results
|
||||
WHERE dimension = 'management_ownership'
|
||||
AND JSON_EXTRACT(extra_info, '$.ability') = 1
|
||||
AND JSON_EXTRACT(extra_info, '$.shareholding') >= 0
|
||||
AND stock_code IN (
|
||||
SELECT stock_code
|
||||
FROM analysis_results
|
||||
WHERE dimension = 'financial_report'
|
||||
AND JSON_EXTRACT(extra_info, '$.financial_report_level') >= 1
|
||||
)
|
||||
-- ... 其他条件
|
||||
```
|
||||
|
||||
注意:实际查询时可能需要根据数据库表结构调整SQL语句。建议根据具体需求组合使用不同的筛选条件。
|
|
@ -0,0 +1,17 @@
|
|||
flask==2.0.3
|
||||
werkzeug==2.0.3
|
||||
flask-cors==3.0.10
|
||||
sqlalchemy==1.4.46
|
||||
pymysql==1.0.3
|
||||
tqdm>=4.65.0
|
||||
easy-spider-tool>=0.0.4
|
||||
easy-twitter-crawler>=0.0.4
|
||||
python-dateutil>=2.8.2
|
||||
numpy>=1.21.0
|
||||
matplotlib>=3.4.0
|
||||
volcengine-python-sdk[ark]
|
||||
openai>=1.0
|
||||
reportlab>=4.3.1
|
||||
markdown2>=2.5.3
|
||||
# 1. 按下 Win+R ,输入 regedit 打开注册表编辑器。
|
||||
# 2. 设置 \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem 路径下的变量 LongPathsEnabled 为 1 即可。
|
|
@ -0,0 +1,832 @@
|
|||
# 股票企业画像 API 文档
|
||||
|
||||
这个 API 提供了基于企业画像筛选股票的功能。
|
||||
|
||||
## 基础信息
|
||||
|
||||
- 基础 URL: `http://localhost:5000/api`
|
||||
- 所有响应均为 JSON 格式
|
||||
|
||||
## 接口列表
|
||||
|
||||
### 1. 健康检查
|
||||
|
||||
检查 API 服务是否正常运行。
|
||||
|
||||
- **URL**: `/health`
|
||||
- **方法**: `GET`
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"message": "Service is running"
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 获取企业画像类型列表
|
||||
|
||||
获取所有可用的企业画像筛选类型。
|
||||
|
||||
- **URL**: `/stock_profiles`
|
||||
- **方法**: `GET`
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"profiles": [
|
||||
{"id": 1, "name": "高成长潜力企业", "method": "high_growth"},
|
||||
{"id": 2, "name": "稳定型龙头企业", "method": "stable_leaders"},
|
||||
// ... 其他画像类型
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 根据企业画像类型筛选股票
|
||||
|
||||
根据预定义的企业画像类型筛选股票。
|
||||
|
||||
- **URL**: `/screen/{profile_type}`
|
||||
- **方法**: `GET`
|
||||
- **参数**:
|
||||
- `profile_type`: 企业画像类型,对应企业画像列表中的 `method` 字段
|
||||
- **可用的 profile_type 值**:
|
||||
- `high_growth`: 高成长潜力企业
|
||||
- `stable_leaders`: 稳定型龙头企业
|
||||
- `short_term`: 短期投资机会
|
||||
- `value_investment`: 价值型投资标的
|
||||
- `turnaround`: 困境反转机会
|
||||
- `risk_averse`: 风险规避标的
|
||||
- `innovation_driven`: 创新驱动型企业
|
||||
- `industry_integration`: 行业整合机会
|
||||
- `recommended`: 推荐投资企业
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"profile_type": "recommended",
|
||||
"count": 2,
|
||||
"stocks": [
|
||||
{"code": "000001", "name": "平安银行"},
|
||||
{"code": "600000", "name": "浦发银行"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 自定义条件筛选股票
|
||||
|
||||
使用自定义条件筛选股票。
|
||||
|
||||
- **URL**: `/screen/custom`
|
||||
- **方法**: `POST`
|
||||
- **请求体**:
|
||||
```json
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"dimension": "industry_competition",
|
||||
"field": "industry_space",
|
||||
"operator": "=",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"dimension": "financial_report",
|
||||
"field": "financial_report_level",
|
||||
"operator": ">=",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- **条件字段说明**:
|
||||
- `dimension`: 分析维度(例如:`industry_competition`, `financial_report`等)
|
||||
- `field`: 维度中的字段名(例如:`industry_space`, `financial_report_level`等)
|
||||
- `operator`: 操作符(`=`, `!=`, `>=`, `<=`, `>`, `<`, `in`)
|
||||
- `value`: 比较值
|
||||
- `required`: 是否必须满足(默认为`true`)
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"count": 3,
|
||||
"stocks": [
|
||||
{"code": "000001", "name": "平安银行"},
|
||||
{"code": "600000", "name": "浦发银行"},
|
||||
{"code": "601288", "name": "农业银行"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 5. 获取推荐投资企业
|
||||
|
||||
获取符合推荐投资条件(第9个企业画像)的企业列表。
|
||||
|
||||
- **URL**: `/recommended_stocks`
|
||||
- **方法**: `GET`
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"count": 2,
|
||||
"stocks": [
|
||||
{"code": "603690", "name": "至纯科技"},
|
||||
{"code": "688053", "name": "思科瑞"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 6. 批量生成股票投资报告
|
||||
|
||||
为指定的股票列表生成PDF投资报告。
|
||||
|
||||
- **URL**: `/generate_reports`
|
||||
- **方法**: `POST`
|
||||
- **请求体**:
|
||||
```json
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
]
|
||||
}
|
||||
```
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"message": "处理了 3 个股票的报告生成请求",
|
||||
"reports": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"report_path": "/path/to/603690_report.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"report_path": "/path/to/688053_report.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "数据获取失败"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 7. 分析股票列表并推荐投资企业
|
||||
|
||||
分析指定的股票列表,为每个股票生成投资建议,并筛选出符合推荐投资条件的企业。
|
||||
|
||||
- **URL**: `/analyze_and_recommend`
|
||||
- **方法**: `POST`
|
||||
- **请求体**:
|
||||
```json
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
]
|
||||
}
|
||||
```
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"total_input_stocks": 3,
|
||||
"investment_advices": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"advice": "中期持有...",
|
||||
"reasoning": "基于行业前景...",
|
||||
"references": [...],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"advice": "短期关注...",
|
||||
"reasoning": "考虑到公司近期...",
|
||||
"references": [...],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "数据获取失败"
|
||||
}
|
||||
],
|
||||
"recommended_stocks": {
|
||||
"count": 1,
|
||||
"stocks": [
|
||||
{"code": "688053", "name": "思科瑞"}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 8. 综合分析接口 - 组合多种功能和参数
|
||||
|
||||
综合接口,可以组合不同的功能和参数,包括股票列表、是否生成PDF以及企业画像筛选参数。
|
||||
|
||||
- **URL**: `/comprehensive_analysis`
|
||||
- **方法**: `POST`
|
||||
- **请求体**:
|
||||
```json
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"generate_pdf": false,
|
||||
"profile_filter": {
|
||||
"type": "recommended" // 使用预定义画像
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
或者使用自定义筛选条件:
|
||||
|
||||
```json
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"generate_pdf": false,
|
||||
"profile_filter": {
|
||||
"type": "custom",
|
||||
"conditions": [
|
||||
{
|
||||
"dimension": "financial_report",
|
||||
"field": "financial_report_level",
|
||||
"operator": ">=",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"dimension": "industry_competition",
|
||||
"field": "industry_space",
|
||||
"operator": "=",
|
||||
"value": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- **参数说明**:
|
||||
- `stocks`: 股票列表,每个股票为 [代码, 名称] 格式
|
||||
- `generate_pdf`: 是否生成PDF报告,布尔值 (true/false)
|
||||
- `profile_filter`: 企业画像筛选条件,可选
|
||||
- `type`: 筛选类型,可以是预定义画像名称或 "custom"
|
||||
- 预定义画像: `high_growth`, `stable_leaders`, `short_term`, `value_investment`, `turnaround`, `risk_averse`, `innovation_driven`, `industry_integration`, `recommended`
|
||||
- 自定义条件: `custom`
|
||||
- `conditions`: 当 type="custom" 时的自定义筛选条件数组
|
||||
- `dimension`: 分析维度
|
||||
- `field`: 字段名
|
||||
- `operator`: 操作符 ('=', '!=', '>=', '<=', '>', '<', 'in')
|
||||
- `value`: 比较值
|
||||
|
||||
- **响应示例**:
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"total_input_stocks": 3,
|
||||
"investment_advices": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"advice": "中期持有...",
|
||||
"reasoning": "基于行业前景...",
|
||||
"references": [...],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"advice": "短期关注...",
|
||||
"reasoning": "考虑到公司近期...",
|
||||
"references": [...],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "数据获取失败"
|
||||
}
|
||||
],
|
||||
"filtered_stocks": {
|
||||
"count": 1,
|
||||
"filter_type": "high_growth",
|
||||
"stocks": [
|
||||
{"code": "688053", "name": "思科瑞"}
|
||||
]
|
||||
},
|
||||
"pdf_reports": {
|
||||
"count": 3,
|
||||
"reports": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"report_path": "/path/to/603690_report.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"report_path": "/path/to/688053_report.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "生成PDF失败"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 错误处理
|
||||
|
||||
当发生错误时,API 将返回带有错误详情的 JSON 响应:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"message": "错误详情"
|
||||
}
|
||||
```
|
||||
|
||||
## 使用示例
|
||||
|
||||
### 使用 curl 获取高成长潜力企业
|
||||
|
||||
```bash
|
||||
curl -X GET http://localhost:5000/api/screen/high_growth
|
||||
```
|
||||
|
||||
### 使用自定义条件筛选股票
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/screen/custom \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"conditions": [
|
||||
{
|
||||
"dimension": "investment_advice",
|
||||
"field": "investment_advice_type",
|
||||
"operator": "!=",
|
||||
"value": "不建议"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 获取推荐投资企业列表
|
||||
|
||||
```bash
|
||||
curl -X GET http://localhost:5000/api/recommended_stocks
|
||||
```
|
||||
|
||||
### 批量生成投资报告
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/generate_reports \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 分析股票列表并筛选推荐投资企业
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/analyze_and_recommend \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 综合分析 - 生成投资建议、PDF报告并筛选高成长企业
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/comprehensive_analysis \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"generate_pdf": true,
|
||||
"profile_filter": {
|
||||
"type": "recommended"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
接口文档说明:
|
||||
# 综合分析接口文档
|
||||
|
||||
## 接口信息
|
||||
|
||||
- **接口名称**: 综合分析接口
|
||||
- **接口路径**: `/api/comprehensive_analysis`
|
||||
- **请求方法**: POST
|
||||
- **Content-Type**: application/json
|
||||
|
||||
## 接口用途
|
||||
|
||||
综合分析接口提供了一站式解决方案,可以组合多种功能和参数来完成以下任务:
|
||||
|
||||
1. 为指定的股票列表生成投资建议
|
||||
2. 根据企业画像条件筛选符合特定投资标准的股票
|
||||
3. 选择性地为股票生成 PDF 投资报告
|
||||
|
||||
该接口高度灵活,允许用户根据需求自由组合不同参数,实现个性化的股票分析和筛选功能。
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体(JSON格式)
|
||||
|
||||
```json
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"generate_pdf": false,
|
||||
"limit": 500,
|
||||
"profile_filter": {
|
||||
"type": "recommended"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 参数详细说明
|
||||
|
||||
| 参数名称 | 类型 | 是否必须 | 描述 |
|
||||
|---------|------|---------|------|
|
||||
| `stocks` | 数组 | 是 | 要分析的股票列表,每个股票为一个包含两个元素的数组 `[股票代码, 股票名称]` |
|
||||
| `generate_pdf` | 布尔值 | 否 | 是否为每个股票生成 PDF 投资报告,默认为 `false` |
|
||||
| `profile_filter` | 对象 | 否 | 企业画像筛选条件,用于从股票列表中筛选符合特定条件的股票 |
|
||||
|
||||
#### `stocks` 参数详情
|
||||
|
||||
二维数组,每个内部数组必须包含两个元素:
|
||||
- 第一个元素:股票代码(字符串)
|
||||
- 第二个元素:股票名称(字符串)
|
||||
|
||||
示例:`[["603690", "至纯科技"], ["688053", "思科瑞"]]`
|
||||
|
||||
#### `generate_pdf` 参数详情
|
||||
|
||||
- `true`:为每个股票生成 PDF 投资报告
|
||||
- `false`:不生成 PDF 报告(默认值)
|
||||
|
||||
#### `profile_filter` 参数详情
|
||||
|
||||
筛选条件对象,包含以下字段:
|
||||
|
||||
1. 使用预定义画像类型筛选:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "recommended"
|
||||
}
|
||||
```
|
||||
|
||||
或者(兼容旧版用法):
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "predefined", // 或任何非"custom"的值
|
||||
"profile_name": "recommended"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段名称 | 类型 | 是否必须 | 描述 |
|
||||
|---------|------|---------|------|
|
||||
| `type` | 字符串 | 是 | 预定义的企业画像类型或"custom"(自定义条件) |
|
||||
| `profile_name` | 字符串 | 否 | 当`type`不是"custom"时可选,用于指定具体的预定义画像类型。如果不提供,则使用`type`的值作为画像类型 |
|
||||
|
||||
预定义画像类型可选值:
|
||||
- `high_growth`: 高成长潜力企业
|
||||
- `stable_leaders`: 稳定型龙头企业
|
||||
- `short_term`: 短期投资机会
|
||||
- `value_investment`: 价值型投资标的
|
||||
- `turnaround`: 困境反转机会
|
||||
- `risk_averse`: 风险规避标的
|
||||
- `innovation`或`innovation_driven`: 创新驱动型企业
|
||||
- `integration`或`industry_integration`: 行业整合机会
|
||||
- `recommended`: 推荐投资企业
|
||||
|
||||
2. 使用自定义条件筛选:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "custom",
|
||||
"conditions": [
|
||||
{
|
||||
"dimension": "financial_report",
|
||||
"field": "financial_report_level",
|
||||
"operator": ">=",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"dimension": "industry_competition",
|
||||
"field": "industry_space",
|
||||
"operator": "=",
|
||||
"value": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
| 字段名称 | 类型 | 是否必须 | 描述 |
|
||||
|---------|------|---------|------|
|
||||
| `type` | 字符串 | 是 | 必须为 `"custom"` |
|
||||
| `conditions` | 数组 | 是 | 自定义筛选条件数组 |
|
||||
|
||||
##### `conditions` 数组中的每个条件对象:
|
||||
|
||||
| 字段名称 | 类型 | 是否必须 | 描述 |
|
||||
|---------|------|---------|------|
|
||||
| `dimension` | 字符串 | 是 | 分析维度 |
|
||||
| `field` | 字符串 | 是 | 维度中的字段名 |
|
||||
| `operator` | 字符串 | 是 | 比较操作符 |
|
||||
| `value` | 多种类型 | 是 | 比较值 |
|
||||
| `required` | 布尔值 | 否 | 是否必须满足该条件,默认为 `true` |
|
||||
|
||||
**分析维度(`dimension`)可选值**:
|
||||
- `financial_report`: 财务报告分析
|
||||
- `industry_competition`: 行业竞争分析
|
||||
- `industry_cooperation`: 行业合作分析
|
||||
- `management_ownership`: 管理层持股分析
|
||||
- `recent_projects`: 近期项目分析
|
||||
- `stock_discussion`: 股票讨论分析
|
||||
- `target_price`: 目标价格分析
|
||||
- `investment_advice`: 投资建议分析
|
||||
|
||||
**字段名(`field`)可选值**(根据不同维度):
|
||||
- 财务报告: `financial_report_level`
|
||||
- 行业竞争: `industry_space`
|
||||
- 行业合作: `collaboration_dynamics`
|
||||
- 管理层持股: `ability`, `shareholding`
|
||||
- 近期项目: `major_events`
|
||||
- 股票讨论: `emotion`
|
||||
- 目标价格: `securities_rating`, `odds`
|
||||
- 投资建议: `investment_advice_type`
|
||||
|
||||
**操作符(`operator`)可选值**:
|
||||
- `=`: 等于
|
||||
- `!=`: 不等于
|
||||
- `>`: 大于
|
||||
- `<`: 小于
|
||||
- `>=`: 大于等于
|
||||
- `<=`: 小于等于
|
||||
- `in`: 包含于(此时 `value` 应为数组)
|
||||
|
||||
**比较值(`value`)类型**:
|
||||
- 当操作符为 `in` 时,`value` 为数组
|
||||
- 其他情况下,根据字段类型可以是数字或字符串
|
||||
|
||||
## 响应内容
|
||||
|
||||
### 成功响应
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "success",
|
||||
"total_input_stocks": 3,
|
||||
"investment_advices": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"advice": "中期持有,结合目前的情况...(详细内容)",
|
||||
"reasoning": "基于行业前景和公司近期表现...(详细内容)",
|
||||
"references": ["财报数据", "行业研报"],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"advice": "短期关注,考虑到...(详细内容)",
|
||||
"reasoning": "考虑到公司近期的产品进展...(详细内容)",
|
||||
"references": ["公司公告", "行业数据"],
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "数据获取失败,请稍后重试"
|
||||
}
|
||||
],
|
||||
"filtered_stocks": {
|
||||
"count": 1,
|
||||
"filter_type": "high_growth",
|
||||
"stocks": [
|
||||
{"code": "688053", "name": "思科瑞"}
|
||||
]
|
||||
},
|
||||
"pdf_reports": {
|
||||
"count": 3,
|
||||
"reports": [
|
||||
{
|
||||
"code": "603690",
|
||||
"name": "至纯科技",
|
||||
"report_path": "/reports/603690_20240328.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "688053",
|
||||
"name": "思科瑞",
|
||||
"report_path": "/reports/688053_20240328.pdf",
|
||||
"status": "success"
|
||||
},
|
||||
{
|
||||
"code": "300750",
|
||||
"name": "宁德时代",
|
||||
"status": "error",
|
||||
"error": "生成报告时出错:数据不完整"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 响应字段说明
|
||||
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `status` | 字符串 | 响应状态,成功为 `"success"` |
|
||||
| `total_input_stocks` | 整数 | 输入的股票总数 |
|
||||
| `investment_advices` | 数组 | 每个股票的投资建议结果 |
|
||||
| `filtered_stocks` | 对象 | 筛选结果(仅当请求中包含 `profile_filter` 时返回) |
|
||||
| `pdf_reports` | 对象 | PDF报告生成结果(仅当 `generate_pdf=true` 时返回) |
|
||||
|
||||
#### `investment_advices` 数组中的每个对象
|
||||
|
||||
成功情况:
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `code` | 字符串 | 股票代码 |
|
||||
| `name` | 字符串 | 股票名称 |
|
||||
| `advice` | 字符串 | 投资建议详细内容 |
|
||||
| `reasoning` | 字符串 | 投资建议的推理过程 |
|
||||
| `references` | 数组 | 参考资料列表 |
|
||||
| `status` | 字符串 | 处理状态,值为 `"success"` |
|
||||
|
||||
失败情况:
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `code` | 字符串 | 股票代码 |
|
||||
| `name` | 字符串 | 股票名称 |
|
||||
| `status` | 字符串 | 处理状态,值为 `"error"` |
|
||||
| `error` | 字符串 | 错误详情 |
|
||||
|
||||
#### `filtered_stocks` 对象
|
||||
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `count` | 整数 | 筛选出的股票数量 |
|
||||
| `filter_type` | 字符串 | 使用的筛选类型 |
|
||||
| `stocks` | 数组 | 筛选出的股票列表 |
|
||||
|
||||
`stocks` 数组中的每个对象:
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `code` | 字符串 | 股票代码 |
|
||||
| `name` | 字符串 | 股票名称 |
|
||||
|
||||
#### `pdf_reports` 对象
|
||||
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `count` | 整数 | 处理的报告总数 |
|
||||
| `reports` | 数组 | 报告生成结果列表 |
|
||||
|
||||
`reports` 数组中的每个对象:
|
||||
|
||||
成功情况:
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `code` | 字符串 | 股票代码 |
|
||||
| `name` | 字符串 | 股票名称 |
|
||||
| `report_path` | 字符串 | 生成的PDF报告路径 |
|
||||
| `status` | 字符串 | 处理状态,值为 `"success"` |
|
||||
|
||||
失败情况:
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `code` | 字符串 | 股票代码 |
|
||||
| `name` | 字符串 | 股票名称 |
|
||||
| `status` | 字符串 | 处理状态,值为 `"error"` |
|
||||
| `error` | 字符串 | 错误详情 |
|
||||
|
||||
### 错误响应
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"message": "错误详情说明"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段名称 | 类型 | 描述 |
|
||||
|---------|------|------|
|
||||
| `status` | 字符串 | 响应状态,失败为 `"error"` |
|
||||
| `message` | 字符串 | 错误详情描述 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
### 示例1:基本使用 - 仅生成投资建议
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/comprehensive_analysis \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"]
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
### 示例2:生成投资建议和PDF报告
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/comprehensive_analysis \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"]
|
||||
],
|
||||
"generate_pdf": false
|
||||
}'
|
||||
```
|
||||
|
||||
### 示例3:使用预定义画像筛选符合条件的股票
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/comprehensive_analysis \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"profile_filter": {
|
||||
"type": "recommended"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### 示例4:使用自定义条件筛选股票
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:5000/api/comprehensive_analysis \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"profile_filter": {
|
||||
"type": "custom",
|
||||
"conditions": [
|
||||
{
|
||||
"dimension": "financial_report",
|
||||
"field": "financial_report_level",
|
||||
"operator": ">=",
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
Binary file not shown.
|
@ -0,0 +1,795 @@
|
|||
import sys
|
||||
import os
|
||||
|
||||
# 添加项目根目录到 Python 路径
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from flask import Flask, jsonify, request
|
||||
from flask_cors import CORS
|
||||
import logging
|
||||
|
||||
# 导入企业筛选器
|
||||
from src.fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
|
||||
# 设置日志
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 创建 Flask 应用
|
||||
app = Flask(__name__)
|
||||
CORS(app) # 启用跨域请求支持
|
||||
|
||||
# 创建企业筛选器实例
|
||||
screener = EnterpriseScreener()
|
||||
|
||||
@app.route('/api/health', methods=['GET'])
|
||||
def health_check():
|
||||
"""健康检查接口"""
|
||||
return jsonify({"status": "ok", "message": "Service is running"})
|
||||
|
||||
@app.route('/api/stock_profiles', methods=['GET'])
|
||||
def get_stock_profiles():
|
||||
"""获取企业画像筛选结果列表"""
|
||||
return jsonify({
|
||||
"profiles": [
|
||||
{"id": 1, "name": "高成长潜力企业", "method": "high_growth"},
|
||||
{"id": 2, "name": "稳定型龙头企业", "method": "stable_leaders"},
|
||||
{"id": 3, "name": "短期投资机会", "method": "short_term"},
|
||||
{"id": 4, "name": "价值型投资标的", "method": "value_investment"},
|
||||
{"id": 5, "name": "困境反转机会", "method": "turnaround"},
|
||||
{"id": 6, "name": "风险规避标的", "method": "risk_averse"},
|
||||
{"id": 7, "name": "创新驱动型企业", "method": "innovation_driven"},
|
||||
{"id": 8, "name": "行业整合机会", "method": "industry_integration"},
|
||||
{"id": 9, "name": "推荐投资企业", "method": "recommended"}
|
||||
]
|
||||
})
|
||||
|
||||
@app.route('/api/screen/<profile_type>', methods=['GET'])
|
||||
def screen_stocks(profile_type):
|
||||
"""根据企业画像类型筛选股票
|
||||
|
||||
Args:
|
||||
profile_type: 企业画像类型 (method 字段值)
|
||||
"""
|
||||
try:
|
||||
# 解析limit参数
|
||||
limit = request.args.get('limit', None, type=int)
|
||||
|
||||
# 处理别名
|
||||
if profile_type == 'innovation_driven':
|
||||
profile_type = 'innovation'
|
||||
elif profile_type == 'industry_integration':
|
||||
profile_type = 'integration'
|
||||
|
||||
# 映射画像类型到筛选方法
|
||||
method_map = {
|
||||
'high_growth': screener.screen_high_growth_stocks,
|
||||
'stable_leaders': screener.screen_stable_leaders,
|
||||
'short_term': screener.screen_short_term_opportunities,
|
||||
'value_investment': screener.screen_value_investment_stocks,
|
||||
'turnaround': screener.screen_turnaround_opportunities,
|
||||
'risk_averse': screener.screen_risk_averse_stocks,
|
||||
'innovation': screener.screen_innovation_driven_stocks,
|
||||
'integration': screener.screen_industry_integration_stocks,
|
||||
'recommended': screener.screen_multi_term_investment_stocks
|
||||
}
|
||||
|
||||
# 检查请求的画像类型是否有效
|
||||
if profile_type not in method_map:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"Invalid profile type: {profile_type}"
|
||||
}), 400
|
||||
|
||||
# 调用相应的筛选方法
|
||||
stocks = method_map[profile_type](limit=limit)
|
||||
|
||||
# 转换结果格式
|
||||
result = []
|
||||
for code, name in stocks:
|
||||
result.append({
|
||||
"code": code,
|
||||
"name": name
|
||||
})
|
||||
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"profile_type": profile_type,
|
||||
"count": len(result),
|
||||
"stocks": result
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"筛选股票失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"Failed to screen stocks: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 条件筛选接口,接受自定义的筛选条件
|
||||
@app.route('/api/screen/custom', methods=['POST'])
|
||||
def screen_custom():
|
||||
"""使用自定义条件筛选股票"""
|
||||
try:
|
||||
# 从请求体获取筛选条件
|
||||
data = request.get_json()
|
||||
|
||||
if not data or 'conditions' not in data:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "Missing conditions in request body"
|
||||
}), 400
|
||||
|
||||
# 调用通用筛选方法
|
||||
stocks = screener._screen_stocks_by_conditions(data['conditions'])
|
||||
|
||||
# 转换结果格式
|
||||
result = []
|
||||
for code, name in stocks:
|
||||
result.append({
|
||||
"code": code,
|
||||
"name": name
|
||||
})
|
||||
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"count": len(result),
|
||||
"stocks": result
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"自定义筛选股票失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"Failed to screen stocks with custom conditions: {str(e)}"
|
||||
}), 500
|
||||
|
||||
@app.route('/api/generate_reports', methods=['POST'])
|
||||
def generate_reports():
|
||||
"""为指定的股票列表生成PDF投资报告
|
||||
|
||||
请求体格式:
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
]
|
||||
}
|
||||
"""
|
||||
try:
|
||||
# 从请求体获取股票列表
|
||||
data = request.get_json()
|
||||
|
||||
if not data or 'stocks' not in data or not isinstance(data['stocks'], list):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "请求格式错误: 需要提供股票列表"
|
||||
}), 400
|
||||
|
||||
# 检查股票列表格式
|
||||
stocks = data['stocks']
|
||||
if not all(isinstance(item, list) and len(item) == 2 for item in stocks):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "股票列表格式错误: 每个股票应该是 [代码, 名称] 格式"
|
||||
}), 400
|
||||
|
||||
# 导入 PDF 生成器模块
|
||||
try:
|
||||
from src.fundamentals_llm.pdf_generator import generate_investment_report
|
||||
except ImportError:
|
||||
try:
|
||||
from fundamentals_llm.pdf_generator import generate_investment_report
|
||||
except ImportError as e:
|
||||
logger.error(f"无法导入 PDF 生成器模块: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: PDF 生成器模块不可用, 错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 生成报告
|
||||
generated_reports = []
|
||||
for stock_code, stock_name in stocks:
|
||||
try:
|
||||
# 调用 PDF 生成器
|
||||
report_path = generate_investment_report(stock_code, stock_name)
|
||||
generated_reports.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"report_path": report_path,
|
||||
"status": "success"
|
||||
})
|
||||
logger.info(f"成功生成 {stock_name}({stock_code}) 的投资报告: {report_path}")
|
||||
except Exception as e:
|
||||
logger.error(f"生成 {stock_name}({stock_code}) 的投资报告失败: {str(e)}")
|
||||
generated_reports.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": str(e)
|
||||
})
|
||||
|
||||
# 返回结果
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"message": f"处理了 {len(stocks)} 个股票的报告生成请求",
|
||||
"reports": generated_reports
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"处理报告生成请求失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"Failed to process report generation request: {str(e)}"
|
||||
}), 500
|
||||
|
||||
@app.route('/api/recommended_stocks', methods=['GET'])
|
||||
def recommended_stocks():
|
||||
"""获取系统推荐的投资股票
|
||||
|
||||
该接口会返回系统基于基本面分析推荐的股票列表,具有较高投资价值
|
||||
|
||||
可以通过以下参数进行过滤:
|
||||
- profile_type: 企业画像类型,例如 'high_growth', 'stable_leaders' 等
|
||||
- limit: 限制返回的股票数量
|
||||
"""
|
||||
try:
|
||||
# 解析请求参数
|
||||
profile_type = request.args.get('profile_type', 'high_growth')
|
||||
limit = request.args.get('limit', 10, type=int)
|
||||
|
||||
# 导入筛选器模块
|
||||
try:
|
||||
from src.fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError:
|
||||
try:
|
||||
from fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError as e:
|
||||
logger.error(f"无法导入企业筛选器模块: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 企业筛选器模块不可用, 错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 创建筛选器实例
|
||||
screener = EnterpriseScreener()
|
||||
|
||||
# 根据类型获取推荐股票
|
||||
try:
|
||||
if profile_type == 'recommended':
|
||||
stocks = screener.screen_multi_term_investment_stocks(limit=limit)
|
||||
elif profile_type == 'high_growth':
|
||||
stocks = screener.screen_high_growth_stocks(limit=limit)
|
||||
elif profile_type == 'stable_leaders':
|
||||
stocks = screener.screen_stable_leaders(limit=limit)
|
||||
elif profile_type == 'short_term':
|
||||
stocks = screener.screen_short_term_opportunities(limit=limit)
|
||||
elif profile_type == 'value_investment':
|
||||
stocks = screener.screen_value_investment_stocks(limit=limit)
|
||||
elif profile_type == 'turnaround':
|
||||
stocks = screener.screen_turnaround_opportunities(limit=limit)
|
||||
elif profile_type == 'risk_averse':
|
||||
stocks = screener.screen_risk_averse_stocks(limit=limit)
|
||||
elif profile_type == 'innovation' or profile_type == 'innovation_driven':
|
||||
stocks = screener.screen_innovation_driven_stocks(limit=limit)
|
||||
elif profile_type == 'integration' or profile_type == 'industry_integration':
|
||||
stocks = screener.screen_industry_integration_stocks(limit=limit)
|
||||
elif profile_type == 'custom' and 'conditions' in request.args:
|
||||
# 解析自定义条件
|
||||
try:
|
||||
import json
|
||||
conditions = json.loads(request.args.get('conditions'))
|
||||
stocks = screener.screen_by_custom_conditions(conditions, limit=limit)
|
||||
except Exception as e:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"解析自定义条件失败: {str(e)}"
|
||||
}), 400
|
||||
else:
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"不支持的企业画像类型: {profile_type}"
|
||||
}), 400
|
||||
except Exception as e:
|
||||
logger.error(f"筛选股票时出错: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"筛选股票时出错: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 格式化返回结果
|
||||
formatted_stocks = []
|
||||
for stock_code, stock_name in stocks:
|
||||
formatted_stocks.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name
|
||||
})
|
||||
|
||||
# 返回结果
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"profile_type": profile_type,
|
||||
"count": len(formatted_stocks),
|
||||
"stocks": formatted_stocks
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"获取推荐股票失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"获取推荐股票失败: {str(e)}"
|
||||
}), 500
|
||||
|
||||
@app.route('/api/analyze_and_recommend', methods=['POST'])
|
||||
def analyze_and_recommend():
|
||||
"""分析指定企业列表,生成投资建议,并筛选推荐投资的企业
|
||||
|
||||
请求体格式:
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"limit": 10 // 可选,限制返回推荐股票的数量
|
||||
}
|
||||
"""
|
||||
try:
|
||||
# 从请求体获取股票列表
|
||||
data = request.get_json()
|
||||
|
||||
if not data or 'stocks' not in data or not isinstance(data['stocks'], list):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "请求格式错误: 需要提供股票列表"
|
||||
}), 400
|
||||
|
||||
# 检查股票列表格式
|
||||
stocks = data['stocks']
|
||||
if not all(isinstance(item, list) and len(item) == 2 for item in stocks):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "股票列表格式错误: 每个股票应该是 [代码, 名称] 格式"
|
||||
}), 400
|
||||
|
||||
# 解析limit参数
|
||||
limit = data.get('limit', 10)
|
||||
if not isinstance(limit, int) or limit <= 0:
|
||||
limit = 10
|
||||
|
||||
# 导入必要的聊天机器人模块
|
||||
try:
|
||||
# 首先尝试导入聊天机器人模块
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot import ChatBot as OnlineChatBot
|
||||
logger.info("成功从 src.fundamentals_llm.chat_bot 导入 ChatBot")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.chat_bot import ChatBot as OnlineChatBot
|
||||
logger.info("成功从 fundamentals_llm.chat_bot 导入 ChatBot")
|
||||
except ImportError as e2:
|
||||
logger.error(f"无法导入在线聊天机器人模块: {str(e1)}, {str(e2)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 聊天机器人模块不可用,错误详情: {str(e2)}"
|
||||
}), 500
|
||||
|
||||
# 然后尝试导入离线聊天机器人模块
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot_with_offline import ChatBot as OfflineChatBot
|
||||
logger.info("成功从 src.fundamentals_llm.chat_bot_with_offline 导入 ChatBot")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.chat_bot_with_offline import ChatBot as OfflineChatBot
|
||||
logger.info("成功从 fundamentals_llm.chat_bot_with_offline 导入 ChatBot")
|
||||
except ImportError as e2:
|
||||
logger.warning(f"无法导入离线聊天机器人模块: {str(e1)}, {str(e2)}")
|
||||
# 这里可以继续执行,因为某些功能可能不需要离线模型
|
||||
|
||||
# 最后导入基本面分析器
|
||||
try:
|
||||
from src.fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功从 src.fundamentals_llm.fundamental_analysis 导入 FundamentalAnalyzer")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功从 fundamentals_llm.fundamental_analysis 导入 FundamentalAnalyzer")
|
||||
except ImportError as e2:
|
||||
logger.error(f"无法导入基本面分析模块: {str(e1)}, {str(e2)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 基本面分析模块不可用,错误详情: {str(e2)}"
|
||||
}), 500
|
||||
except Exception as e:
|
||||
logger.error(f"导入必要模块时出错: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 导入必要模块时出错,错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 创建基本面分析器实例
|
||||
analyzer = FundamentalAnalyzer()
|
||||
|
||||
# 为每个股票生成投资建议
|
||||
investment_advices = []
|
||||
for stock_code, stock_name in stocks:
|
||||
try:
|
||||
# 生成投资建议
|
||||
success, advice, reasoning, references = analyzer.query_analysis(
|
||||
stock_code, stock_name, "investment_advice"
|
||||
)
|
||||
|
||||
if success:
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"advice": advice,
|
||||
"reasoning": reasoning,
|
||||
"references": references,
|
||||
"status": "success"
|
||||
})
|
||||
logger.info(f"成功生成 {stock_name}({stock_code}) 的投资建议")
|
||||
else:
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": advice
|
||||
})
|
||||
logger.error(f"生成 {stock_name}({stock_code}) 的投资建议失败: {advice}")
|
||||
except Exception as e:
|
||||
logger.error(f"处理 {stock_name}({stock_code}) 时出错: {str(e)}")
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": str(e)
|
||||
})
|
||||
|
||||
# 导入企业筛选器
|
||||
try:
|
||||
from src.fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError:
|
||||
try:
|
||||
from fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError as e:
|
||||
logger.error(f"无法导入企业筛选器模块: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 企业筛选器模块不可用,错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 创建筛选器实例
|
||||
screener = EnterpriseScreener()
|
||||
|
||||
# 筛选符合推荐投资条件的股票
|
||||
# 获取传入的所有股票代码
|
||||
input_stock_codes = set(code for code, _ in stocks)
|
||||
|
||||
# 获取所有符合推荐投资条件的股票
|
||||
recommended_stocks = screener.screen_multi_term_investment_stocks(limit=limit)
|
||||
|
||||
# 筛选出传入列表中符合推荐投资条件的股票
|
||||
recommended_input_stocks = []
|
||||
for code, name in recommended_stocks:
|
||||
if code in input_stock_codes:
|
||||
recommended_input_stocks.append({
|
||||
"code": code,
|
||||
"name": name
|
||||
})
|
||||
|
||||
# 返回结果
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"total_input_stocks": len(stocks),
|
||||
"investment_advices": investment_advices,
|
||||
"recommended_stocks": {
|
||||
"count": len(recommended_input_stocks),
|
||||
"stocks": recommended_input_stocks
|
||||
}
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"分析和推荐股票失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"分析和推荐股票失败: {str(e)}"
|
||||
}), 500
|
||||
|
||||
@app.route('/api/comprehensive_analysis', methods=['POST'])
|
||||
def comprehensive_analysis():
|
||||
"""综合分析接口 - 组合多种功能和参数
|
||||
|
||||
请求体格式:
|
||||
{
|
||||
"stocks": [
|
||||
["603690", "至纯科技"],
|
||||
["688053", "思科瑞"],
|
||||
["300750", "宁德时代"]
|
||||
],
|
||||
"generate_pdf": true,
|
||||
"limit": 10, // 可选,限制返回推荐股票的数量
|
||||
"profile_filter": {
|
||||
"type": "custom", // 可选值: 预定义的画像类型或 "custom"
|
||||
"profile_name": "high_growth", // 当 type = 预定义画像类型时使用
|
||||
"conditions": [ // 当 type = "custom" 时使用
|
||||
{
|
||||
"dimension": "financial_report",
|
||||
"field": "financial_report_level",
|
||||
"operator": ">=",
|
||||
"value": 1
|
||||
},
|
||||
// 其他条件...
|
||||
]
|
||||
}
|
||||
}
|
||||
"""
|
||||
try:
|
||||
# 从请求体获取参数
|
||||
data = request.get_json()
|
||||
|
||||
if not data or 'stocks' not in data or not isinstance(data['stocks'], list):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "请求格式错误: 需要提供股票列表"
|
||||
}), 400
|
||||
|
||||
# 检查股票列表格式
|
||||
stocks = data['stocks']
|
||||
if not all(isinstance(item, list) and len(item) == 2 for item in stocks):
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": "股票列表格式错误: 每个股票应该是 [代码, 名称] 格式"
|
||||
}), 400
|
||||
|
||||
# 解析其他参数
|
||||
generate_pdf = data.get('generate_pdf', False)
|
||||
profile_filter = data.get('profile_filter', None)
|
||||
limit = data.get('limit', 10)
|
||||
if not isinstance(limit, int) or limit <= 0:
|
||||
limit = 10
|
||||
|
||||
# 导入必要的聊天机器人模块
|
||||
try:
|
||||
# 首先尝试导入聊天机器人模块
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot import ChatBot as OnlineChatBot
|
||||
logger.info("成功从 src.fundamentals_llm.chat_bot 导入 ChatBot")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.chat_bot import ChatBot as OnlineChatBot
|
||||
logger.info("成功从 fundamentals_llm.chat_bot 导入 ChatBot")
|
||||
except ImportError as e2:
|
||||
logger.error(f"无法导入在线聊天机器人模块: {str(e1)}, {str(e2)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 聊天机器人模块不可用,错误详情: {str(e2)}"
|
||||
}), 500
|
||||
|
||||
# 然后尝试导入离线聊天机器人模块
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot_with_offline import ChatBot as OfflineChatBot
|
||||
logger.info("成功从 src.fundamentals_llm.chat_bot_with_offline 导入 ChatBot")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.chat_bot_with_offline import ChatBot as OfflineChatBot
|
||||
logger.info("成功从 fundamentals_llm.chat_bot_with_offline 导入 ChatBot")
|
||||
except ImportError as e2:
|
||||
logger.warning(f"无法导入离线聊天机器人模块: {str(e1)}, {str(e2)}")
|
||||
# 这里可以继续执行,因为某些功能可能不需要离线模型
|
||||
|
||||
# 最后导入基本面分析器
|
||||
try:
|
||||
from src.fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功从 src.fundamentals_llm.fundamental_analysis 导入 FundamentalAnalyzer")
|
||||
except ImportError as e1:
|
||||
try:
|
||||
from fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功从 fundamentals_llm.fundamental_analysis 导入 FundamentalAnalyzer")
|
||||
except ImportError as e2:
|
||||
logger.error(f"无法导入基本面分析模块: {str(e1)}, {str(e2)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 基本面分析模块不可用,错误详情: {str(e2)}"
|
||||
}), 500
|
||||
except Exception as e:
|
||||
logger.error(f"导入必要模块时出错: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 导入必要模块时出错,错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 创建基本面分析器实例
|
||||
analyzer = FundamentalAnalyzer()
|
||||
|
||||
# 为每个股票生成投资建议
|
||||
investment_advices = []
|
||||
for stock_code, stock_name in stocks:
|
||||
try:
|
||||
# 生成投资建议
|
||||
success, advice, reasoning, references = analyzer.query_analysis(
|
||||
stock_code, stock_name, "investment_advice"
|
||||
)
|
||||
|
||||
if success:
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"advice": advice,
|
||||
"reasoning": reasoning,
|
||||
"references": references,
|
||||
"status": "success"
|
||||
})
|
||||
logger.info(f"成功生成 {stock_name}({stock_code}) 的投资建议")
|
||||
else:
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": advice
|
||||
})
|
||||
logger.error(f"生成 {stock_name}({stock_code}) 的投资建议失败: {advice}")
|
||||
except Exception as e:
|
||||
logger.error(f"处理 {stock_name}({stock_code}) 时出错: {str(e)}")
|
||||
investment_advices.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": str(e)
|
||||
})
|
||||
|
||||
# 生成PDF报告(如果需要)
|
||||
pdf_results = []
|
||||
if generate_pdf:
|
||||
try:
|
||||
# 导入PDF生成器模块
|
||||
try:
|
||||
from src.fundamentals_llm.pdf_generator import generate_investment_report
|
||||
except ImportError:
|
||||
try:
|
||||
from fundamentals_llm.pdf_generator import generate_investment_report
|
||||
except ImportError as e:
|
||||
logger.error(f"无法导入 PDF 生成器模块: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: PDF 生成器模块不可用, 错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 生成报告
|
||||
for stock_code, stock_name in stocks:
|
||||
try:
|
||||
# 调用 PDF 生成器
|
||||
report_path = generate_investment_report(stock_code, stock_name)
|
||||
pdf_results.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"report_path": report_path,
|
||||
"status": "success"
|
||||
})
|
||||
logger.info(f"成功生成 {stock_name}({stock_code}) 的投资报告: {report_path}")
|
||||
except Exception as e:
|
||||
logger.error(f"生成 {stock_name}({stock_code}) 的投资报告失败: {str(e)}")
|
||||
pdf_results.append({
|
||||
"code": stock_code,
|
||||
"name": stock_name,
|
||||
"status": "error",
|
||||
"error": str(e)
|
||||
})
|
||||
except Exception as e:
|
||||
logger.error(f"处理PDF生成请求失败: {str(e)}")
|
||||
pdf_results = []
|
||||
|
||||
# 应用企业画像筛选
|
||||
filtered_stocks = []
|
||||
if profile_filter:
|
||||
try:
|
||||
# 导入企业筛选器
|
||||
try:
|
||||
from src.fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError:
|
||||
try:
|
||||
from fundamentals_llm.enterprise_screener import EnterpriseScreener
|
||||
except ImportError as e:
|
||||
logger.error(f"无法导入企业筛选器模块: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"服务器配置错误: 企业筛选器模块不可用,错误详情: {str(e)}"
|
||||
}), 500
|
||||
|
||||
# 创建筛选器实例
|
||||
screener = EnterpriseScreener()
|
||||
|
||||
# 根据筛选类型获取推荐股票
|
||||
filter_type = profile_filter.get('type', 'custom')
|
||||
|
||||
# 如果是自定义条件筛选
|
||||
if filter_type == 'custom':
|
||||
conditions = profile_filter.get('conditions', [])
|
||||
if conditions:
|
||||
print(f"使用自定义条件筛选: {len(conditions)} 个条件")
|
||||
all_stocks = screener.screen_by_custom_conditions(conditions, limit=limit)
|
||||
else:
|
||||
# 如果没有提供条件,使用默认的high_growth类型
|
||||
print("未提供自定义条件,使用默认的high_growth类型")
|
||||
all_stocks = screener.screen_high_growth_stocks(limit=limit)
|
||||
# 如果是预定义类型
|
||||
else:
|
||||
# 直接使用type作为画像类型,如果用户同时提供了profile_name也兼容处理
|
||||
profile_name = profile_filter.get('profile_name', filter_type)
|
||||
|
||||
print(f"使用预定义画像类型: {profile_name}")
|
||||
|
||||
if profile_name == 'high_growth':
|
||||
all_stocks = screener.screen_high_growth_stocks(limit=limit)
|
||||
elif profile_name == 'stable_leaders':
|
||||
all_stocks = screener.screen_stable_leaders(limit=limit)
|
||||
elif profile_name == 'short_term':
|
||||
all_stocks = screener.screen_short_term_opportunities(limit=limit)
|
||||
elif profile_name == 'value_investment':
|
||||
all_stocks = screener.screen_value_investment_stocks(limit=limit)
|
||||
elif profile_name == 'turnaround':
|
||||
all_stocks = screener.screen_turnaround_opportunities(limit=limit)
|
||||
elif profile_name == 'risk_averse':
|
||||
all_stocks = screener.screen_risk_averse_stocks(limit=limit)
|
||||
elif profile_name == 'innovation' or profile_name == 'innovation_driven':
|
||||
all_stocks = screener.screen_innovation_driven_stocks(limit=limit)
|
||||
elif profile_name == 'integration' or profile_name == 'industry_integration':
|
||||
all_stocks = screener.screen_industry_integration_stocks(limit=limit)
|
||||
elif profile_name == 'recommended':
|
||||
all_stocks = screener.screen_multi_term_investment_stocks(limit=limit)
|
||||
else:
|
||||
# 如果类型无效,使用默认的high_growth类型
|
||||
logger.warning(f"无效的画像类型: {profile_name},使用默认的high_growth类型")
|
||||
all_stocks = screener.screen_high_growth_stocks(limit=limit)
|
||||
|
||||
# 获取传入的所有股票代码
|
||||
input_stock_codes = set(code for code, _ in stocks)
|
||||
|
||||
# 筛选出传入列表中符合条件的股票
|
||||
for code, name in all_stocks:
|
||||
if code in input_stock_codes:
|
||||
filtered_stocks.append({
|
||||
"code": code,
|
||||
"name": name
|
||||
})
|
||||
|
||||
logger.info(f"筛选出 {len(filtered_stocks)} 个符合条件的股票")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"应用企业画像筛选失败: {str(e)}")
|
||||
filtered_stocks = []
|
||||
|
||||
# 返回结果
|
||||
response = {
|
||||
"status": "success",
|
||||
"total_input_stocks": len(stocks),
|
||||
"investment_advices": investment_advices
|
||||
}
|
||||
|
||||
if profile_filter:
|
||||
response["filtered_stocks"] = {
|
||||
"count": len(filtered_stocks),
|
||||
"stocks": filtered_stocks
|
||||
}
|
||||
|
||||
if generate_pdf:
|
||||
response["pdf_results"] = {
|
||||
"count": len(pdf_results),
|
||||
"reports": pdf_results
|
||||
}
|
||||
|
||||
return jsonify(response)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"综合分析失败: {str(e)}")
|
||||
return jsonify({
|
||||
"status": "error",
|
||||
"message": f"综合分析失败: {str(e)}"
|
||||
}), 500
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=5000, debug=True)
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,501 @@
|
|||
序号,类别名称,示例原始数据
|
||||
1,光伏组件,"光伏组件、太阳能电池组件"
|
||||
2,光伏玻璃,"光伏玻璃、超白光伏玻璃"
|
||||
3,光伏支架,"光伏支架、光伏支架产品"
|
||||
4,光伏电池片,"光伏电池片、单晶电池片"
|
||||
5,光伏胶膜,"光伏胶膜、EVA胶膜"
|
||||
6,电力电缆,"电力电缆、电气装备用电线电缆"
|
||||
7,风电塔筒,"风电塔筒、风电产品"
|
||||
8,风电主轴,"风电主轴"
|
||||
9,锂电池,"锂电池、锂离子电池"
|
||||
10,动力电池系统,"动力电池系统、电动汽车类电池"
|
||||
11,储能电池,"储能电池、储能系统"
|
||||
12,煤炭,"煤炭、精煤"
|
||||
13,焦炭,"焦炭、冶金焦炭"
|
||||
14,天然气,"天然气、天然气销售"
|
||||
15,液化天然气(LNG),"液化天然气、LNG"
|
||||
16,蒸汽,"蒸汽、对外蒸汽销售"
|
||||
17,电力销售,"电力销售、售电收入"
|
||||
18,水力发电,"水力发电、调峰水电"
|
||||
19,热力,"热力、供热"
|
||||
20,电解铜,"电解铜、阴极铜"
|
||||
21,电池材料,"电池材料、锂电池材料"
|
||||
22,负极材料,"负极材料"
|
||||
23,正极材料,"正极材料、锂电池正极材料"
|
||||
24,电解液,"电解液、电解液添加剂"
|
||||
25,充电桩,"充电桩、充电服务"
|
||||
26,太阳能电池,"太阳能电池、电池片"
|
||||
27,电力设备,"电力设备、输变电产品"
|
||||
28,核电设备,"核电设备、核能设备"
|
||||
29,燃气发电,"燃气发电"
|
||||
30,生物质发电,"生物质发电、垃圾发电"
|
||||
31,燃料油,"燃料油销售、成品油销售"
|
||||
32,汽油,"汽油、0#柴油"
|
||||
33,柴油,"柴油"
|
||||
34,煤化工产品,"煤化工产品、煤化工收入"
|
||||
35,氢能产品,"氢能产品、氢气"
|
||||
36,电能表,"电能表、智能电表"
|
||||
37,变电站设备,"箱式变电站、环网柜"
|
||||
38,电力熔断器,"电力熔断器"
|
||||
39,铅酸电池,"铅酸电池、铅酸蓄电池"
|
||||
40,储能系统,"储能系统、储能设备"
|
||||
41,光伏电站,"光伏电站、光伏电站运营"
|
||||
42,风力发电,"风力发电、风电"
|
||||
43,油气开采,"油气开采、油气销售"
|
||||
44,绿色电力证书,"绿色电力证书收入"
|
||||
45,电力工程,"电力工程、电力工程建设"
|
||||
46,燃气设备,"燃气设备、燃气运营"
|
||||
47,热电产品,"热电、热电板块"
|
||||
48,抽水蓄能,"抽水蓄能"
|
||||
49,供电服务,"供电、供电业务"
|
||||
50,油田服务,"油田技术服务、钻井"
|
||||
51,氯化钾,"氯化钾、钾肥-氯化钾"
|
||||
52,烧碱,"烧碱、烧碱类"
|
||||
53,聚氯乙烯(PVC),"聚氯乙烯、PVC树脂"
|
||||
54,尿素,"尿素、氮肥产品"
|
||||
55,甲醇,"甲醇、甲醇贸易"
|
||||
56,铜箔,"铜箔、电解铜箔"
|
||||
57,铝箔,"铝箔、高端铝箔类"
|
||||
58,改性塑料,"改性塑料、其他改性塑料"
|
||||
59,橡胶助剂,"橡胶助剂、橡胶增塑剂"
|
||||
60,钛白粉,"钛白粉、金红石型钛白粉"
|
||||
61,硫酸,"硫酸、磷酸"
|
||||
62,纯碱,"纯碱、小苏打"
|
||||
63,磷酸,"磷酸、磷酸一铵"
|
||||
64,碳酸锂,"碳酸锂、锂盐"
|
||||
65,聚酯薄膜,"聚酯薄膜、聚酯产品"
|
||||
66,涤纶长丝,"涤纶长丝、FDY"
|
||||
67,化工原料,"化工原料、基础化工产品"
|
||||
68,精细化工产品,"精细化工产品、特种化学品"
|
||||
69,染料,"染料、活性染料"
|
||||
70,涂料,"涂料、防水涂料"
|
||||
71,胶黏剂,"胶黏剂、聚氨酯胶"
|
||||
72,硅片,"硅片、单晶硅片"
|
||||
73,氧化铝,"氧化铝、高纯铝"
|
||||
74,高分子材料,"高分子材料、高分子新材料"
|
||||
75,复合材料,"复合材料、碳纤维"
|
||||
76,钢材,"钢材、热轧板"
|
||||
77,铝合金,"铝合金、铝锭"
|
||||
78,锌精矿,"锌精矿、锌锭"
|
||||
79,铁精粉,"铁精粉、铁矿石"
|
||||
80,玻璃纤维,"玻璃纤维、玻璃钢制品"
|
||||
81,树脂,"树脂、不饱和聚酯树脂"
|
||||
82,水泥,"水泥、水泥制造业"
|
||||
83,商品混凝土,"商品混凝土、混凝土"
|
||||
84,覆铜板,"覆铜板"
|
||||
85,炭黑,"炭黑、白炭黑"
|
||||
86,聚氨酯,"聚氨酯、聚氨酯新材料"
|
||||
87,磷酸铁锂,"磷酸铁锂、磷酸铁"
|
||||
88,催化剂,"催化剂、脱硝催化剂"
|
||||
89,农药,"农药、除草剂"
|
||||
90,化肥,"化肥、新型复合肥"
|
||||
91,饲料添加剂,"饲料添加剂、酶制剂"
|
||||
92,表面活性剂,"表面活性剂、特种表面活性剂"
|
||||
93,塑料制品,"塑料制品、塑料件"
|
||||
94,包装材料,"包装材料、包装容器"
|
||||
95,黄金,"黄金、金锭"
|
||||
96,白银,"白银、银锭"
|
||||
97,铅产品,"铅产品、电解铅"
|
||||
98,钴产品,"钴产品、四氧化三钴"
|
||||
99,镍产品,"镍产品、镍中间品"
|
||||
100,稀土氧化物,"稀土氧化物"
|
||||
101,石英砂,"石英砂、高纯石英砂"
|
||||
102,工业气体,"工业气体"
|
||||
103,氢气,"氢气"
|
||||
104,氧气,"氧气"
|
||||
105,氩气,"氩气"
|
||||
106,硝酸,"硝酸"
|
||||
107,黄磷,"黄磷"
|
||||
108,丙烯,"丙烯、丙烯酸及酯"
|
||||
109,合成氨,"合成氨"
|
||||
110,钼精粉,"钼精粉"
|
||||
111,锡精粉,"锡精粉、锡锭"
|
||||
112,锰产品,"锰锭、电解金属锰"
|
||||
113,钒制品,"钒制品"
|
||||
114,锂云母精矿,"锂云母精矿"
|
||||
115,萤石,"高品位萤石块矿"
|
||||
116,无水氟化氢,"无水氟化氢、氟化氢"
|
||||
117,氟制冷剂,"氟制冷剂"
|
||||
118,苯酚,"酚酮相关产品"
|
||||
119,乙二醇,"乙二醇"
|
||||
120,双氧水,"双氧水"
|
||||
121,有机硅,"有机硅、有机硅产品"
|
||||
122,氯化铵,"氯化铵"
|
||||
123,工业盐,"工业盐"
|
||||
124,食用盐,"食用盐、小工业盐"
|
||||
125,元明粉,"元明粉"
|
||||
126,氨基酸,"饲料氨基酸、赖氨酸"
|
||||
127,维生素,"维生素、B族维生素"
|
||||
128,石灰石,"石灰石"
|
||||
129,聚丙烯,"聚丙烯"
|
||||
130,聚醚,"聚醚、聚醚单体"
|
||||
131,糊树脂,"糊树脂、PPVC糊状树脂"
|
||||
132,甲烷氯化物,"甲烷氯化物"
|
||||
133,电石,"电石、BDO及电石"
|
||||
134,废盐渣,"废盐渣资源化利用处置"
|
||||
135,阻燃剂,"阻燃剂、阻燃剂及中间体"
|
||||
136,光刻胶,"光刻胶、光刻胶配套试剂"
|
||||
137,电子化学品,"电子化学品、电子材料产品"
|
||||
138,超净高纯试剂,"超净高纯试剂"
|
||||
139,合成香料,"合成香料、天然香料"
|
||||
140,润滑油,"润滑油、车用润滑油"
|
||||
141,尾气处理液,"尾气处理液"
|
||||
142,植物提取物,"植物提取物"
|
||||
143,生物柴油,"生物柴油"
|
||||
144,环保新材料,"环保新材料"
|
||||
145,全生物降解材料,"全生物降解材料产品"
|
||||
146,纤维板,"纤维板、刨花板"
|
||||
147,磁性材料,"磁性材料、钕铁硼"
|
||||
148,陶瓷材料,"陶瓷材料"
|
||||
149,电熔氧化锆,"电熔氧化锆"
|
||||
150,铸造改性材料,"铸造改性材料"
|
||||
151,化学药制剂,"化学药、化学制剂"
|
||||
152,中药制剂,"中药、中药饮片"
|
||||
153,原料药,"原料药、化学原料药"
|
||||
154,医药中间体,"医药中间体、中间体"
|
||||
155,诊断试剂,"诊断试剂、体外诊断试剂"
|
||||
156,医疗器械,"医疗器械、手术耗材"
|
||||
157,疫苗,"疫苗、流感疫苗"
|
||||
158,血液制品,"血液制品、人血白蛋白"
|
||||
159,抗生素,"抗生素、抗感染类"
|
||||
160,抗肿瘤药物,"抗肿瘤药物、抗肿瘤类产品"
|
||||
161,保健品,"保健品、功能性保健品"
|
||||
162,兽药,"兽药、禽用疫苗"
|
||||
163,注射剂,"注射剂、大输液"
|
||||
164,片剂,"片剂"
|
||||
165,胶囊,"胶囊、软胶囊"
|
||||
166,软膏,"膏剂、软膏"
|
||||
167,输液,"输液、冻干粉针剂"
|
||||
168,生物制品,"生物制品、重组蛋白"
|
||||
169,中药材,"中药材、参茸滋补药材"
|
||||
170,医疗服务,"医疗服务、诊疗服务"
|
||||
171,检测服务,"检测服务、医学诊断服务"
|
||||
172,康复器械,"康复器械、伤口护理类"
|
||||
173,耗材,"耗材、注射器"
|
||||
174,试剂,"试剂、试剂销售"
|
||||
175,药用辅料,"药用辅料"
|
||||
176,妇科用药,"妇科用药"
|
||||
177,补益用药,"补益用药"
|
||||
178,肾病药物,"肾病及免疫调节类"
|
||||
179,肠外营养药物,"肠外营养类"
|
||||
180,麻醉药物,"麻醉系列"
|
||||
181,导尿产品,"导尿类"
|
||||
182,呼吸系统药物,"呼吸系统药物、呼吸系统用药"
|
||||
183,消化系统药物,"消化系统类、消化类"
|
||||
184,泌尿系统药物,"泌尿系统类"
|
||||
185,抗菌药物,"抗菌类"
|
||||
186,痛风药物,"痛风类"
|
||||
187,肝病药物,"肝病类"
|
||||
188,喹诺酮,"喹诺酮"
|
||||
189,珍药商品,"珍药商品销售(工业)"
|
||||
190,外购药品,"外购药品销售(商业)"
|
||||
191,灵芝孢子粉,"灵芝孢子粉类产品"
|
||||
192,铁皮石斛,"铁皮石斛类产品"
|
||||
193,益生菌制品,"益生菌制品"
|
||||
194,消毒产品,"消毒清洁类"
|
||||
195,防护用品,"防护类、防护用品"
|
||||
196,创可贴,"创可贴、敷贴"
|
||||
197,药学研究服务,"药学研究服务、临床研究服务"
|
||||
198,医药批发,"医药批发、药品批发"
|
||||
199,医药零售,"药品零售、医药零售"
|
||||
200,医疗美容服务,"医疗美容、医疗美容服务"
|
||||
201,商品房,"商品房、商品房销售"
|
||||
202,房屋租赁,"房屋租赁、房产租赁"
|
||||
203,工程施工,"工程施工、建筑施工"
|
||||
204,钢结构,"钢结构、高端钢结构"
|
||||
205,物业管理,"物业管理、物业服务"
|
||||
206,建筑装饰,"建筑装饰、装饰工程"
|
||||
207,幕墙,"幕墙、幕墙工程"
|
||||
208,门窗,"门窗、定制木门"
|
||||
209,瓷砖,"瓷砖"
|
||||
210,地板,"地板、锁扣地板"
|
||||
211,防水材料,"防水材料、防水卷材"
|
||||
212,砂石,"砂石、砂石骨料"
|
||||
213,混凝土外加剂,"混凝土外加剂"
|
||||
214,园林绿化,"园林绿化、园林工程"
|
||||
215,市政工程,"市政工程、市政环卫"
|
||||
216,玻璃门体,"玻璃门体"
|
||||
217,装配式装修,"装配式装修"
|
||||
218,整体卫浴,"整体卫浴"
|
||||
219,建筑材料,"建筑材料、建材"
|
||||
220,管道管件,"PE管材管件、PPR管材管件"
|
||||
221,保温材料,"保温产品"
|
||||
222,声屏障系统,"声屏障系统"
|
||||
223,金属围护系统,"金属围护系统"
|
||||
224,建筑光伏一体化,"建筑光伏一体化"
|
||||
225,石膏板,"石膏护面纸"
|
||||
226,预应力机械,"预应力机械"
|
||||
227,养护工程,"养护工程施工"
|
||||
228,周转材料,"周转材料及设备租赁销售"
|
||||
229,地基处理,"地基处理"
|
||||
230,桩基工程,"桩基及围护业务"
|
||||
231,路桥工程,"路桥工程施工"
|
||||
232,房屋销售,"房屋销售、住宅销售"
|
||||
233,商业租赁,"商业租赁、商业物业出租"
|
||||
234,投资物业,"投资物业及相关服务"
|
||||
235,园区租赁,"园区租赁、园区物业租赁"
|
||||
236,写字楼出租,"写字楼出租"
|
||||
237,大厦出租,"大厦出租"
|
||||
238,商铺租赁,"商铺租赁、商铺及车位"
|
||||
239,物业开发,"物业开发与销售"
|
||||
240,公路养护,"公路养护决策咨询"
|
||||
241,上衣,"上衣、衬衫、T恤"
|
||||
242,裤子,"裤子、西裤、男裤"
|
||||
243,外套,"外套、茄克"
|
||||
244,鞋类,"鞋类、皮鞋、男鞋"
|
||||
245,内衣,"内衣、文胸"
|
||||
246,童装,"童装、婴童服饰"
|
||||
247,白酒,"白酒、高档白酒"
|
||||
248,啤酒,"啤酒、啤酒酿造设备"
|
||||
249,葡萄酒,"葡萄酒、有机葡萄酒"
|
||||
250,饮料,"饮料、功能饮品"
|
||||
251,乳制品,"乳制品、液体乳"
|
||||
252,肉制品,"肉制品、泡椒凤爪"
|
||||
253,食品添加剂,"食品添加剂、味精"
|
||||
254,调味品,"调味品、酱油"
|
||||
255,糕点,"糕点、面包"
|
||||
256,休闲食品,"休闲食品、炒货"
|
||||
257,化妆品,"化妆品、护肤系列"
|
||||
258,洗护用品,"洗护用品、香皂"
|
||||
259,家电,"家电、消费电子"
|
||||
260,空调,"空调、空调器"
|
||||
261,冰箱,"冰箱、电冰箱"
|
||||
262,洗衣机,"洗衣机"
|
||||
263,电视机,"电视机、彩电"
|
||||
264,小家电,"小家电、电动剃须刀"
|
||||
265,家具,"家具、休闲家具"
|
||||
266,沙发,"沙发、功能沙发"
|
||||
267,床垫,"床垫、记忆绵床垫"
|
||||
268,橱柜,"橱柜、整体厨柜"
|
||||
269,珠宝首饰,"珠宝首饰、K金珠宝类"
|
||||
270,日用百货,"日用百货、商品百货"
|
||||
271,纸制品,"纸制品、生活用纸"
|
||||
272,卫生陶瓷,"卫生陶瓷"
|
||||
273,包装容器,"包装容器、二片罐"
|
||||
274,宠物食品,"宠物食品、宠物零食"
|
||||
275,文具,"文具、教育装备"
|
||||
276,玩具,"玩具、益智玩具"
|
||||
277,香精,"香精、食用香精"
|
||||
278,烟草制品,"烟标、卷烟商标"
|
||||
279,茶叶,"茶叶、茶叶及调味品"
|
||||
280,食用油,"食用油、植物油"
|
||||
281,面粉,"面粉"
|
||||
282,速冻食品,"速冻调制食品、速冻面米制品"
|
||||
283,冷饮,"冷饮产品系列"
|
||||
284,咖啡制品,"咖啡制品"
|
||||
285,粽子,"粽子系列"
|
||||
286,蛋制品,"蛋制品"
|
||||
287,水刺非织造布,"水刺非织造材料制品"
|
||||
288,墙布,"墙布、窗帘及相关产品"
|
||||
289,皮革制品,"皮革产品、皮具"
|
||||
290,毛巾,"湿巾"
|
||||
291,被芯,"被芯"
|
||||
292,枕芯,"枕芯"
|
||||
293,婴童护理产品,"婴童护理系列产品"
|
||||
294,驱蚊产品,"驱蚊系列产品"
|
||||
295,精油,"精油系列产品"
|
||||
296,按摩椅,"按摩椅、按摩椅椅身"
|
||||
297,办公椅,"办公椅"
|
||||
298,休闲椅,"休闲椅"
|
||||
299,电动床,"电动床"
|
||||
300,晾衣架,"晾衣架产品"
|
||||
301,厨卫电器,"厨卫电器、集成灶"
|
||||
302,水家电,"水家电"
|
||||
303,智能坐便盖,"智能坐便盖"
|
||||
304,浴室柜,"浴室柜"
|
||||
305,五金洁具,"五金洁具"
|
||||
306,面包机,"空气炸锅、空气烤箱"
|
||||
307,油炸锅,"油炸锅"
|
||||
308,吸尘器,"高效分离吸尘器"
|
||||
309,扫地机器人,"智能扫地机器人"
|
||||
310,电动牙刷,"电动牙刷"
|
||||
311,电吹风,"电吹风"
|
||||
312,鼻毛器,"鼻毛器"
|
||||
313,电动理发器,"电动理发器"
|
||||
314,消毒柜,"商用展示柜"
|
||||
315,西厨设备,"西厨设备"
|
||||
316,自助餐设备,"自助餐设备"
|
||||
317,商用制冷设备,"商用餐饮制冷设备"
|
||||
318,木门,"木门、模压门"
|
||||
319,桌椅,"桌几类、椅架类"
|
||||
320,床组,"床组类"
|
||||
321,高档酒,"高档酒"
|
||||
322,中档酒,"中档酒"
|
||||
323,普通酒,"普通酒"
|
||||
324,果汁,"苹果清汁、梨汁"
|
||||
325,矿泉水,"矿泉水"
|
||||
326,蜂蜜,"蜜饯及果蔬"
|
||||
327,酱腌菜,"竹笋"
|
||||
328,鸡翅,"鸡翅"
|
||||
329,猪皮晶,"猪皮晶"
|
||||
330,火腿,"火腿、火腿及其制品"
|
||||
331,冲泡饮品,"冲泡类"
|
||||
332,即饮饮品,"即饮类"
|
||||
333,餐食,"餐食系列"
|
||||
334,糖制品,"糖制品及食品"
|
||||
335,膨化食品,"膨化食品"
|
||||
336,豆制品,"豆制品"
|
||||
337,高强瓦楞纸,"高强瓦楞纸"
|
||||
338,涂布白板纸,"涂布白板纸"
|
||||
339,双胶纸,"双胶纸"
|
||||
340,白卡纸,"白卡纸"
|
||||
341,汽车零部件,"汽车零部件、配件"
|
||||
342,轮胎,"轮胎、半钢轮胎"
|
||||
343,整车,"整车、乘用车"
|
||||
344,车灯,"车灯、汽车照明"
|
||||
345,汽车电子,"汽车电子、汽车电子产品"
|
||||
346,刹车片,"刹车片"
|
||||
347,减震器,"减震器、汽车减震器"
|
||||
348,发动机,"发动机、销售发动机"
|
||||
349,变速器,"变速器、汽车变速器"
|
||||
350,轮毂,"轮毂、轮毂组件"
|
||||
351,座椅,"座椅、车辆座椅"
|
||||
352,电池托盘,"电池托盘、汽车电池托盘"
|
||||
353,内饰件,"内饰件、内饰功能件"
|
||||
354,外饰件,"外饰件、内外饰件"
|
||||
355,汽车玻璃,"汽车玻璃"
|
||||
356,轴承,"轴承、轴承保持架"
|
||||
357,齿轮,"齿轮、汽车齿轮"
|
||||
358,密封件,"密封件、橡胶密封件"
|
||||
359,汽车空调,"汽车空调、汽车空调压缩机"
|
||||
360,线束,"线束、汽车线束"
|
||||
361,汽车传感器,"汽车传感器"
|
||||
362,涡轮壳,"涡轮壳、涡轮壳及其装配件"
|
||||
363,中间壳,"中间壳、中间壳及其装配件"
|
||||
364,同步器总成,"同步器总成"
|
||||
365,差速器,"差速器"
|
||||
366,结合齿,"结合齿"
|
||||
367,汽车视镜,"汽车视镜"
|
||||
368,保险杠,"汽车保险杠"
|
||||
369,汽车声学产品,"汽车声学产品"
|
||||
370,车轮总成,"车轮总成分装"
|
||||
371,油泵,"发动机油泵、输油泵"
|
||||
372,凸轮轴,"凸轮轴"
|
||||
373,变速箱油泵,"变速箱油泵"
|
||||
374,分动箱油泵,"分动箱油泵"
|
||||
375,悬架系统,"悬架系统零部件、空气悬架"
|
||||
376,踏板总成,"踏板总成"
|
||||
377,连杆,"连杆"
|
||||
378,气门嘴,"气门嘴"
|
||||
379,TPMS,"TPMS"
|
||||
380,汽车金属管件,"汽车金属管件"
|
||||
381,驱动系统,"驱动系统类"
|
||||
382,车载电源,"车载电源集成产品"
|
||||
383,DC/DC变换器,"车载DC/DC变换器"
|
||||
384,燃料分配管,"燃油分配管"
|
||||
385,空调管路,"汽车空调管路"
|
||||
386,万向节,"万向节"
|
||||
387,锻铝控制臂,"锻铝控制臂"
|
||||
388,汽车连接器,"汽车连接器"
|
||||
389,热交换系统,"汽车热交换系统管路及附件"
|
||||
390,EGR冷却器,"汽车废气再循环(EGR)冷却器零部件"
|
||||
391,集成电路,"集成电路、芯片"
|
||||
392,软件开发,"软件开发、定制软件"
|
||||
393,系统集成,"系统集成、智能制造系统"
|
||||
394,显示模组,"显示模组、液晶显示模组"
|
||||
395,传感器,"传感器、汽车传感器"
|
||||
396,LED芯片,"LED芯片、LED"
|
||||
397,印刷电路板(PCB),"印刷电路板、PCB"
|
||||
398,电容器,"电容器、电力电容器"
|
||||
399,电阻器,"电阻器"
|
||||
400,继电器,"继电器、继电器产品"
|
||||
401,变压器,"变压器、油浸式变压器"
|
||||
402,控制器,"控制器、智能控制器"
|
||||
403,智能终端,"智能终端、智能终端产品"
|
||||
404,通信设备,"通信设备、通讯类产品"
|
||||
405,光纤光缆,"光纤光缆、光缆"
|
||||
406,电源适配器,"电源适配器、LED驱动电源"
|
||||
407,存储设备,"存储设备、固态硬盘"
|
||||
408,消费电子,"消费电子、消费电子产品"
|
||||
409,手机,"手机、智能手机"
|
||||
410,平板电脑,"平板电脑"
|
||||
411,智能家居,"智能家居、智能家居产品"
|
||||
412,机器人,"机器人、服务机器人"
|
||||
413,无人机,"无人机、智能无人飞行器"
|
||||
414,云服务,"云服务、云计算"
|
||||
415,网络安全产品,"网络安全产品、信息安全产品"
|
||||
416,数据中心设备,"数据中心产品、IDC服务"
|
||||
417,半导体材料,"半导体材料、半导体硅片"
|
||||
418,电子元器件,"电子元器件、自产被动元器件"
|
||||
419,光学元件,"光学元件、光学组件"
|
||||
420,激光器,"激光器"
|
||||
421,检测设备,"检测设备、智能检测设备"
|
||||
422,自动化设备,"自动化设备、工业自动化设备"
|
||||
423,仪器仪表,"仪器仪表、专业仪表"
|
||||
424,智能电表,"智能电表、用电信息采集终端"
|
||||
425,光伏设备,"光伏设备、光伏专用设备"
|
||||
426,电池管理系统,"电池管理系统"
|
||||
427,充电器,"充电器"
|
||||
428,电线电缆,"电线电缆、裸电线"
|
||||
429,开关设备,"开关设备、成套开关设备"
|
||||
430,连接器,"连接器、射频同轴连接器"
|
||||
431,背光模组,"背光模组、背光显示模组"
|
||||
432,触摸屏,"电容式触摸屏"
|
||||
433,功率器件,"功率器件、功率IC"
|
||||
434,分立器件,"分立器件"
|
||||
435,NOR Flash,"NORFlash产品"
|
||||
436,微波器件,"微波器件"
|
||||
437,电解液添加剂,"电解液添加剂"
|
||||
438,液晶显示屏,"液晶显示屏及模块"
|
||||
439,智能卡,"智能卡"
|
||||
440,信号链芯片,"信号链芯片"
|
||||
441,红外热像仪,"红外热像仪"
|
||||
442,视频监控系统,"视频监控系统"
|
||||
443,音频设备,"电声器材及扬声器"
|
||||
444,智能头显,"智能头显与智能穿戴类"
|
||||
445,无线通信模组,"无线通信模组"
|
||||
446,基站天线,"基站天线"
|
||||
447,嵌入式计算平台,"嵌入式与融合计算平台"
|
||||
448,网络可视化设备,"网络可视化基础架构"
|
||||
449,轨道扣件,"轨道扣件"
|
||||
450,高频头,"高频头及相关配件"
|
||||
451,射频电缆,"射频电缆类产品"
|
||||
452,显示器件,"显示器件、光电显示器件"
|
||||
453,触控模组,"触控显示模组"
|
||||
454,虚拟现实产品,"虚拟现实产品"
|
||||
455,专业视听产品,"专业视听产品"
|
||||
456,照明应用产品,"照明应用产品及相关"
|
||||
457,电子制造服务,"电子制造服务"
|
||||
458,光传输设备,"光传输设备"
|
||||
459,ODN设备,"ODN网络物理连接及保护设备"
|
||||
460,屏蔽罩,"手机精密屏蔽罩及结构件"
|
||||
461,精密连接器,"精密连接器及组件"
|
||||
462,模具治具,"模具治具"
|
||||
463,智能检测分选设备,"智能检测分选装备"
|
||||
464,智能包装设备,"智能包装装备"
|
||||
465,软管配件,"清洁电器软管及配件"
|
||||
466,清洁电器整机,"清洁电器整机"
|
||||
467,刀具产品,"刀具产品"
|
||||
468,滑轨,"滑轨"
|
||||
469,电能计量箱,"电能计量箱"
|
||||
470,智能水表,"智能水表"
|
||||
471,膜式燃气表,"膜式燃气表"
|
||||
472,点胶设备,"点胶设备"
|
||||
473,特种光纤,"特种光纤"
|
||||
474,光学膜,"光学膜"
|
||||
475,功能件,"功能件"
|
||||
476,墙板,"墙板"
|
||||
477,行业专机,"行业专机"
|
||||
478,传输类设备,"传输类设备"
|
||||
479,宽带网络设备,"宽带网络类设备"
|
||||
480,油气类商品,"油气类商品"
|
||||
481,游戏,"游戏、移动网络游戏"
|
||||
482,数字内容,"数字内容"
|
||||
483,数字营销服务,"数字营销服务、全域数字营销"
|
||||
484,视频会议系统,"视频会议系统"
|
||||
485,公共安全产品,"公共安全产品"
|
||||
486, sedia,"电子商务、电商代运营"
|
||||
487,平板显示设备,"平板显示模组设备"
|
||||
488,物联网产品,"物联网产品"
|
||||
489,AI视频平台,"AI视频大数据平台"
|
||||
490,融合媒体平台,"融合媒体运营平台项目"
|
||||
491,工程机械,"工程机械、土方机械"
|
||||
492,农业机械,"农业机械"
|
||||
493,数控机床,"数控机床、机床"
|
||||
494,压缩机,"压缩机、压缩机(组)"
|
||||
495,泵类,"泵类、水泵"
|
||||
496,阀门,"阀门、闸阀"
|
||||
497,电机,"电机、直驱轮毂电机"
|
||||
498,铸件,"铸件、其他铸件"
|
||||
499,模具,"模具、精密模具"
|
||||
500,精密零件,"精密零件、精密结构件"
|
|
|
@ -0,0 +1,656 @@
|
|||
光伏组件
|
||||
光伏玻璃
|
||||
光伏支架
|
||||
光伏电池片
|
||||
光伏胶膜
|
||||
电力电缆
|
||||
风电塔筒
|
||||
风电主轴
|
||||
锂电池
|
||||
动力电池系统
|
||||
储能电池
|
||||
煤炭
|
||||
焦炭
|
||||
天然气
|
||||
液化天然气(LNG)
|
||||
蒸汽
|
||||
电力销售
|
||||
水力发电
|
||||
热力
|
||||
电解铜
|
||||
锂电池核心材料
|
||||
锂盐及化合物
|
||||
电池材料-三元与前驱体材料
|
||||
电池材料-电池隔膜与膜材料
|
||||
电池材料-磷酸铁及其衍生材料
|
||||
电池材料-导电与包覆材料
|
||||
电池材料-其他新能源材料
|
||||
电池材料-特殊电池材料
|
||||
电池材料-金属及合金材料
|
||||
负极材料
|
||||
正极材料
|
||||
电解液
|
||||
充电桩
|
||||
太阳能电池
|
||||
核电设备
|
||||
输配电设备
|
||||
变压器与电抗器
|
||||
电机与驱动系统
|
||||
发电设备与配件
|
||||
电源与电能质量设备
|
||||
配用电自动化与智能电网
|
||||
压力容器与换热设备
|
||||
新能源与清洁能源设备
|
||||
智能电控与监测系统
|
||||
风机与通风设备
|
||||
电工与配电电器
|
||||
绝缘子与电瓷产品
|
||||
轨道交通电力设备
|
||||
工业专用设备
|
||||
电梯与相关设备
|
||||
电气成套与高低压设备
|
||||
其他电力设备与服务
|
||||
有机化工中间体
|
||||
功能性助剂
|
||||
特种化学品
|
||||
染料与颜料中间体
|
||||
油墨与涂料化学品
|
||||
民爆化学品
|
||||
表面活性剂与乳化剂
|
||||
水处理与净水剂
|
||||
含氟化学品
|
||||
定制软件开发
|
||||
企业管理软件
|
||||
行业应用软件
|
||||
大数据与智能分析软件
|
||||
人工智能软件
|
||||
技术开发与服务
|
||||
软件销售与维护
|
||||
智慧城市与政务软件
|
||||
金融与商业软件
|
||||
移动互联网与SaaS服务
|
||||
图形与多媒体软件
|
||||
工业与制造软件
|
||||
教育与办公软件
|
||||
软件基础设施与中间件
|
||||
其他软件开发与服务
|
||||
聚合物添加剂
|
||||
纺织与皮革助剂
|
||||
医药与化妆品化学品
|
||||
农药与植保化学品
|
||||
油脂与润滑化学品
|
||||
新材料化学品
|
||||
酸酐与酯类化合物
|
||||
其他精细化工产品
|
||||
电能计量与校验设备
|
||||
燃气发电
|
||||
生物质发电
|
||||
燃料油
|
||||
汽油
|
||||
柴油
|
||||
煤化工产品
|
||||
氢能产品
|
||||
电能表
|
||||
变电站设备
|
||||
电力熔断器
|
||||
铅酸电池
|
||||
储能系统
|
||||
光伏电站
|
||||
风力发电
|
||||
油气开采
|
||||
绿色电力证书
|
||||
工程总承包与EPC
|
||||
工程设计与咨询
|
||||
新能源工程服务
|
||||
电力安装与维护
|
||||
其他电力工程服务
|
||||
燃气设备
|
||||
热电产品
|
||||
抽水蓄能
|
||||
供电服务
|
||||
油田服务
|
||||
环境监测设备
|
||||
工业检测与测试设备
|
||||
汽车与新能源检测设备
|
||||
科学分析与实验室仪器
|
||||
其他检测设备
|
||||
钾系列产品
|
||||
烧碱
|
||||
聚氯乙烯(PVC)
|
||||
尿素
|
||||
甲醇
|
||||
铜箔
|
||||
铝箔
|
||||
改性塑料
|
||||
橡胶助剂
|
||||
钛白粉
|
||||
硫酸
|
||||
纯碱
|
||||
磷酸
|
||||
碳酸锂
|
||||
聚酯薄膜
|
||||
涤纶长丝
|
||||
染料
|
||||
涂料
|
||||
胶黏剂
|
||||
硅片
|
||||
氧化铝
|
||||
合成橡胶与弹性体
|
||||
聚烯烃与塑料制品
|
||||
化学纤维与纺织材料
|
||||
功能性膜与薄膜材料
|
||||
电缆与绝缘材料
|
||||
特种高分子与新材料
|
||||
其他高分子制品
|
||||
碳纤维与纤维复合材料
|
||||
金属基复合材料
|
||||
硬质合金与超硬材料
|
||||
其他复合材料制品
|
||||
钢材
|
||||
铝合金
|
||||
锌精矿
|
||||
铁精粉
|
||||
玻璃纤维
|
||||
树脂
|
||||
水泥
|
||||
商品混凝土
|
||||
覆铜板
|
||||
炭黑
|
||||
聚氨酯
|
||||
磷酸铁锂
|
||||
催化剂
|
||||
农药
|
||||
化肥
|
||||
饲料添加剂
|
||||
表面活性剂
|
||||
塑料制品
|
||||
包装材料
|
||||
黄金
|
||||
白银
|
||||
铅产品
|
||||
钴产品
|
||||
镍产品
|
||||
稀土氧化物
|
||||
石英砂
|
||||
工业气体
|
||||
氢气
|
||||
氧气
|
||||
氩气
|
||||
硝酸
|
||||
黄磷
|
||||
丙烯
|
||||
合成氨
|
||||
钼精粉
|
||||
锡精粉
|
||||
锰产品
|
||||
钒制品
|
||||
锂云母精矿
|
||||
萤石
|
||||
无水氟化氢
|
||||
氟制冷剂
|
||||
苯酚
|
||||
乙二醇
|
||||
双氧水
|
||||
有机硅
|
||||
氯化铵
|
||||
工业盐
|
||||
食用盐
|
||||
元明粉
|
||||
氨基酸
|
||||
维生素
|
||||
石灰石
|
||||
聚丙烯
|
||||
聚醚
|
||||
糊树脂
|
||||
甲烷氯化物
|
||||
电石
|
||||
废盐渣
|
||||
阻燃剂
|
||||
光刻胶
|
||||
电子化学品
|
||||
超净高纯试剂
|
||||
合成香料
|
||||
润滑油
|
||||
尾气处理液
|
||||
植物提取物
|
||||
生物柴油
|
||||
环保新材料
|
||||
全生物降解材料
|
||||
纤维板
|
||||
磁性材料
|
||||
陶瓷材料
|
||||
电熔氧化锆
|
||||
铸造改性材料
|
||||
化学药制剂
|
||||
中药制剂
|
||||
原料药
|
||||
医药中间体
|
||||
诊断试剂
|
||||
医疗器械
|
||||
疫苗
|
||||
血液制品
|
||||
抗生素
|
||||
抗肿瘤药物
|
||||
保健品
|
||||
兽药
|
||||
注射剂
|
||||
片剂
|
||||
胶囊
|
||||
软膏
|
||||
输液
|
||||
生物制品
|
||||
中药材
|
||||
检验与测试服务
|
||||
智慧医疗与数字健康
|
||||
眼科诊疗服务
|
||||
健康管理与体检服务
|
||||
临床研究与专科服务
|
||||
其他医疗服务
|
||||
环境监测与治理服务
|
||||
医学与生物检测服务
|
||||
汽车与工业品检测
|
||||
电子与半导体检测
|
||||
工程与技术咨询服务
|
||||
其他检测服务
|
||||
无线通信与网络设备
|
||||
光通信与接入设备
|
||||
卫星与专网通信
|
||||
通信终端与组件
|
||||
康复器械
|
||||
耗材
|
||||
试剂
|
||||
药用辅料
|
||||
妇科用药
|
||||
补益用药
|
||||
肾病药物
|
||||
肠外营养药物
|
||||
麻醉药物
|
||||
导尿产品
|
||||
呼吸系统药物
|
||||
消化系统药物
|
||||
泌尿系统药物
|
||||
抗菌药物
|
||||
痛风药物
|
||||
肝病药物
|
||||
喹诺酮
|
||||
珍药商品
|
||||
外购药品
|
||||
灵芝孢子粉
|
||||
铁皮石斛
|
||||
益生菌制品
|
||||
消毒产品
|
||||
防护用品
|
||||
创可贴
|
||||
药学研究服务
|
||||
医药批发
|
||||
医药零售
|
||||
医疗美容服务
|
||||
商品房
|
||||
房屋租赁
|
||||
工程施工
|
||||
钢结构
|
||||
物业管理
|
||||
建筑装饰
|
||||
幕墙
|
||||
门窗
|
||||
瓷砖
|
||||
地板
|
||||
防水材料
|
||||
砂石
|
||||
混凝土外加剂
|
||||
园林绿化
|
||||
市政工程
|
||||
玻璃门体
|
||||
装配式装修
|
||||
整体卫浴
|
||||
建筑材料
|
||||
管道管件
|
||||
保温材料
|
||||
声屏障系统
|
||||
金属围护系统
|
||||
建筑光伏一体化
|
||||
石膏板
|
||||
预应力机械
|
||||
养护工程
|
||||
周转材料
|
||||
地基处理
|
||||
桩基工程
|
||||
路桥工程
|
||||
房屋销售
|
||||
商业租赁
|
||||
投资物业
|
||||
园区租赁
|
||||
写字楼出租
|
||||
大厦出租
|
||||
商铺租赁
|
||||
物业开发
|
||||
公路养护
|
||||
上衣
|
||||
裤子
|
||||
外套
|
||||
鞋类
|
||||
内衣
|
||||
童装
|
||||
白酒
|
||||
啤酒
|
||||
葡萄酒
|
||||
饮料
|
||||
乳制品
|
||||
肉制品
|
||||
食品添加剂
|
||||
调味品
|
||||
糕点
|
||||
休闲食品
|
||||
化妆品
|
||||
洗护用品
|
||||
家电
|
||||
空调
|
||||
冰箱
|
||||
洗衣机
|
||||
电视机
|
||||
小家电
|
||||
家具
|
||||
沙发
|
||||
床垫
|
||||
橱柜
|
||||
珠宝首饰
|
||||
日用百货
|
||||
纸制品
|
||||
卫生陶瓷
|
||||
包装容器
|
||||
宠物食品
|
||||
文具
|
||||
玩具
|
||||
香精
|
||||
烟草制品
|
||||
茶叶
|
||||
食用油
|
||||
面粉
|
||||
速冻食品
|
||||
冷饮
|
||||
咖啡制品
|
||||
粽子
|
||||
蛋制品
|
||||
水刺非织造布
|
||||
墙布
|
||||
皮革制品
|
||||
毛巾
|
||||
被芯
|
||||
枕芯
|
||||
婴童护理产品
|
||||
驱蚊产品
|
||||
精油
|
||||
按摩椅
|
||||
办公椅
|
||||
休闲椅
|
||||
电动床
|
||||
晾衣架
|
||||
厨卫电器
|
||||
水家电
|
||||
智能坐便盖
|
||||
浴室柜
|
||||
五金洁具
|
||||
面包机
|
||||
油炸锅
|
||||
吸尘器
|
||||
扫地机器人
|
||||
电动牙刷
|
||||
电吹风
|
||||
鼻毛器
|
||||
电动理发器
|
||||
消毒柜
|
||||
西厨设备
|
||||
自助餐设备
|
||||
商用制冷设备
|
||||
木门
|
||||
桌椅
|
||||
床组
|
||||
高档酒
|
||||
中档酒
|
||||
普通酒
|
||||
果汁
|
||||
矿泉水
|
||||
蜂蜜
|
||||
酱腌菜
|
||||
鸡翅
|
||||
猪皮晶
|
||||
火腿
|
||||
冲泡饮品
|
||||
即饮饮品
|
||||
餐食
|
||||
糖制品
|
||||
膨化食品
|
||||
豆制品
|
||||
高强瓦楞纸
|
||||
涂布白板纸
|
||||
双胶纸
|
||||
白卡纸
|
||||
底盘与悬架系统
|
||||
制动系统零部件
|
||||
传动系统零部件
|
||||
发动机与动力系统
|
||||
热管理与冷却系统
|
||||
电气与电控系统
|
||||
内饰与座椅系统
|
||||
外饰与车身部件
|
||||
轮毂与轮胎系统
|
||||
安全系统零部件
|
||||
空调与环境系统
|
||||
燃油与流体系统
|
||||
轻量化与结构件
|
||||
后处理与进气系统
|
||||
转向与操控系统
|
||||
整车与专用车辆
|
||||
配件与服务
|
||||
其他汽车零部件
|
||||
轮胎
|
||||
整车
|
||||
车灯
|
||||
汽车电子
|
||||
刹车片
|
||||
减震器
|
||||
发动机
|
||||
变速器
|
||||
轮毂
|
||||
座椅
|
||||
电池托盘
|
||||
内饰件
|
||||
外饰件
|
||||
汽车玻璃
|
||||
轴承
|
||||
齿轮
|
||||
密封件
|
||||
汽车空调
|
||||
线束
|
||||
汽车传感器
|
||||
涡轮壳
|
||||
中间壳
|
||||
同步器总成
|
||||
差速器
|
||||
结合齿
|
||||
汽车视镜
|
||||
保险杠
|
||||
汽车声学产品
|
||||
车轮总成
|
||||
油泵
|
||||
凸轮轴
|
||||
变速箱油泵
|
||||
分动箱油泵
|
||||
悬架系统
|
||||
踏板总成
|
||||
连杆
|
||||
气门嘴
|
||||
TPMS
|
||||
汽车金属管件
|
||||
驱动系统
|
||||
车载电源
|
||||
DC/DC变换器
|
||||
燃料分配管
|
||||
空调管路
|
||||
万向节
|
||||
锻铝控制臂
|
||||
汽车连接器
|
||||
热交换系统
|
||||
EGR冷却器
|
||||
工业机器人与自动化系统
|
||||
智能物流与仓储设备
|
||||
激光与精密加工装备
|
||||
锂电池智能制造设备
|
||||
新能源汽车自动化装备
|
||||
传统汽车智能制造装备
|
||||
通用工业自动化设备
|
||||
运动控制与伺服系统
|
||||
智能输送与装配生产线
|
||||
电子与半导体自动化设备
|
||||
智能装备核心部件
|
||||
其他行业专用自动化设备
|
||||
处理器与智能芯片
|
||||
电源管理与功率芯片
|
||||
存储与通信芯片
|
||||
其他集成电路产品
|
||||
精密机械零部件
|
||||
精密金属结构件
|
||||
航空航天精密零件
|
||||
传动系统精密件
|
||||
紧固件与连接件
|
||||
锻件与冷锻零件
|
||||
压缩机与液压精密零件
|
||||
减速器及其配件
|
||||
机床与刀具零件
|
||||
粉末冶金与MIM零件
|
||||
其他精密加工件
|
||||
显示模组
|
||||
行业解决方案与系统集成
|
||||
智慧城市与交通系统
|
||||
智能制造与工业自动化
|
||||
建筑智能化系统
|
||||
IT基础设施与服务
|
||||
金融与支付系统集成
|
||||
大数据与物联网解决方案
|
||||
轨道交通与仿真系统
|
||||
政务与公共服务系统
|
||||
智能监控与指挥系统
|
||||
数字化转型与企业应用
|
||||
智慧医疗与教育系统
|
||||
网络安全与信息工程
|
||||
其他系统集成服务
|
||||
传感器
|
||||
LED芯片
|
||||
印刷电路板(PCB)
|
||||
电容器
|
||||
电阻器
|
||||
继电器
|
||||
变压器
|
||||
控制器
|
||||
智能终端
|
||||
光纤光缆
|
||||
电源适配器
|
||||
存储设备
|
||||
消费电子
|
||||
手机
|
||||
平板电脑
|
||||
智能家居
|
||||
机器人
|
||||
无人机
|
||||
云服务
|
||||
网络安全产品
|
||||
数据中心设备
|
||||
半导体材料
|
||||
光学元件
|
||||
被动元器件
|
||||
连接器与继电器
|
||||
光电与显示器件
|
||||
功率与电源管理器件
|
||||
传感器与执行器
|
||||
其他电子元器件
|
||||
激光器
|
||||
芳烃与烯烃类原料
|
||||
无机化工原料
|
||||
有机化工原料
|
||||
氯碱与氟化工原料
|
||||
磷化工与矿石原料
|
||||
石化与炼化产品
|
||||
粘胶与聚酯原料
|
||||
金属化工原料
|
||||
其他化工原料
|
||||
仪器仪表
|
||||
智能电表
|
||||
光伏设备
|
||||
电池管理系统
|
||||
充电器
|
||||
电线电缆
|
||||
开关设备
|
||||
连接器
|
||||
背光模组
|
||||
触摸屏
|
||||
功率器件
|
||||
分立器件
|
||||
NOR Flash
|
||||
微波器件
|
||||
电解液添加剂
|
||||
液晶显示屏
|
||||
智能卡
|
||||
信号链芯片
|
||||
红外热像仪
|
||||
视频监控系统
|
||||
音频设备
|
||||
智能头显
|
||||
无线通信模组
|
||||
基站天线
|
||||
嵌入式计算平台
|
||||
网络可视化设备
|
||||
轨道扣件
|
||||
高频头
|
||||
射频电缆
|
||||
显示器件
|
||||
触控模组
|
||||
虚拟现实产品
|
||||
专业视听产品
|
||||
照明应用产品
|
||||
电子制造服务
|
||||
光传输设备
|
||||
ODN设备
|
||||
屏蔽罩
|
||||
精密连接器
|
||||
模具治具
|
||||
智能检测分选设备
|
||||
智能包装设备
|
||||
软管配件
|
||||
清洁电器整机
|
||||
刀具产品
|
||||
滑轨
|
||||
电能计量箱
|
||||
智能水表
|
||||
膜式燃气表
|
||||
点胶设备
|
||||
特种光纤
|
||||
光学膜
|
||||
功能件
|
||||
墙板
|
||||
行业专机
|
||||
传输类设备
|
||||
宽带网络设备
|
||||
油气类商品
|
||||
游戏
|
||||
数字内容
|
||||
数字营销服务
|
||||
视频会议系统
|
||||
公共安全产品
|
||||
平板显示设备
|
||||
物联网产品
|
||||
AI视频平台
|
||||
融合媒体平台
|
||||
工程机械
|
||||
农业机械
|
||||
数控机床
|
||||
压缩机
|
||||
泵类
|
||||
阀门
|
||||
电机
|
||||
铸件
|
||||
模具
|
||||
银行贷款业务
|
||||
证券与投资业务
|
||||
利息收入(非贷款)
|
||||
手续费及佣金收入
|
||||
财富管理与金融服务
|
|
@ -0,0 +1 @@
|
|||
# fundamentals_llm package initialization
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,308 @@
|
|||
import logging
|
||||
from openai import OpenAI
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import random
|
||||
from typing import Dict, Any, Optional
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 默认配置
|
||||
DEFAULT_API_KEYS = [
|
||||
"28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93", # 默认测试密钥
|
||||
]
|
||||
|
||||
DEFAULT_MODELS = {
|
||||
"online_bot": "bot-20250325102825-h9kpq", # 联网智能体ID
|
||||
"offline_model": "ep-20250326090920-v7wns", # 免费推理50W
|
||||
"doubao": "doubao-1-5-pro-32k-250115", # 豆包模型
|
||||
"deepseek": "deepseek-r1-250120", # Deepseek模型
|
||||
}
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 尝试导入配置
|
||||
try:
|
||||
# 添加项目根目录到 Python 路径
|
||||
sys.path.append(os.path.dirname(ROOT_DIR))
|
||||
sys.path.append(ROOT_DIR)
|
||||
|
||||
# 导入配置
|
||||
try:
|
||||
from scripts.config import get_random_api_key, get_model
|
||||
logger.info("成功从scripts.config导入配置")
|
||||
except ImportError:
|
||||
try:
|
||||
from src.scripts.config import get_random_api_key, get_model
|
||||
logger.info("成功从src.scripts.config导入配置")
|
||||
except ImportError:
|
||||
logger.warning("无法导入配置模块,使用默认配置")
|
||||
|
||||
# 使用默认配置的实现
|
||||
def get_random_api_key():
|
||||
return random.choice(DEFAULT_API_KEYS)
|
||||
|
||||
def get_model(model_type):
|
||||
return DEFAULT_MODELS.get(model_type, DEFAULT_MODELS["offline_model"])
|
||||
except Exception as e:
|
||||
logger.error(f"导入配置时出错: {str(e)},使用默认配置")
|
||||
|
||||
# 使用默认配置的实现
|
||||
def get_random_api_key():
|
||||
return random.choice(DEFAULT_API_KEYS)
|
||||
|
||||
def get_model(model_type):
|
||||
return DEFAULT_MODELS.get(model_type, DEFAULT_MODELS["offline_model"])
|
||||
|
||||
class ChatBot:
|
||||
def __init__(self, model_type: str = "online_bot"):
|
||||
"""初始化聊天机器人
|
||||
|
||||
Args:
|
||||
model_type: 要使用的模型类型,默认为联网智能体
|
||||
"""
|
||||
try:
|
||||
# 从配置获取API密钥
|
||||
self.api_key = get_random_api_key()
|
||||
# 从配置获取模型ID
|
||||
self.model = get_model(model_type)
|
||||
|
||||
logger.info(f"初始化ChatBot,使用模型: {self.model}")
|
||||
|
||||
# 初始化OpenAI客户端
|
||||
self.client = OpenAI(
|
||||
base_url="https://ark.cn-beijing.volces.com/api/v3/bots",
|
||||
api_key=self.api_key
|
||||
)
|
||||
|
||||
# 系统提示语
|
||||
self.system_message = {
|
||||
"role": "system",
|
||||
"content": """你是一个专业的股票分析助手,擅长进行深入的基本面分析。你的分析应该:
|
||||
|
||||
1. 专业严谨
|
||||
- 使用准确的专业术语
|
||||
- 引用可靠的数据来源
|
||||
- 分析逻辑清晰
|
||||
- 结论有理有据
|
||||
|
||||
2. 全面细致
|
||||
- 深入分析问题的各个方面
|
||||
- 关注细节和关键信息
|
||||
- 考虑多个影响因素
|
||||
- 提供详实的论据支持
|
||||
|
||||
3. 客观中立
|
||||
- 保持独立判断
|
||||
- 不夸大或贬低
|
||||
- 平衡利弊分析
|
||||
- 指出潜在风险
|
||||
|
||||
4. 实用性强
|
||||
- 分析结论具体明确
|
||||
- 建议具有可操作性
|
||||
- 关注实际投资价值
|
||||
- 提供清晰的决策参考
|
||||
|
||||
5. 及时更新
|
||||
- 关注最新信息
|
||||
- 反映市场变化
|
||||
- 动态调整分析
|
||||
- 保持信息时效性
|
||||
|
||||
请根据用户的具体需求,提供专业、深入的分析。如果遇到不确定的信息,请明确说明。"""
|
||||
}
|
||||
|
||||
# 对话历史
|
||||
self.conversation_history = [self.system_message]
|
||||
except Exception as e:
|
||||
logger.error(f"初始化ChatBot时出错: {str(e)}")
|
||||
raise
|
||||
|
||||
def format_reference(self, ref):
|
||||
"""格式化参考资料"""
|
||||
try:
|
||||
if isinstance(ref, str):
|
||||
return ref
|
||||
elif isinstance(ref, dict):
|
||||
title = ref.get('title', '')
|
||||
summary = ref.get('summary', '')
|
||||
url = ref.get('url', '')
|
||||
publish_time = ref.get('publish_time', '')
|
||||
|
||||
formatted_ref = []
|
||||
if title:
|
||||
formatted_ref.append(f"标题:{title}")
|
||||
if summary:
|
||||
formatted_ref.append(f"摘要:{summary}")
|
||||
if url:
|
||||
formatted_ref.append(f"链接:{url}")
|
||||
if publish_time:
|
||||
formatted_ref.append(f"发布时间:{publish_time}")
|
||||
|
||||
return "\n".join(formatted_ref)
|
||||
else:
|
||||
return str(ref)
|
||||
except Exception as e:
|
||||
logger.error(f"格式化参考资料时出错: {str(e)}")
|
||||
return str(ref)
|
||||
|
||||
def chat(self, user_input: str) -> Dict[str, Any]:
|
||||
"""与AI进行对话
|
||||
|
||||
Args:
|
||||
user_input: 用户输入的问题
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: 包含以下字段的字典:
|
||||
- response: AI的回答内容
|
||||
- reasoning_process: 推理过程
|
||||
- references: 参考资料列表
|
||||
"""
|
||||
try:
|
||||
# 添加用户消息到对话历史
|
||||
self.conversation_history.append({
|
||||
"role": "user",
|
||||
"content": user_input
|
||||
})
|
||||
|
||||
# 调用API(流式输出)
|
||||
stream = self.client.chat.completions.create(
|
||||
model=self.model,
|
||||
messages=self.conversation_history,
|
||||
stream=True
|
||||
)
|
||||
|
||||
# 收集完整的回复
|
||||
full_response = ""
|
||||
print("\nAI: ", end="", flush=True)
|
||||
|
||||
# 用于存储参考资料和推理过程
|
||||
references = []
|
||||
reasoning_parts = []
|
||||
|
||||
for chunk in stream:
|
||||
# 检查是否有参考资料
|
||||
if hasattr(chunk, "references"):
|
||||
refs = chunk.references
|
||||
if refs:
|
||||
references.extend(refs)
|
||||
|
||||
if not chunk.choices:
|
||||
continue
|
||||
|
||||
# 输出内容
|
||||
if chunk.choices[0].delta.content:
|
||||
content = chunk.choices[0].delta.content
|
||||
print(content, end="", flush=True)
|
||||
full_response += content
|
||||
time.sleep(0.02)
|
||||
|
||||
# 收集推理过程
|
||||
elif hasattr(chunk.choices[0].delta, "reasoning_content"):
|
||||
reasoning = chunk.choices[0].delta.reasoning_content
|
||||
if reasoning:
|
||||
reasoning_parts.append(reasoning)
|
||||
|
||||
# 如果有推理过程,格式化并显示
|
||||
if reasoning_parts:
|
||||
print("\n\n推理过程:")
|
||||
reasoning_text = "".join(reasoning_parts)
|
||||
print(reasoning_text)
|
||||
print("-" * 50)
|
||||
|
||||
# 如果有参考资料,格式化并显示
|
||||
if references:
|
||||
print("\n参考资料:")
|
||||
for ref in references:
|
||||
formatted_ref = self.format_reference(ref)
|
||||
print(f"\n{formatted_ref}")
|
||||
print("-" * 50)
|
||||
|
||||
# 从回答中提取推理过程和参考资料
|
||||
main_response = full_response
|
||||
reasoning_process = ""
|
||||
|
||||
if "推理过程:" in full_response:
|
||||
parts = full_response.split("推理过程:")
|
||||
main_response = parts[0].strip()
|
||||
if len(parts) > 1:
|
||||
reasoning_parts = parts[1].split("参考资料:")
|
||||
reasoning_process = reasoning_parts[0].strip()
|
||||
|
||||
# 添加AI回复到对话历史
|
||||
self.conversation_history.append({
|
||||
"role": "assistant",
|
||||
"content": main_response,
|
||||
"reasoning_process": reasoning_text,
|
||||
"references": references
|
||||
})
|
||||
|
||||
return {
|
||||
"response": main_response,
|
||||
"reasoning_process": reasoning_text,
|
||||
"references": references
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"对话失败: {str(e)}")
|
||||
return {
|
||||
"response": f"抱歉,处理您的请求时出现错误: {str(e)}",
|
||||
"reasoning_process": "",
|
||||
"references": []
|
||||
}
|
||||
|
||||
def clear_history(self):
|
||||
"""清除对话历史"""
|
||||
self.conversation_history = [self.system_message]
|
||||
print("对话历史已清除")
|
||||
|
||||
def run(self):
|
||||
"""运行聊天机器人"""
|
||||
print("欢迎使用AI助手!输入 'quit' 退出,输入 'clear' 清除对话历史。")
|
||||
print("该版本支持联网搜索,可以回答实时信息。")
|
||||
print("-" * 50)
|
||||
|
||||
while True:
|
||||
try:
|
||||
# 获取用户输入
|
||||
user_input = input("\n你: ").strip()
|
||||
|
||||
# 检查退出命令
|
||||
if user_input.lower() == 'quit':
|
||||
print("感谢使用,再见!")
|
||||
break
|
||||
|
||||
# 检查清除历史命令
|
||||
if user_input.lower() == 'clear':
|
||||
self.clear_history()
|
||||
continue
|
||||
|
||||
# 如果输入为空,继续下一轮
|
||||
if not user_input:
|
||||
continue
|
||||
|
||||
# 获取AI回复
|
||||
self.chat(user_input)
|
||||
print("-" * 50)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n感谢使用,再见!")
|
||||
break
|
||||
except Exception as e:
|
||||
logger.error(f"运行错误: {str(e)}")
|
||||
print(f"发生错误: {str(e)}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 设置日志级别
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
# 创建并运行聊天机器人
|
||||
bot = ChatBot()
|
||||
bot.run()
|
|
@ -0,0 +1,203 @@
|
|||
import logging
|
||||
from openai import OpenAI
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import random
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 尝试导入配置
|
||||
try:
|
||||
# 添加项目根目录到 Python 路径
|
||||
sys.path.append(os.path.dirname(ROOT_DIR))
|
||||
sys.path.append(ROOT_DIR)
|
||||
|
||||
# 导入配置
|
||||
try:
|
||||
from scripts.config import get_model_config
|
||||
logger.info("成功从scripts.config导入配置")
|
||||
except ImportError:
|
||||
try:
|
||||
from src.scripts.config import get_model_config
|
||||
logger.info("成功从src.scripts.config导入配置")
|
||||
except ImportError:
|
||||
logger.warning("无法导入配置模块,使用默认配置")
|
||||
|
||||
# 使用默认配置的实现
|
||||
def get_model_config(platform: str, model_type: str):
|
||||
return {
|
||||
"base_url": "https://ark.cn-beijing.volces.com/api/v3/",
|
||||
"api_key": "28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93",
|
||||
"model": "ep-20250326090920-v7wns"
|
||||
}
|
||||
except Exception as e:
|
||||
logger.error(f"导入配置时出错: {str(e)},使用默认配置")
|
||||
|
||||
# 使用默认配置的实现
|
||||
def get_model_config(platform: str, model_type: str):
|
||||
return {
|
||||
"base_url": "https://ark.cn-beijing.volces.com/api/v3/",
|
||||
"api_key": "28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93",
|
||||
"model": "ep-20250326090920-v7wns"
|
||||
}
|
||||
|
||||
class ChatBot:
|
||||
def __init__(self, platform: str = "volc", model_type: str = "offline_model"):
|
||||
"""初始化聊天机器人
|
||||
|
||||
Args:
|
||||
platform: 平台名称(volc/doubao/deepseek),默认为volc
|
||||
model_type: 要使用的模型类型,默认为offline_model
|
||||
"""
|
||||
try:
|
||||
# 从配置获取API配置
|
||||
config = get_model_config(platform, model_type)
|
||||
self.api_key = config["api_key"]
|
||||
self.model = config["model"]
|
||||
|
||||
logger.info(f"初始化ChatBot,使用平台: {platform}, 模型: {self.model}")
|
||||
|
||||
# 初始化OpenAI客户端
|
||||
self.client = OpenAI(
|
||||
base_url=config["base_url"],
|
||||
api_key=self.api_key,
|
||||
timeout=600
|
||||
)
|
||||
|
||||
# 系统提示语
|
||||
self.system_message = {
|
||||
"role": "system",
|
||||
"content": """你是一位经验丰富的专业投资经理,擅长基本面分析和投资决策。你的分析特点如下:
|
||||
|
||||
1. 分析风格:
|
||||
- 专业、客观、理性
|
||||
- 注重数据支撑
|
||||
- 关注风险控制
|
||||
- 重视投资性价比
|
||||
|
||||
2. 分析框架:
|
||||
- 公司基本面分析
|
||||
- 行业竞争格局
|
||||
- 估值水平评估
|
||||
- 风险因素识别
|
||||
- 投资机会判断
|
||||
|
||||
3. 输出要求:
|
||||
- 简明扼要,重点突出
|
||||
- 逻辑清晰,层次分明
|
||||
- 数据准确,论据充分
|
||||
- 结论明确,建议具体
|
||||
|
||||
请用专业投资经理的视角,对股票进行深入分析和投资建议。如果信息不足,请明确指出。"""
|
||||
}
|
||||
|
||||
# 对话历史
|
||||
self.conversation_history = [self.system_message]
|
||||
except Exception as e:
|
||||
logger.error(f"初始化ChatBot时出错: {str(e)}")
|
||||
raise
|
||||
|
||||
def chat(self, user_input: str) -> str:
|
||||
"""处理用户输入并返回AI回复"""
|
||||
try:
|
||||
# # 添加用户消息到对话历史-多轮
|
||||
self.conversation_history.append({
|
||||
"role": "user",
|
||||
"content": user_input
|
||||
})
|
||||
|
||||
|
||||
# 调用OpenAI API(流式输出)
|
||||
stream = self.client.chat.completions.create(
|
||||
model=self.model,
|
||||
messages=self.conversation_history,
|
||||
temperature=0,
|
||||
stream=True,
|
||||
timeout=600
|
||||
)
|
||||
|
||||
# 收集完整的回复
|
||||
full_response = ""
|
||||
print("\nAI: ", end="", flush=True)
|
||||
|
||||
for chunk in stream:
|
||||
if not chunk.choices:
|
||||
continue
|
||||
content = chunk.choices[0].delta.content
|
||||
if content:
|
||||
print(content, end="", flush=True)
|
||||
full_response += content
|
||||
# 添加一个小延迟,使输出更自然
|
||||
time.sleep(0.02)
|
||||
|
||||
print() # 换行
|
||||
|
||||
# 添加AI回复到对话历史
|
||||
self.conversation_history.append({
|
||||
"role": "assistant",
|
||||
"content": full_response
|
||||
})
|
||||
|
||||
return full_response
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"聊天失败: {str(e)}")
|
||||
error_msg = f"抱歉,发生错误: {str(e)}"
|
||||
print(f"\n{error_msg}")
|
||||
return error_msg
|
||||
|
||||
def clear_history(self):
|
||||
"""清除对话历史"""
|
||||
self.conversation_history = [self.system_message]
|
||||
print("对话历史已清除")
|
||||
|
||||
def run(self):
|
||||
"""运行聊天机器人"""
|
||||
print("欢迎使用AI助手!输入 'quit' 退出,输入 'clear' 清除对话历史。")
|
||||
print("-" * 50)
|
||||
|
||||
while True:
|
||||
try:
|
||||
# 获取用户输入
|
||||
user_input = input("\n你: ").strip()
|
||||
|
||||
# 检查退出命令
|
||||
if user_input.lower() == 'quit':
|
||||
print("感谢使用,再见!")
|
||||
break
|
||||
|
||||
# 检查清除历史命令
|
||||
if user_input.lower() == 'clear':
|
||||
self.clear_history()
|
||||
continue
|
||||
|
||||
# 如果输入为空,继续下一轮
|
||||
if not user_input:
|
||||
continue
|
||||
|
||||
# 获取AI回复
|
||||
self.chat(user_input)
|
||||
print("-" * 50)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n感谢使用,再见!")
|
||||
break
|
||||
except Exception as e:
|
||||
logger.error(f"运行错误: {str(e)}")
|
||||
print(f"发生错误: {str(e)}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 设置日志级别
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
# 创建并运行聊天机器人
|
||||
bot = ChatBot()
|
||||
bot.run()
|
|
@ -0,0 +1,595 @@
|
|||
import logging
|
||||
from typing import List, Dict, Tuple
|
||||
from fundamentals_llm.fundamental_analysis_database import get_db, get_analysis_result
|
||||
from sqlalchemy import text
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class EnterpriseScreener:
|
||||
"""企业筛选器"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化筛选器"""
|
||||
self.db = next(get_db())
|
||||
|
||||
def _get_stock_info(self, stock_code: str) -> Tuple[str, str]:
|
||||
"""获取股票信息
|
||||
|
||||
Args:
|
||||
stock_code: 股票代码
|
||||
|
||||
Returns:
|
||||
Tuple[str, str]: (股票代码, 股票名称)
|
||||
"""
|
||||
try:
|
||||
# 从任意维度获取股票信息
|
||||
result = get_analysis_result(self.db, stock_code, "company_profile")
|
||||
if result:
|
||||
return stock_code, result.stock_name
|
||||
return stock_code, "未知"
|
||||
except Exception as e:
|
||||
logger.error(f"获取股票信息失败: {str(e)}")
|
||||
return stock_code, "未知"
|
||||
|
||||
def _screen_stocks_by_conditions(self, conditions: List[Dict], limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""通用的股票筛选方法
|
||||
|
||||
Args:
|
||||
conditions: 筛选条件列表,每个条件是一个字典,包含:
|
||||
- dimension: 分析维度
|
||||
- field: extra_info中的字段名
|
||||
- operator: 操作符 ('=', '!=', '>=', '<=', 'in')
|
||||
- value: 比较值
|
||||
- required: 是否必须满足(默认True)
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
try:
|
||||
# 构建SQL查询条件
|
||||
where_conditions = []
|
||||
having_conditions = []
|
||||
for i, condition in enumerate(conditions):
|
||||
dimension = condition['dimension']
|
||||
field = condition['field']
|
||||
operator = condition['operator']
|
||||
value = condition['value']
|
||||
required = condition.get('required', True)
|
||||
|
||||
# 构建JSON提取表达式
|
||||
json_extract = f"JSON_EXTRACT(fa.extra_info, '$.{field}')"
|
||||
if operator in ('=', '!='):
|
||||
json_extract = f"JSON_UNQUOTE({json_extract})"
|
||||
elif operator in ('>=', '<=', '>', '<'):
|
||||
json_extract = f"CAST({json_extract} AS SIGNED)"
|
||||
|
||||
# 构建比较条件
|
||||
if operator == 'in':
|
||||
value_str = ', '.join(str(v) for v in value)
|
||||
where_condition = f"{json_extract} IN ({value_str})"
|
||||
else:
|
||||
where_condition = f"{json_extract} {operator} '{value}'"
|
||||
|
||||
# 添加到WHERE子句
|
||||
where_conditions.append(f"(fa.dimension = '{dimension}' AND {where_condition})")
|
||||
|
||||
# 添加到HAVING子句
|
||||
if required:
|
||||
having_conditions.append(f"WHEN fa.dimension = '{dimension}' AND {where_condition} THEN {i+1}")
|
||||
|
||||
# 构建完整的SQL查询
|
||||
sql = f"""
|
||||
SELECT fa.stock_code, fa.stock_name
|
||||
FROM fundamental_analysis fa
|
||||
WHERE 1=1
|
||||
AND ({' OR '.join(where_conditions)})
|
||||
GROUP BY fa.stock_code, fa.stock_name
|
||||
HAVING COUNT(DISTINCT CASE
|
||||
{' '.join(having_conditions)}
|
||||
END) = {len(having_conditions)}
|
||||
"""
|
||||
|
||||
# 添加LIMIT子句
|
||||
if limit is not None:
|
||||
sql += f"\nLIMIT {limit}"
|
||||
|
||||
# 打印SQL查询语句到控制台
|
||||
print("\n===================== SQL查询 =====================")
|
||||
print(sql)
|
||||
print("==================================================\n")
|
||||
|
||||
# 执行查询
|
||||
cursor = self.db.execute(text(sql))
|
||||
qualified_stocks = []
|
||||
for row in cursor:
|
||||
stock_code = row[0]
|
||||
stock_name = row[1] if row[1] != None else self._get_stock_info(stock_code)[1]
|
||||
qualified_stocks.append((stock_code, stock_name))
|
||||
|
||||
print(f"查询结果: 找到 {len(qualified_stocks)} 个符合条件的股票")
|
||||
|
||||
return qualified_stocks
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"通用筛选方法失败: {str(e)}")
|
||||
print(f"SQL查询执行失败: {str(e)}")
|
||||
return []
|
||||
|
||||
def screen_multi_term_investment_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选推荐投资企业
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'investment_advice',
|
||||
'field': 'investment_advice_type',
|
||||
'operator': '!=',
|
||||
'value': '不建议'
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_high_growth_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选高成长潜力企业
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '=',
|
||||
'value': 2
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'recent_projects',
|
||||
'field': 'major_events',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'odds',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_stable_leaders(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选稳定型龙头企业
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'management_ownership',
|
||||
'field': 'ability',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'management_ownership',
|
||||
'field': 'shareholding',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_short_term_opportunities(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选短期投资机会
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'recent_projects',
|
||||
'field': 'major_events',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'stock_discussion',
|
||||
'field': 'emotion',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'odds',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_value_investment_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选价值型投资标的
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '=',
|
||||
'value': 2
|
||||
},
|
||||
{
|
||||
'dimension': 'management_ownership',
|
||||
'field': 'shareholding',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_turnaround_opportunities(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选困境反转机会
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '=',
|
||||
'value': -1
|
||||
},
|
||||
{
|
||||
'dimension': 'recent_projects',
|
||||
'field': 'major_events',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'stock_discussion',
|
||||
'field': 'emotion',
|
||||
'operator': '=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '=',
|
||||
'value': 0
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_risk_averse_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选风险规避标的
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'management_ownership',
|
||||
'field': 'ability',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'management_ownership',
|
||||
'field': 'shareholding',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_innovation_driven_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选创新驱动型企业
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '=',
|
||||
'value': 2
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '=',
|
||||
'value': 2
|
||||
},
|
||||
{
|
||||
'dimension': 'recent_projects',
|
||||
'field': 'major_events',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_industry_integration_stocks(self, limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""筛选行业整合机会
|
||||
|
||||
Args:
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
conditions = [
|
||||
{
|
||||
'dimension': 'industry_competition',
|
||||
'field': 'industry_space',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'industry_cooperation',
|
||||
'field': 'collaboration_dynamics',
|
||||
'operator': '=',
|
||||
'value': 2
|
||||
},
|
||||
{
|
||||
'dimension': 'financial_report',
|
||||
'field': 'financial_report_level',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'securities_rating',
|
||||
'operator': '>=',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'dimension': 'target_price',
|
||||
'field': 'odds',
|
||||
'operator': '=',
|
||||
'value': 1
|
||||
}
|
||||
]
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def screen_by_custom_conditions(self, conditions: List[Dict], limit: int = None) -> List[Tuple[str, str]]:
|
||||
"""根据自定义条件筛选企业
|
||||
|
||||
Args:
|
||||
conditions: 筛选条件列表,每个条件是一个字典,包含:
|
||||
- dimension: 分析维度
|
||||
- field: extra_info中的字段名
|
||||
- operator: 操作符 ('=', '!=', '>=', '<=', 'in')
|
||||
- value: 比较值
|
||||
- required: 是否必须满足(默认True)
|
||||
limit: 限制返回结果数量
|
||||
|
||||
Returns:
|
||||
List[Tuple[str, str]]: 符合条件的股票列表,每个元素为(股票代码, 股票名称)
|
||||
"""
|
||||
print("\n================== 自定义条件筛选 ==================")
|
||||
print(f"条件数量: {len(conditions)}")
|
||||
for i, condition in enumerate(conditions):
|
||||
print(f"条件 {i+1}: 维度={condition.get('dimension')}, 字段={condition.get('field')}, " +
|
||||
f"操作符={condition.get('operator')}, 值={condition.get('value')}, " +
|
||||
f"必须满足={condition.get('required', True)}")
|
||||
print("====================================================\n")
|
||||
|
||||
return self._screen_stocks_by_conditions(conditions, limit)
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
# 设置日志级别
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
# 创建筛选器实例
|
||||
screener = EnterpriseScreener()
|
||||
|
||||
# 测试选项
|
||||
print("\n请选择要筛选的企业类型:")
|
||||
print("1. 高成长潜力企业")
|
||||
print("2. 稳定型龙头企业")
|
||||
print("3. 短期投资机会")
|
||||
print("4. 价值型投资标的")
|
||||
print("5. 困境反转机会")
|
||||
print("6. 风险规避标的")
|
||||
print("7. 创新驱动型企业")
|
||||
print("8. 行业整合机会")
|
||||
print("9. 推荐投资企业")
|
||||
print("10. 退出")
|
||||
|
||||
choice = input("\n请输入选项(1-10): ").strip()
|
||||
|
||||
if choice == "1":
|
||||
stocks = screener.screen_high_growth_stocks()
|
||||
print("\n高成长潜力企业:")
|
||||
elif choice == "2":
|
||||
stocks = screener.screen_stable_leaders()
|
||||
print("\n稳定型龙头企业:")
|
||||
elif choice == "3":
|
||||
stocks = screener.screen_short_term_opportunities()
|
||||
print("\n短期投资机会:")
|
||||
elif choice == "4":
|
||||
stocks = screener.screen_value_investment_stocks()
|
||||
print("\n价值型投资标的:")
|
||||
elif choice == "5":
|
||||
stocks = screener.screen_turnaround_opportunities()
|
||||
print("\n困境反转机会:")
|
||||
elif choice == "6":
|
||||
stocks = screener.screen_risk_averse_stocks()
|
||||
print("\n风险规避标的:")
|
||||
elif choice == "7":
|
||||
stocks = screener.screen_innovation_driven_stocks()
|
||||
print("\n创新驱动型企业:")
|
||||
elif choice == "8":
|
||||
stocks = screener.screen_industry_integration_stocks()
|
||||
print("\n行业整合机会:")
|
||||
elif choice == "9":
|
||||
stocks = screener.screen_multi_term_investment_stocks()
|
||||
print("\n推荐投资企业:")
|
||||
elif choice == "10":
|
||||
print("程序退出")
|
||||
return
|
||||
else:
|
||||
print("无效的选项")
|
||||
return
|
||||
|
||||
# 输出结果
|
||||
if stocks:
|
||||
print(f"\n共找到 {len(stocks)} 只符合条件的股票:")
|
||||
for code, name in stocks:
|
||||
print(f"{name}({code})")
|
||||
else:
|
||||
print("\n未找到符合条件的股票")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,172 @@
|
|||
from sqlalchemy import create_engine, Column, Integer, String, Text, DateTime, JSON
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker, Session
|
||||
from datetime import datetime
|
||||
import os
|
||||
import logging
|
||||
from typing import Optional, List, Dict
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 数据库配置
|
||||
DB_CONFIG = {
|
||||
'host': '192.168.1.82',
|
||||
'port': 3306,
|
||||
'user': 'root',
|
||||
'password': 'Chlry$%.8',
|
||||
'database': 'db_gp_cj'
|
||||
}
|
||||
|
||||
# 创建数据库连接URL
|
||||
DATABASE_URL = f"mysql+pymysql://{DB_CONFIG['user']}:{DB_CONFIG['password']}@{DB_CONFIG['host']}:{DB_CONFIG['port']}/{DB_CONFIG['database']}"
|
||||
|
||||
# 创建数据库引擎
|
||||
engine = create_engine(DATABASE_URL)
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
Base = declarative_base()
|
||||
|
||||
class GpFundamentalAnalysis(Base):
|
||||
"""基本面分析结果表"""
|
||||
__tablename__ = "fundamental_analysis"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
stock_code = Column(String(10), nullable=False, comment="股票代码")
|
||||
stock_name = Column(String(50), nullable=False, comment="股票名称")
|
||||
dimension = Column(String(50), nullable=False, comment="分析维度")
|
||||
ai_response = Column(Text, nullable=False, comment="AI分析结果")
|
||||
reasoning_process = Column(Text, comment="推理过程")
|
||||
references = Column(JSON, comment="参考资料")
|
||||
update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment="更新时间")
|
||||
extra_info = Column(JSON, comment="扩展信息")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<GpFundamentalAnalysis(stock_code={self.stock_code}, dimension={self.dimension})>"
|
||||
|
||||
def init_db():
|
||||
"""初始化数据库"""
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
def get_db():
|
||||
"""获取数据库会话"""
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
# 定义基本面分析的维度
|
||||
ANALYSIS_DIMENSIONS = {
|
||||
"company_profile": "公司简介",
|
||||
"business_background": "业务背景",
|
||||
"core_advantages": "核心优势",
|
||||
"management_team": "管理团队",
|
||||
"financial_performance": "财务表现",
|
||||
"risk_factors": "风险因素",
|
||||
"development_prospects": "发展前景",
|
||||
"investment_suggestion": "投资建议"
|
||||
}
|
||||
|
||||
def save_analysis_result(
|
||||
db: Session,
|
||||
stock_code: str,
|
||||
stock_name: str,
|
||||
dimension: str,
|
||||
ai_response: str,
|
||||
reasoning_process: Optional[str] = None,
|
||||
references: Optional[List[Dict]] = None,
|
||||
extra_info: Optional[Dict] = None
|
||||
) -> bool:
|
||||
"""保存分析结果到数据库
|
||||
|
||||
Args:
|
||||
db: 数据库会话
|
||||
stock_code: 股票代码
|
||||
stock_name: 股票名称
|
||||
dimension: 分析维度
|
||||
ai_response: AI分析结果
|
||||
reasoning_process: 推理过程
|
||||
references: 参考资料列表
|
||||
extra_info: 额外信息
|
||||
|
||||
Returns:
|
||||
bool: 是否保存成功
|
||||
"""
|
||||
try:
|
||||
# 检查是否已存在相同维度的分析结果
|
||||
existing_result = db.query(GpFundamentalAnalysis).filter(
|
||||
GpFundamentalAnalysis.stock_code == stock_code,
|
||||
GpFundamentalAnalysis.dimension == dimension
|
||||
).first()
|
||||
|
||||
if existing_result:
|
||||
# 如果存在,则更新
|
||||
existing_result.ai_response = ai_response
|
||||
existing_result.reasoning_process = reasoning_process
|
||||
existing_result.references = references
|
||||
existing_result.extra_info = extra_info
|
||||
existing_result.update_time = datetime.now()
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
# 如果不存在,则创建新记录
|
||||
new_result = GpFundamentalAnalysis(
|
||||
stock_code=stock_code,
|
||||
stock_name=stock_name,
|
||||
dimension=dimension,
|
||||
ai_response=ai_response,
|
||||
reasoning_process=reasoning_process,
|
||||
references=references,
|
||||
extra_info=extra_info,
|
||||
update_time=datetime.now()
|
||||
)
|
||||
|
||||
db.add(new_result)
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"保存分析结果失败: {str(e)}")
|
||||
db.rollback()
|
||||
return False
|
||||
|
||||
def get_analysis_result(db: Session, stock_code: str, dimension: str):
|
||||
"""获取特定股票特定维度的分析结果"""
|
||||
try:
|
||||
result = db.query(GpFundamentalAnalysis).filter(
|
||||
GpFundamentalAnalysis.stock_code == stock_code,
|
||||
GpFundamentalAnalysis.dimension == dimension
|
||||
).first()
|
||||
return result
|
||||
except Exception as e:
|
||||
logger.error(f"获取分析结果失败: {str(e)}")
|
||||
return None
|
||||
|
||||
def update_analysis_result(
|
||||
db: Session,
|
||||
stock_code: str,
|
||||
dimension: str,
|
||||
ai_response: str,
|
||||
reasoning_process: Optional[str] = None,
|
||||
references: Optional[List[Dict]] = None,
|
||||
extra_info: Optional[Dict] = None
|
||||
) -> bool:
|
||||
"""更新分析结果"""
|
||||
try:
|
||||
result = get_analysis_result(db, stock_code, dimension)
|
||||
if result:
|
||||
result.ai_response = ai_response
|
||||
result.reasoning_process = reasoning_process
|
||||
result.references = references
|
||||
result.extra_info = extra_info
|
||||
result.update_time = datetime.now()
|
||||
db.commit()
|
||||
return True
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.error(f"更新分析结果失败: {str(e)}")
|
||||
db.rollback()
|
||||
return False
|
|
@ -0,0 +1,203 @@
|
|||
import pandas as pd
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from sqlalchemy import create_engine, Table, Column, String, DECIMAL, MetaData, text
|
||||
|
||||
# 数据库连接配置
|
||||
DB_CONFIG = {
|
||||
'host': '192.168.1.82',
|
||||
'port': 3306,
|
||||
'user': 'root',
|
||||
'password': 'Chlry$%.8',
|
||||
'database': 'db_gp_cj'
|
||||
}
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
def connect_to_db():
|
||||
"""连接到数据库"""
|
||||
try:
|
||||
connection_string = f"mysql+pymysql://{DB_CONFIG['user']}:{DB_CONFIG['password']}@{DB_CONFIG['host']}:{DB_CONFIG['port']}/{DB_CONFIG['database']}"
|
||||
engine = create_engine(connection_string)
|
||||
return engine
|
||||
except Exception as e:
|
||||
print(f"数据库连接失败: {str(e)}")
|
||||
sys.exit(1)
|
||||
|
||||
def create_table_if_not_exists(engine):
|
||||
"""如果不存在则创建表"""
|
||||
metadata = MetaData()
|
||||
|
||||
# 定义表结构
|
||||
main_business = Table(
|
||||
'gp_main_business',
|
||||
metadata,
|
||||
Column('stock_code', String(20), primary_key=True, comment='股票代码'),
|
||||
Column('stock_name', String(50), comment='股票简称'),
|
||||
Column('report_date', String(8), primary_key=True, comment='报告期(YYYYMMDD)'),
|
||||
Column('product_rank', String(1), primary_key=True, comment='项目排名(1-5)'),
|
||||
Column('product_name', String(100), comment='项目名称'),
|
||||
Column('revenue', DECIMAL(20, 2), comment='项目收入'),
|
||||
Column('cost', DECIMAL(20, 2), comment='项目成本'),
|
||||
Column('profit', DECIMAL(20, 2), comment='项目毛利'),
|
||||
Column('profit_margin', DECIMAL(10, 4), comment='项目毛利率')
|
||||
)
|
||||
|
||||
# 创建表
|
||||
try:
|
||||
metadata.create_all(engine)
|
||||
print("表创建成功或已存在")
|
||||
except Exception as e:
|
||||
print(f"创建表失败: {str(e)}")
|
||||
sys.exit(1)
|
||||
|
||||
return main_business
|
||||
|
||||
def clean_numeric_value(value):
|
||||
"""清理数字字符串,移除逗号并转换为浮点数"""
|
||||
if pd.isna(value) or value == "0" or value == "":
|
||||
return None
|
||||
try:
|
||||
# 移除逗号并转换为浮点数
|
||||
return float(str(value).replace(',', ''))
|
||||
except:
|
||||
return None
|
||||
|
||||
def import_csv_to_db(csv_file, engine, table, report_date=None):
|
||||
"""导入CSV文件到数据库"""
|
||||
try:
|
||||
# 确保使用绝对路径
|
||||
if not os.path.isabs(csv_file):
|
||||
csv_file = os.path.join(ROOT_DIR, csv_file)
|
||||
|
||||
# 检查文件是否存在
|
||||
if not os.path.exists(csv_file):
|
||||
print(f"文件不存在: {csv_file}")
|
||||
return
|
||||
print(f"正在处理文件: {csv_file}")
|
||||
# 读取CSV文件
|
||||
df = pd.read_csv(csv_file, encoding='gbk')
|
||||
# 如果没有指定报告期,从文件名或使用当前年份的半年报日期
|
||||
if report_date is None:
|
||||
filename = os.path.basename(csv_file)
|
||||
if len(filename.split('.')[0]) == 8 and filename.split('.')[0].isdigit():
|
||||
report_date = filename.split('.')[0]
|
||||
else:
|
||||
# 使用当前年份的半年报日期(20240630)
|
||||
current_year = datetime.now().year
|
||||
report_date = f"{current_year}0630"
|
||||
|
||||
print(f"处理报告期: {report_date}")
|
||||
|
||||
# 连接到数据库
|
||||
conn = engine.connect()
|
||||
|
||||
# 开始事务
|
||||
trans = conn.begin()
|
||||
|
||||
try:
|
||||
# 先删除该报告期的数据
|
||||
delete_query = text(f"DELETE FROM gp_main_business WHERE report_date = '{report_date}'")
|
||||
conn.execute(delete_query)
|
||||
|
||||
# 列名映射,方便访问列
|
||||
column_prefixes = [
|
||||
'主营构成(按产品)-第一名-',
|
||||
'主营构成(按产品)-第二名-',
|
||||
'主营构成(按产品)-第三名-',
|
||||
'主营构成(按产品)-第四名-',
|
||||
'主营构成(按产品)-第五名-'
|
||||
]
|
||||
|
||||
column_suffixes = [
|
||||
'项目名称', '项目收入', '项目成本', '项目毛利', '项目毛利率'
|
||||
]
|
||||
|
||||
# 插入新数据
|
||||
for _, row in df.iterrows():
|
||||
stock_code = row['代码']
|
||||
stock_name = row['简称']
|
||||
|
||||
# 处理前5个主营业务项目
|
||||
for i, prefix in enumerate(column_prefixes, 1):
|
||||
# 获取列名
|
||||
name_col = f"{prefix}{column_suffixes[0]}"
|
||||
revenue_col = f"{prefix}{column_suffixes[1]}"
|
||||
cost_col = f"{prefix}{column_suffixes[2]}"
|
||||
profit_col = f"{prefix}{column_suffixes[3]}"
|
||||
margin_col = f"{prefix}{column_suffixes[4]}"
|
||||
|
||||
# 获取项目名称
|
||||
product_name = row[name_col] if name_col in row else None
|
||||
|
||||
# 如果没有项目名称或项目名称为"0",跳过
|
||||
if pd.isna(product_name) or product_name == "0" or product_name == "":
|
||||
continue
|
||||
|
||||
# 清理并转换数值
|
||||
revenue = clean_numeric_value(row[revenue_col] if revenue_col in row else None)
|
||||
cost = clean_numeric_value(row[cost_col] if cost_col in row else None)
|
||||
profit = clean_numeric_value(row[profit_col] if profit_col in row else None)
|
||||
margin = clean_numeric_value(row[margin_col] if margin_col in row else None)
|
||||
|
||||
# 准备插入的数据
|
||||
data = {
|
||||
'stock_code': stock_code,
|
||||
'stock_name': stock_name,
|
||||
'report_date': report_date,
|
||||
'product_rank': str(i),
|
||||
'product_name': product_name,
|
||||
'revenue': revenue,
|
||||
'cost': cost,
|
||||
'profit': profit,
|
||||
'profit_margin': margin
|
||||
}
|
||||
|
||||
# 插入数据
|
||||
insert_query = table.insert().values(**data)
|
||||
conn.execute(insert_query)
|
||||
|
||||
# 提交事务
|
||||
trans.commit()
|
||||
print(f"成功导入 {csv_file} 数据")
|
||||
|
||||
except Exception as e:
|
||||
# 回滚事务
|
||||
trans.rollback()
|
||||
print(f"导入数据失败: {str(e)}")
|
||||
finally:
|
||||
# 关闭连接
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"处理CSV文件 {csv_file} 失败: {str(e)}")
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
# 检查命令行参数
|
||||
if len(sys.argv) < 2:
|
||||
print("用法: python import_main_business.py <csv_file> [report_date]")
|
||||
print("例如: python import_main_business.py src/data/111.csv 20240630")
|
||||
print("如果不提供report_date,将使用文件名或当前年份的半年报日期")
|
||||
sys.exit(1)
|
||||
|
||||
csv_file = sys.argv[1]
|
||||
|
||||
# 如果提供了报告期参数
|
||||
report_date = sys.argv[2] if len(sys.argv) > 2 else None
|
||||
|
||||
# 连接数据库
|
||||
engine = connect_to_db()
|
||||
|
||||
# 创建表
|
||||
table = create_table_if_not_exists(engine)
|
||||
|
||||
# 导入数据
|
||||
import_csv_to_db(csv_file, engine, table, report_date)
|
||||
|
||||
print("数据导入完成")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,336 @@
|
|||
import logging
|
||||
from typing import Dict, List, Optional, Union
|
||||
from reportlab.lib import colors
|
||||
from reportlab.lib.pagesizes import A4
|
||||
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
|
||||
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
||||
from reportlab.pdfbase import pdfmetrics
|
||||
from reportlab.pdfbase.ttfonts import TTFont
|
||||
from reportlab.platypus.paragraph import Paragraph
|
||||
import markdown2
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
from datetime import datetime
|
||||
from fpdf import FPDF
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
|
||||
# 修改导入路径,使用相对导入
|
||||
try:
|
||||
# 尝试相对导入
|
||||
from .chat_bot_with_offline import ChatBot
|
||||
from .fundamental_analysis_database import get_db, get_analysis_result
|
||||
except ImportError:
|
||||
# 如果相对导入失败,尝试绝对导入
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot_with_offline import ChatBot
|
||||
from src.fundamentals_llm.fundamental_analysis_database import get_db, get_analysis_result
|
||||
except ImportError:
|
||||
# 最后尝试直接导入
|
||||
from chat_bot_with_offline import ChatBot
|
||||
from fundamental_analysis_database import get_db, get_analysis_result
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class PDFGenerator:
|
||||
"""PDF生成器类,用于将内容转换为PDF格式"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化PDF生成器"""
|
||||
# 注册中文字体
|
||||
try:
|
||||
# 尝试使用系统自带的中文字体
|
||||
if os.name == 'nt': # Windows
|
||||
font_path = "C:/Windows/Fonts/simhei.ttf" # 黑体
|
||||
else: # Linux/Mac
|
||||
font_path = "/usr/share/fonts/truetype/droid/DroidSansFallback.ttf"
|
||||
|
||||
if os.path.exists(font_path):
|
||||
pdfmetrics.registerFont(TTFont('SimHei', font_path))
|
||||
self.font_name = 'SimHei'
|
||||
else:
|
||||
# 如果找不到系统字体,尝试使用当前目录下的字体
|
||||
font_path = os.path.join(os.path.dirname(__file__), "fonts", "simhei.ttf")
|
||||
if os.path.exists(font_path):
|
||||
pdfmetrics.registerFont(TTFont('SimHei', font_path))
|
||||
self.font_name = 'SimHei'
|
||||
else:
|
||||
raise FileNotFoundError("找不到中文字体文件")
|
||||
except Exception as e:
|
||||
logger.error(f"注册中文字体失败: {str(e)}")
|
||||
raise
|
||||
|
||||
self.chat_bot = ChatBot()
|
||||
self.styles = getSampleStyleSheet()
|
||||
|
||||
# 创建自定义样式
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='ReportTitle',
|
||||
parent=self.styles['Heading1'],
|
||||
fontSize=24,
|
||||
spaceAfter=30,
|
||||
alignment=1, # 居中对齐
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='ReportHeading',
|
||||
parent=self.styles['Heading2'],
|
||||
fontSize=16,
|
||||
spaceAfter=12,
|
||||
textColor=colors.HexColor('#2C3E50'),
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='ReportBody',
|
||||
parent=self.styles['Normal'],
|
||||
fontSize=12,
|
||||
leading=18,
|
||||
spaceAfter=12,
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
# 添加Markdown样式
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='MarkdownHeading1',
|
||||
parent=self.styles['Heading1'],
|
||||
fontSize=20,
|
||||
spaceAfter=20,
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='MarkdownHeading2',
|
||||
parent=self.styles['Heading2'],
|
||||
fontSize=16,
|
||||
spaceAfter=16,
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='MarkdownHeading3',
|
||||
parent=self.styles['Heading3'],
|
||||
fontSize=14,
|
||||
spaceAfter=14,
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='MarkdownList',
|
||||
parent=self.styles['Normal'],
|
||||
fontSize=12,
|
||||
leading=18,
|
||||
spaceAfter=12,
|
||||
leftIndent=20,
|
||||
fontName=self.font_name
|
||||
))
|
||||
|
||||
self.styles.add(ParagraphStyle(
|
||||
name='MarkdownCode',
|
||||
parent=self.styles['Normal'],
|
||||
fontSize=10,
|
||||
leading=16,
|
||||
spaceAfter=12,
|
||||
leftIndent=20,
|
||||
fontName='Courier',
|
||||
textColor=colors.HexColor('#333333')
|
||||
))
|
||||
|
||||
def _convert_markdown_to_flowables(self, markdown_text: str) -> List:
|
||||
"""将Markdown文本转换为PDF流对象
|
||||
|
||||
Args:
|
||||
markdown_text: Markdown格式的文本
|
||||
|
||||
Returns:
|
||||
List: PDF流对象列表
|
||||
"""
|
||||
# 将Markdown转换为HTML
|
||||
html = markdown2.markdown(markdown_text)
|
||||
soup = BeautifulSoup(html, 'html.parser')
|
||||
|
||||
flowables = []
|
||||
for element in soup.children:
|
||||
if element.name is None: # 纯文本
|
||||
if element.strip():
|
||||
flowables.append(Paragraph(element.strip(), self.styles['ReportBody']))
|
||||
elif element.name in ['h1', 'h2', 'h3']: # 标题
|
||||
level = int(element.name[1])
|
||||
style_name = f'MarkdownHeading{level}'
|
||||
flowables.append(Paragraph(element.get_text(), self.styles[style_name]))
|
||||
elif element.name == 'p': # 段落
|
||||
flowables.append(Paragraph(element.get_text(), self.styles['ReportBody']))
|
||||
elif element.name == 'ul': # 无序列表
|
||||
for li in element.find_all('li'):
|
||||
flowables.append(Paragraph(f"• {li.get_text()}", self.styles['MarkdownList']))
|
||||
elif element.name == 'ol': # 有序列表
|
||||
for i, li in enumerate(element.find_all('li'), 1):
|
||||
flowables.append(Paragraph(f"{i}. {li.get_text()}", self.styles['MarkdownList']))
|
||||
elif element.name == 'code': # 代码块
|
||||
flowables.append(Paragraph(element.get_text(), self.styles['MarkdownCode']))
|
||||
elif element.name == 'blockquote': # 引用
|
||||
flowables.append(Paragraph(f"「{element.get_text()}」", self.styles['ReportBody']))
|
||||
elif element.name == 'hr': # 分隔线
|
||||
flowables.append(Spacer(1, 20))
|
||||
|
||||
return flowables
|
||||
|
||||
def _optimize_content(self, content: str) -> str:
|
||||
# 移除markdown代码块标记
|
||||
content = content.replace('```markdown', '').replace('```', '')
|
||||
"""优化内容格式并转换为Markdown
|
||||
|
||||
Args:
|
||||
content: 原始内容
|
||||
|
||||
Returns:
|
||||
str: 优化后的Markdown格式内容
|
||||
"""
|
||||
try:
|
||||
prompt = f"""请对以下内容进行优化和格式化。要求:
|
||||
1. 保持原文的专业性和准确性
|
||||
2. 将零散的内容整合成连贯的段落,并对不重要的内容精简
|
||||
3. 使用适当的标点符号和换行
|
||||
4. 使用Markdown格式进行排版
|
||||
5. 移除所有引用内容(包括"参考资料:"等)
|
||||
6. 不要返回其他多余的内容
|
||||
7. 确保内容结构清晰,层次分明
|
||||
8. 将零散的内容整合成完整的段落,避免过于零散的表述
|
||||
9. 使用自然流畅的语言,避免过于机械的结构化表达
|
||||
|
||||
原始内容:
|
||||
{content}"""
|
||||
|
||||
result = self.chat_bot.chat(prompt)
|
||||
return result
|
||||
except Exception as e:
|
||||
logger.error(f"优化内容失败: {str(e)}")
|
||||
return content
|
||||
|
||||
def generate_pdf(self,
|
||||
title: str,
|
||||
content_dict: Dict[str, str],
|
||||
output_dir: str = "reports",
|
||||
filename: Optional[str] = None) -> Optional[str]:
|
||||
"""生成PDF报告
|
||||
|
||||
Args:
|
||||
title: 报告标题
|
||||
content_dict: 包含各维度内容的字典,key为维度名称,value为内容
|
||||
output_dir: 输出目录
|
||||
filename: 文件名(可选),如果不提供则自动生成
|
||||
|
||||
Returns:
|
||||
Optional[str]: 生成的PDF文件路径,如果失败则返回None
|
||||
"""
|
||||
try:
|
||||
# 创建输出目录
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
|
||||
# 生成文件名
|
||||
if not filename:
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
filename = f"report_{timestamp}.pdf"
|
||||
filepath = os.path.join(output_dir, filename)
|
||||
|
||||
# 创建PDF文档
|
||||
doc = SimpleDocTemplate(
|
||||
filepath,
|
||||
pagesize=A4,
|
||||
rightMargin=72,
|
||||
leftMargin=72,
|
||||
topMargin=72,
|
||||
bottomMargin=72
|
||||
)
|
||||
|
||||
# 准备内容
|
||||
story = []
|
||||
|
||||
# 添加标题
|
||||
title_para = Paragraph(title, self.styles['ReportTitle'])
|
||||
story.append(title_para)
|
||||
story.append(Spacer(1, 20))
|
||||
|
||||
# 添加生成时间
|
||||
time_str = datetime.now().strftime("%Y年%m月%d日 %H:%M:%S")
|
||||
time_para = Paragraph(f"生成时间:{time_str}", self.styles['ReportBody'])
|
||||
story.append(time_para)
|
||||
story.append(Spacer(1, 20))
|
||||
|
||||
# 添加各维度内容
|
||||
for section_title, content in content_dict.items():
|
||||
if content: # 只添加非空内容
|
||||
# 优化内容并转换为Markdown
|
||||
optimized_content = self._optimize_content(content)
|
||||
# 转换为PDF流对象
|
||||
# story.append(Paragraph(section_title, self.styles['ReportHeading']))
|
||||
story.extend(self._convert_markdown_to_flowables(optimized_content))
|
||||
story.append(Spacer(1, 20))
|
||||
|
||||
# 生成PDF
|
||||
doc.build(story)
|
||||
logger.info(f"PDF报告已生成: {filepath}")
|
||||
return filepath
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"生成PDF报告失败: {str(e)}")
|
||||
return None
|
||||
|
||||
# 使用示例
|
||||
if __name__ == "__main__":
|
||||
# 设置日志级别
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
# 创建PDF生成器实例
|
||||
generator = PDFGenerator()
|
||||
|
||||
# 示例内容
|
||||
test_content = {
|
||||
"公司简介": """# 公司简介
|
||||
这是一段公司简介的内容...
|
||||
|
||||
## 主营业务
|
||||
- 业务1
|
||||
- 业务2
|
||||
- 业务3
|
||||
|
||||
## 发展历程
|
||||
1. 2020年成立
|
||||
2. 2021年上市
|
||||
3. 2022年扩张""",
|
||||
"财务分析": """# 财务分析
|
||||
## 收入情况
|
||||
2023年收入达到100亿...
|
||||
|
||||
## 利润分析
|
||||
净利润同比增长20%...""",
|
||||
"行业分析": """# 行业分析
|
||||
## 市场格局
|
||||
目前市场呈现...""",
|
||||
"投资建议": """# 投资建议
|
||||
## 优势
|
||||
- 优势1
|
||||
- 优势2
|
||||
|
||||
## 风险
|
||||
- 风险1
|
||||
- 风险2"""
|
||||
}
|
||||
|
||||
# 生成PDF
|
||||
filepath = generator.generate_pdf(
|
||||
title="测试报告",
|
||||
content_dict=test_content,
|
||||
filename="test_report.pdf"
|
||||
)
|
||||
|
||||
if filepath:
|
||||
print(f"报告已生成: {filepath}")
|
||||
else:
|
||||
print("报告生成失败")
|
|
@ -0,0 +1,330 @@
|
|||
import logging
|
||||
from typing import List, Dict, Optional
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
import os
|
||||
from openai import OpenAI
|
||||
|
||||
# 设置日志记录
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# API配置
|
||||
API_KEY = "28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93" # 请填入火山引擎的 API Key
|
||||
MODEL = "doubao-1-5-pro-32k-250115" # 请填入火山引擎的模型名称
|
||||
|
||||
# 数据库配置
|
||||
DB_CONFIG = {
|
||||
'host': '192.168.1.82',
|
||||
'port': 3306,
|
||||
'user': 'root',
|
||||
'password': 'Chlry$%.8',
|
||||
'database': 'db_gp_cj'
|
||||
}
|
||||
|
||||
# 初始化OpenAI客户端
|
||||
client = OpenAI(
|
||||
base_url="https://ark.cn-beijing.volces.com/api/v3/",
|
||||
api_key=API_KEY
|
||||
)
|
||||
|
||||
def connect_to_db():
|
||||
"""连接到数据库"""
|
||||
try:
|
||||
connection_string = f"mysql+pymysql://{DB_CONFIG['user']}:{DB_CONFIG['password']}@{DB_CONFIG['host']}:{DB_CONFIG['port']}/{DB_CONFIG['database']}"
|
||||
engine = create_engine(connection_string)
|
||||
return engine
|
||||
except Exception as e:
|
||||
logger.error(f"数据库连接失败: {str(e)}")
|
||||
raise
|
||||
|
||||
def load_category_list():
|
||||
"""加载类别列表"""
|
||||
try:
|
||||
# 使用项目根目录构建文件路径
|
||||
file_path = os.path.join(ROOT_DIR, 'data', '字典表.txt')
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
categories = [line.strip() for line in f if line.strip()]
|
||||
return categories
|
||||
except Exception as e:
|
||||
logger.error(f"加载类别列表失败: {str(e)}")
|
||||
raise
|
||||
|
||||
def create_category_table(engine):
|
||||
"""创建产品类别表"""
|
||||
try:
|
||||
with engine.connect() as conn:
|
||||
conn.execute(text("""
|
||||
CREATE TABLE IF NOT EXISTS gp_product_category (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
category_name VARCHAR(100) NOT NULL,
|
||||
product_name VARCHAR(200) NOT NULL,
|
||||
stock_code VARCHAR(20) NOT NULL,
|
||||
stock_name VARCHAR(50) NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
INDEX idx_stock_code (stock_code),
|
||||
INDEX idx_product_name (product_name)
|
||||
)
|
||||
"""))
|
||||
conn.commit()
|
||||
except Exception as e:
|
||||
logger.error(f"创建表失败: {str(e)}")
|
||||
raise
|
||||
|
||||
def get_company_categorization_prompt(stock_name: str, products: List[str], categories: List[str]) -> str:
|
||||
"""生成企业产品分类的提示词"""
|
||||
prompt = f"""你是一个专业的产品分类专家。请将以下企业的产品名称分类到最合适的类别中。
|
||||
|
||||
企业名称:{stock_name}
|
||||
|
||||
产品列表:
|
||||
{chr(10).join(f"- {product}" for product in products)}
|
||||
|
||||
可选的类别列表:
|
||||
{chr(10).join(f"- {category}" for category in categories)}
|
||||
|
||||
请为每个产品选择最合适的类别。如果产品名称与多个类别相关,选择最匹配的一个。
|
||||
如果确实无法确定类别,请返回"其他"。
|
||||
|
||||
请按照以下格式返回结果(每行一个产品,用制表符分隔产品名和类别):
|
||||
产品名称1 类别1
|
||||
产品名称2 类别2
|
||||
...
|
||||
"""
|
||||
return prompt
|
||||
|
||||
def categorize_company_products(stock_name: str, products: List[str], categories: List[str]) -> Dict[str, str]:
|
||||
"""调用API对企业产品进行分类"""
|
||||
try:
|
||||
# 构建系统提示语
|
||||
system_message = {
|
||||
"role": "system",
|
||||
"content": """你是一个专业的产品分类专家。你的任务是准确地将产品名称分类到预定义的类别中。
|
||||
请仔细分析产品名称,考虑其功能、用途和行业特点,选择最匹配的类别。
|
||||
如果产品名称与多个类别相关,选择最匹配的一个。
|
||||
如果确实无法确定类别,请返回"其他"。
|
||||
请按照指定格式返回结果,每行一个产品,用制表符分隔产品名和类别。
|
||||
注意:请确保返回的类别名称完全匹配预定义类别列表中的名称。"""
|
||||
}
|
||||
|
||||
# 构建用户消息
|
||||
user_message = {
|
||||
"role": "user",
|
||||
"content": get_company_categorization_prompt(stock_name, products, categories)
|
||||
}
|
||||
|
||||
# 调用OpenAI API
|
||||
completion = client.chat.completions.create(
|
||||
model=MODEL,
|
||||
messages=[system_message, user_message],
|
||||
temperature=0.3
|
||||
)
|
||||
|
||||
content = completion.choices[0].message.content.strip()
|
||||
|
||||
# 打印原始返回内容以便调试
|
||||
print("\nAPI返回的原始内容:")
|
||||
print(content)
|
||||
|
||||
# 解析返回结果
|
||||
category_mapping = {}
|
||||
for line in content.split('\n'):
|
||||
line = line.strip()
|
||||
if not line: # 跳过空行
|
||||
continue
|
||||
|
||||
# 尝试不同的分隔符
|
||||
if '\t' in line:
|
||||
parts = line.split('\t')
|
||||
elif ' ' in line:
|
||||
# 使用第一个空格分割,保留产品名中的其他空格
|
||||
parts = line.split(' ', 1)
|
||||
else:
|
||||
print(f"警告:无法解析的行: {line}")
|
||||
continue
|
||||
|
||||
if len(parts) != 2:
|
||||
print(f"警告:格式不正确的行: {line}")
|
||||
continue
|
||||
|
||||
product, category = parts
|
||||
product = product.strip()
|
||||
category = category.strip()
|
||||
|
||||
# 验证类别是否在预定义类别中
|
||||
if category not in categories:
|
||||
print(f"警告:未知类别 '{category}',将使用'其他'")
|
||||
category = "其他"
|
||||
|
||||
# 确保产品名称完整
|
||||
if product not in products:
|
||||
print(f"警告:产品名称不匹配 '{product}',将使用原始名称")
|
||||
product = next((p for p in products if p in product or product in p), product)
|
||||
|
||||
category_mapping[product] = category
|
||||
|
||||
if not category_mapping:
|
||||
print("警告:没有成功解析任何分类结果")
|
||||
return {}
|
||||
|
||||
return category_mapping
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"产品分类失败: {str(e)}")
|
||||
return {}
|
||||
|
||||
def process_company_products():
|
||||
"""处理每个企业的产品并保存分类结果"""
|
||||
try:
|
||||
# 连接数据库
|
||||
engine = connect_to_db()
|
||||
|
||||
# 创建类别表
|
||||
create_category_table(engine)
|
||||
|
||||
# 加载类别列表
|
||||
categories = load_category_list()
|
||||
|
||||
while True:
|
||||
# 获取一个未处理企业的所有产品
|
||||
with engine.connect() as conn:
|
||||
query = """
|
||||
SELECT DISTINCT m.stock_code, m.stock_name, m.product_name
|
||||
FROM gp_main_business m
|
||||
LEFT JOIN gp_product_category c
|
||||
ON m.stock_code = c.stock_code
|
||||
AND m.product_name = c.product_name
|
||||
WHERE c.id IS NULL
|
||||
AND m.product_name IS NOT NULL
|
||||
AND m.product_name != ''
|
||||
GROUP BY m.stock_code, m.stock_name
|
||||
LIMIT 1
|
||||
"""
|
||||
company = pd.read_sql(query, conn)
|
||||
|
||||
if company.empty:
|
||||
print("所有产品都已处理完成!")
|
||||
break
|
||||
|
||||
stock_code = company['stock_code'].iloc[0]
|
||||
stock_name = company['stock_name'].iloc[0]
|
||||
|
||||
# 获取该企业的所有未处理产品
|
||||
query = f"""
|
||||
SELECT DISTINCT product_name
|
||||
FROM gp_main_business
|
||||
WHERE stock_code = '{stock_code}'
|
||||
AND product_name NOT IN (
|
||||
SELECT product_name
|
||||
FROM gp_product_category
|
||||
WHERE stock_code = '{stock_code}'
|
||||
)
|
||||
AND product_name IS NOT NULL
|
||||
AND product_name != ''
|
||||
"""
|
||||
products = pd.read_sql(query, conn)
|
||||
|
||||
if products.empty:
|
||||
continue
|
||||
|
||||
product_list = products['product_name'].tolist()
|
||||
|
||||
# 调用API进行分类
|
||||
print(f"\n处理企业:{stock_name} ({stock_code})")
|
||||
print(f"产品数量:{len(product_list)}")
|
||||
print("\n产品列表:")
|
||||
for product in product_list:
|
||||
print(f"- {product}")
|
||||
|
||||
category_mapping = categorize_company_products(stock_name, product_list, categories)
|
||||
|
||||
if not category_mapping:
|
||||
print("\n警告:未能获取分类结果,将使用'其他'类别")
|
||||
category_mapping = {product: "其他" for product in product_list}
|
||||
|
||||
# 显示分类结果
|
||||
print("\n分类结果:")
|
||||
for product, category in category_mapping.items():
|
||||
print(f"{product} -> {category}")
|
||||
|
||||
# 自动保存分类结果
|
||||
with engine.connect() as conn:
|
||||
for product, category in category_mapping.items():
|
||||
insert_query = """
|
||||
INSERT INTO gp_product_category
|
||||
(category_name, product_name, stock_code, stock_name)
|
||||
VALUES (:category_name, :product_name, :stock_code, :stock_name)
|
||||
"""
|
||||
conn.execute(text(insert_query),
|
||||
{"category_name": category,
|
||||
"product_name": product,
|
||||
"stock_code": stock_code,
|
||||
"stock_name": stock_name})
|
||||
conn.commit()
|
||||
print(f"已保存 {stock_name} 的分类结果")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"处理产品失败: {str(e)}")
|
||||
raise
|
||||
|
||||
def update_product_categories_by_rules(category_rules: List[Dict[str, str]]):
|
||||
"""
|
||||
根据给定的规则批量更新产品分类
|
||||
|
||||
Args:
|
||||
category_rules: 分类规则列表,每个规则是一个字典,格式为:
|
||||
{
|
||||
"category": "类别名称",
|
||||
"products": "产品1,产品2,产品3,..."
|
||||
}
|
||||
"""
|
||||
try:
|
||||
# 连接数据库
|
||||
engine = connect_to_db()
|
||||
|
||||
with engine.connect() as conn:
|
||||
for rule in category_rules:
|
||||
category = rule["category"]
|
||||
products = [p.strip() for p in rule["products"].split(",")]
|
||||
|
||||
# 构建 IN 查询条件
|
||||
products_str = "','".join(products)
|
||||
update_query = f"""
|
||||
UPDATE gp_product_category
|
||||
SET category_name = '{category}'
|
||||
WHERE product_name IN ('{products_str}')
|
||||
"""
|
||||
|
||||
# 执行更新
|
||||
result = conn.execute(text(update_query))
|
||||
conn.commit()
|
||||
|
||||
print(f"已更新 {result.rowcount} 条记录到类别 '{category}'")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"批量更新产品分类失败: {str(e)}")
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 设置日志级别
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
# 示例:使用规则更新分类
|
||||
category_rules = [
|
||||
{
|
||||
"category": "其他汽车零部件",
|
||||
"num": 25,
|
||||
"products": "其他汽车零部件,汽车零部件制造,汽车检具,工装模具及汽车零部件,汽车应用类,缓速器,汽车件,汽车产品,汽车类零部件,汽车及工业产品,汽车部品,汽车、轨道交通构件,功能件,冲压业务,汽车零部件收入"
|
||||
}
|
||||
]
|
||||
|
||||
# 更新分类
|
||||
# update_product_categories_by_rules(category_rules)
|
||||
|
||||
# 处理产品
|
||||
process_company_products()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,440 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.23999999999999994,6,-43674.7795507625
|
||||
SZ002340,0.23999999999999994,3,-245180.90374090202
|
||||
SZ000733,0.23999999999999994,3,-347623.76533204206
|
||||
SH601615,0.23999999999999994,7,-1615082.4259089434
|
||||
SH688005,0.23999999999999994,10,-834109.4481901171
|
||||
SZ002180,0.23999999999999994,4,-176132.27621242419
|
||||
SZ000723,0.23999999999999994,4,-752573.2644316294
|
||||
SZ002384,0.23999999999999994,8,1473846.791206649
|
||||
SH600885,0.23999999999999994,4,-539707.3907344582
|
||||
SZ000009,0.23999999999999994,9,-127072.46795410744
|
||||
SZ300285,0.23999999999999994,2,-436343.7380088445
|
||||
SH605358,0.23999999999999994,4,-2129677.3155513634
|
||||
SH601555,0.23999999999999994,2,7402.496042942948
|
||||
SH601117,0.23999999999999994,7,-1428770.9231015937
|
||||
SZ002385,0.23999999999999994,4,-1043581.0961502332
|
||||
SH688099,0.23999999999999994,5,-1818086.9533308106
|
||||
SH600884,0.23999999999999994,6,-1746854.5990375176
|
||||
SH600298,0.23999999999999994,2,133811.5536163634
|
||||
SH600399,0.23999999999999994,9,-648985.3287744978
|
||||
SZ002028,0.23999999999999994,8,916571.1877096295
|
||||
SH603613,0.23999999999999994,8,-2208393.878560411
|
||||
SZ300037,0.23999999999999994,6,-1159365.1137836596
|
||||
SH600765,0.23999999999999994,9,710357.9660585419
|
||||
SH600256,0.23999999999999994,1,-3968.097514121813
|
||||
SH600487,0.23999999999999994,12,1018112.6903361101
|
||||
SH600563,0.23999999999999994,7,-930007.7334416698
|
||||
SH600754,0.23999999999999994,11,-95179.30858576507
|
||||
SZ002185,0.23999999999999994,1,-174280.51580036187
|
||||
SZ300363,0.23999999999999994,4,-628917.4695524463
|
||||
SH601636,0.23999999999999994,1,-315662.8945801073
|
||||
SZ300751,0.23999999999999994,6,-92671.31444464304
|
||||
SZ300088,0.23999999999999994,5,-310461.5121726807
|
||||
SH603589,0.23999999999999994,6,153998.43266561982
|
||||
SZ000630,0.23999999999999994,5,-229648.1420479194
|
||||
SZ000988,0.23999999999999994,7,666193.2762578272
|
||||
SZ002268,0.23999999999999994,18,-940833.9327761073
|
||||
SZ002353,0.23999999999999994,5,-1261328.7973129307
|
||||
SH601689,0.23999999999999994,7,2012876.7123287672
|
||||
SH601168,0.23999999999999994,7,-261377.75598651802
|
||||
SZ300763,0.23999999999999994,11,-2106435.2415100574
|
||||
SH600141,0.23999999999999994,9,-1878681.1836915673
|
||||
SH600392,0.23999999999999994,6,-1829445.0393971722
|
||||
SZ000932,0.23999999999999994,2,-6414.174338192999
|
||||
SH603267,0.23999999999999994,5,-1418059.5726983906
|
||||
SZ300699,0.23999999999999994,7,-1457697.693979897
|
||||
SH600233,0.23999999999999994,1,-15445.359583114072
|
||||
SZ000728,0.23999999999999994,2,-224139.38823790126
|
||||
SH600516,0.23999999999999994,3,-272761.19589548017
|
||||
SZ300058,0.23999999999999994,8,1005779.3872667413
|
||||
SH600486,0.23999999999999994,3,-562409.3238461512
|
||||
SZ002797,0.23999999999999994,3,-148143.19422076663
|
||||
SH603456,0.23999999999999994,9,14617.140872640477
|
||||
SH603077,0.23999999999999994,6,-786827.0450873834
|
||||
SZ002138,0.23999999999999994,6,-147493.23408601043
|
||||
SH600862,0.23999999999999994,6,-341473.4067102635
|
||||
SZ300146,0.23999999999999994,2,-122617.02389449952
|
||||
SZ300223,0.23999999999999994,6,-2164086.3447719263
|
||||
SZ300136,0.23999999999999994,2,-661995.9748293064
|
||||
SH600188,0.23999999999999994,1,56099.89976612109
|
||||
SH600418,0.23999999999999994,13,1396486.0506442387
|
||||
SH600705,0.23999999999999994,4,-226699.74806433936
|
||||
SZ000960,0.23999999999999994,6,-1576698.2539201605
|
||||
SZ300308,0.23999999999999994,6,253170.8435795936
|
||||
SH688065,0.23999999999999994,5,-793622.7606358915
|
||||
SZ300253,0.23999999999999994,7,-1113143.3516747663
|
||||
SZ002080,0.23999999999999994,6,-1541985.6482786287
|
||||
SZ000998,0.23999999999999994,3,-108698.54774709925
|
||||
SH688536,0.23999999999999994,8,-2023634.1965992777
|
||||
SZ002092,0.23999999999999994,2,-200955.6268795189
|
||||
SH600875,0.23999999999999994,5,1133313.3754040324
|
||||
SZ000547,0.23999999999999994,5,-450690.60968294216
|
||||
SZ002409,0.23999999999999994,13,270988.3208274777
|
||||
SH600482,0.23999999999999994,3,111240.37890277478
|
||||
SH600521,0.23999999999999994,9,86256.12749127208
|
||||
SZ000807,0.23999999999999994,9,1055574.6051145988
|
||||
SH600733,0.23999999999999994,2,-634395.4619477554
|
||||
SH600988,0.23999999999999994,7,-433270.39680435037
|
||||
SZ000039,0.23999999999999994,2,-98696.25147860739
|
||||
SZ300296,0.23999999999999994,2,-152174.19326647877
|
||||
SZ002439,0.23999999999999994,6,234416.22751562507
|
||||
SZ002212,0.23999999999999994,1,-751249.3920035734
|
||||
SZ300418,0.23999999999999994,7,1267089.373918294
|
||||
SZ002078,0.23999999999999994,3,226101.00604063214
|
||||
SZ002223,0.23999999999999994,7,524930.0906560356
|
||||
SH603893,0.23999999999999994,7,-2988859.4851462715
|
||||
SZ002191,0.23999999999999994,5,-597532.4663337575
|
||||
SZ002030,0.23999999999999994,5,-1099278.1718986314
|
||||
SH600699,0.23999999999999994,7,-1128495.6012393427
|
||||
SZ002603,0.23999999999999994,3,1288123.2876712326
|
||||
SH600160,0.23999999999999994,3,220775.38101632416
|
||||
SZ002444,0.23999999999999994,8,-519355.2882119186
|
||||
SH601198,0.23999999999999994,3,135985.73668344688
|
||||
SZ300724,0.23999999999999994,12,-61472.84610050509
|
||||
SH600637,0.23999999999999994,1,11196.223620881161
|
||||
SZ300474,0.23999999999999994,11,661454.4890616687
|
||||
SZ002465,0.23999999999999994,1,1331.3315903262192
|
||||
SH603605,0.23999999999999994,3,-196393.47310201934
|
||||
SH600497,0.23999999999999994,6,-49359.44538289862
|
||||
SZ300383,0.23999999999999994,3,-1175522.8085433359
|
||||
SZ002507,0.23999999999999994,6,-1089443.7609141374
|
||||
SZ002557,0.23999999999999994,8,-1163436.976238242
|
||||
SH600549,0.23999999999999994,9,-645796.9774843798
|
||||
SZ000739,0.23999999999999994,6,-1437007.8107000138
|
||||
SH600529,0.23999999999999994,8,198301.5248332062
|
||||
SH600704,0.23999999999999994,1,-91194.22216194228
|
||||
SH603290,0.23999999999999994,10,-907704.3653794175
|
||||
SZ002508,0.23999999999999994,6,-195018.33632810984
|
||||
SH600038,0.23999999999999994,5,101680.88786086303
|
||||
SZ002739,0.23999999999999994,6,313580.80695160123
|
||||
SH603198,0.23999999999999994,9,1474984.254470205
|
||||
SZ002156,0.23999999999999994,9,-411596.6873152375
|
||||
SZ000830,0.23999999999999994,4,-112833.66581817532
|
||||
SH600201,0.23999999999999994,1,-356130.5664030538
|
||||
SH600153,0.23999999999999994,1,128031.92337187794
|
||||
SH600369,0.23999999999999994,2,-46748.998771027036
|
||||
SZ000983,0.23999999999999994,4,737839.4078219854
|
||||
SH600642,0.23999999999999994,3,104425.72831278076
|
||||
SZ002299,0.23999999999999994,3,-220903.85156744884
|
||||
SZ000629,0.23999999999999994,2,15828.143060004426
|
||||
SZ002131,0.23999999999999994,5,648355.9816976431
|
||||
SZ000738,0.23999999999999994,6,-613838.8905420647
|
||||
SH603127,0.23999999999999994,8,-1854538.8303613751
|
||||
SH601016,0.23999999999999994,2,-231764.87279666594
|
||||
SZ000825,0.23999999999999994,1,-299907.85894576914
|
||||
SZ000623,0.23999999999999994,1,13621.199038528765
|
||||
SH600879,0.23999999999999994,1,214575.34246575335
|
||||
SH600859,0.23999999999999994,9,602461.4726134406
|
||||
SZ000519,0.23999999999999994,8,-5882.184342348366
|
||||
SH600039,0.23999999999999994,1,135844.80806376415
|
||||
SZ300618,0.23999999999999994,2,-575673.9780720558
|
||||
SH688521,0.23999999999999994,9,167754.32084751024
|
||||
SZ002273,0.23999999999999994,6,-733838.4543750377
|
||||
SH603444,0.23999999999999994,4,473382.7845193192
|
||||
SH600166,0.23999999999999994,6,1132664.3830453216
|
||||
SZ002422,0.23999999999999994,2,439890.4109589041
|
||||
SH600732,0.23999999999999994,2,452452.0547945205
|
||||
SZ000750,0.23999999999999994,1,46073.27415968562
|
||||
SZ002373,0.23999999999999994,2,-548778.1116796874
|
||||
SH600803,0.23999999999999994,7,-166430.6654421077
|
||||
SH600170,0.23999999999999994,1,-116717.77849339836
|
||||
SZ000050,0.23999999999999994,1,-615461.6288614838
|
||||
SZ000887,0.23999999999999994,9,-864060.0171343295
|
||||
SZ300357,0.23999999999999994,6,-259830.81251934665
|
||||
SH601699,0.23999999999999994,8,2415465.7534246575
|
||||
SZ000656,0.23999999999999994,4,-1564916.565337401
|
||||
SH600118,0.23999999999999994,3,-160609.4701839143
|
||||
SZ300070,0.23999999999999994,2,167533.72372686394
|
||||
SZ002372,0.23999999999999994,6,766722.0772655008
|
||||
SZ000400,0.23999999999999994,8,231119.15573763463
|
||||
SH600271,0.23999999999999994,2,-145996.14265563383
|
||||
SH600258,0.23999999999999994,8,974032.2236920728
|
||||
SZ002926,0.23999999999999994,4,159904.842238079
|
||||
SZ300017,0.23999999999999994,5,522779.95397356106
|
||||
SZ002153,0.23999999999999994,11,718834.4577565534
|
||||
SZ002152,0.23999999999999994,3,155020.15483689838
|
||||
SH600909,0.23999999999999994,2,-25378.865880474004
|
||||
SZ002195,0.23999999999999994,3,664917.8082191779
|
||||
SZ300168,0.23999999999999994,8,-828316.3926271113
|
||||
SZ002572,0.23999999999999994,8,-57738.98587654623
|
||||
SH600315,0.23999999999999994,2,-222532.41476629057
|
||||
SZ002065,0.23999999999999994,3,-919173.3883635276
|
||||
SH600066,0.23999999999999994,5,430822.87829553767
|
||||
SH600580,0.23999999999999994,5,-619638.4427281643
|
||||
SZ000975,0.23999999999999994,4,1113438.3561643837
|
||||
SH600027,0.23999999999999994,3,673452.0547945206
|
||||
SZ000997,0.23999999999999994,4,639423.455900024
|
||||
SH603218,0.23999999999999994,6,-1094571.368206742
|
||||
SH600536,0.23999999999999994,2,1537794.5205479453
|
||||
SZ002203,0.23999999999999994,2,15220.542859043773
|
||||
SH601005,0.23999999999999994,2,-146964.4117471273
|
||||
SZ002985,0.23999999999999994,3,-530708.9648837867
|
||||
SH600316,0.23999999999999994,2,-329106.02302721783
|
||||
SH600372,0.23999999999999994,5,-676339.0205785239
|
||||
SH603707,0.23999999999999994,3,-732052.9090152918
|
||||
SZ000027,0.23999999999999994,1,-18205.060818196755
|
||||
SZ000513,0.23999999999999994,3,-179884.73056256003
|
||||
SZ300182,0.23999999999999994,8,-484889.3924719917
|
||||
SZ002506,0.23999999999999994,7,-629274.8011164429
|
||||
SH603156,0.23999999999999994,1,34539.673571836945
|
||||
SZ002408,0.23999999999999994,4,-265761.98882982286
|
||||
SZ002056,0.23999999999999994,1,218890.41095890407
|
||||
SH600236,0.23999999999999994,4,-585278.6298415851
|
||||
SZ002266,0.23999999999999994,2,98583.2138389723
|
||||
SZ300001,0.23999999999999994,7,183258.2640955128
|
||||
SZ300244,0.23999999999999994,6,-1348365.6663205456
|
||||
SZ002250,0.23999999999999994,4,-1236883.8701983693
|
||||
SH600801,0.23999999999999994,5,-632807.7875214815
|
||||
SZ002019,0.23999999999999994,4,98996.162347109
|
||||
SH600208,0.23999999999999994,2,-21246.374663863266
|
||||
SZ300024,0.23999999999999994,7,811499.9671972424
|
||||
SH601872,0.23999999999999994,1,226561.64383561639
|
||||
SH600998,0.23999999999999994,5,-62757.65458552803
|
||||
SZ300630,0.23999999999999994,2,-628071.6641555955
|
||||
SZ002221,0.23999999999999994,5,322377.1526266744
|
||||
SZ002249,0.23999999999999994,4,-580761.33905444
|
||||
SZ000021,0.23999999999999994,6,-133785.12603808055
|
||||
SH600348,0.23999999999999994,4,628879.6741947427
|
||||
SZ300251,0.23999999999999994,8,780913.9572919909
|
||||
SH600415,0.23999999999999994,1,-114364.32394838487
|
||||
SH600535,0.23999999999999994,2,10537.194156114128
|
||||
SZ000878,0.23999999999999994,3,224362.0812382062
|
||||
SZ002831,0.23999999999999994,3,-263785.3499027486
|
||||
SZ000012,0.23999999999999994,4,186593.1349225884
|
||||
SZ300009,0.23999999999999994,5,106960.89173737177
|
||||
SH600728,0.23999999999999994,5,-564876.6158425147
|
||||
SZ000686,0.23999999999999994,4,189541.1683836488
|
||||
SZ002430,0.23999999999999994,5,99353.30435293843
|
||||
SH600171,0.23999999999999994,6,-1313776.3461297203
|
||||
SZ000537,0.23999999999999994,10,1177767.9637705728
|
||||
SZ300115,0.23999999999999994,11,-1750952.1539398138
|
||||
SZ002683,0.23999999999999994,8,-860264.9198327876
|
||||
SH601866,0.23999999999999994,2,-259384.2402137494
|
||||
SZ002745,0.23999999999999994,3,-942365.9858189356
|
||||
SZ000060,0.23999999999999994,1,211890.41095890413
|
||||
SH600718,0.23999999999999994,5,-506265.0986103118
|
||||
SH603568,0.23999999999999994,6,-531096.420630143
|
||||
SZ002127,0.23999999999999994,1,-148860.4217156336
|
||||
SZ002532,0.23999999999999994,8,-173544.424750229
|
||||
SH600390,0.23999999999999994,2,-46056.80706965229
|
||||
SZ300482,0.23999999999999994,8,-1209204.800701056
|
||||
SZ000970,0.23999999999999994,3,-458291.71995482803
|
||||
SH603858,0.23999999999999994,10,56872.496546835784
|
||||
SH600839,0.23999999999999994,1,-20908.56225212301
|
||||
SH600970,0.23999999999999994,5,-17011.139709318595
|
||||
SH600155,0.23999999999999994,3,59811.269067363595
|
||||
SZ002128,0.23999999999999994,5,-343492.1170389482
|
||||
SZ000690,0.23999999999999994,4,639617.5468495472
|
||||
SH600060,0.23999999999999994,4,978178.0821917808
|
||||
SH600282,0.23999999999999994,3,444577.9517286366
|
||||
SH600517,0.23999999999999994,4,-467707.47385875665
|
||||
SH600985,0.23999999999999994,8,94381.51089609615
|
||||
SH600498,0.23999999999999994,2,-595832.6304971089
|
||||
SZ300026,0.23999999999999994,14,698602.5833494622
|
||||
SH600380,0.23999999999999994,4,168850.26969483081
|
||||
SH600673,0.23999999999999994,5,60327.89388805776
|
||||
SZ000778,0.23999999999999994,4,-629749.4109840433
|
||||
SH603712,0.23999999999999994,7,-189961.25522112357
|
||||
SH600528,0.23999999999999994,2,-140854.43912439237
|
||||
SZ300212,0.23999999999999994,6,1555434.2511178956
|
||||
SZ300072,0.23999999999999994,3,-448857.5478313231
|
||||
SZ000930,0.23999999999999994,2,-96092.57708463911
|
||||
SH600325,0.23999999999999994,3,1100493.1506849318
|
||||
SH600667,0.23999999999999994,3,-216383.0745521786
|
||||
SH600782,0.23999999999999994,1,-317279.9096411712
|
||||
SZ000729,0.23999999999999994,2,445260.2739726028
|
||||
SZ002939,0.23999999999999994,4,-190143.77018231727
|
||||
SH600895,0.23999999999999994,2,-436846.6713415741
|
||||
SH600511,0.23999999999999994,5,-36669.540388873895
|
||||
SH603885,0.23999999999999994,8,732055.4394004385
|
||||
SH688006,0.23999999999999994,5,-1592064.7888262859
|
||||
SZ002294,0.23999999999999994,3,167105.45346341783
|
||||
SH601456,0.23999999999999994,5,149703.77497195348
|
||||
SZ000581,0.23999999999999994,2,171510.7895926126
|
||||
SH600500,0.23999999999999994,4,135773.67524935224
|
||||
SH600863,0.23999999999999994,5,-89700.10990962127
|
||||
SH601717,0.23999999999999994,6,-238559.2311273214
|
||||
SZ002505,0.23999999999999994,8,-1643618.5526090702
|
||||
SH601179,0.23999999999999994,2,-30915.683200300962
|
||||
SZ300315,0.23999999999999994,8,1352667.9198379198
|
||||
SH600216,0.23999999999999994,7,-609138.5430665831
|
||||
SH600755,0.23999999999999994,3,-74629.910846739
|
||||
SZ002396,0.23999999999999994,6,-937425.9309580742
|
||||
SZ000598,0.23999999999999994,1,40920.78618225126
|
||||
SH600297,0.23999999999999994,4,-697814.0837245702
|
||||
SZ002701,0.23999999999999994,1,-3085.778117467171
|
||||
SH600820,0.23999999999999994,2,-53811.814941572826
|
||||
SZ000709,0.23999999999999994,4,-306437.0205650789
|
||||
SH603927,0.23999999999999994,3,650917.8082191781
|
||||
SH603225,0.23999999999999994,3,-17558.46403724274
|
||||
SZ002670,0.23999999999999994,8,703704.5052741619
|
||||
SH600507,0.23999999999999994,2,-344692.65180842724
|
||||
SH603866,0.23999999999999994,3,-521144.11205804936
|
||||
SZ002595,0.23999999999999994,6,840986.8253094472
|
||||
SZ002004,0.23999999999999994,3,-149738.8182396688
|
||||
SZ002368,0.23999999999999994,6,1557835.6164383555
|
||||
SZ300376,0.23999999999999994,8,-1465521.0004717652
|
||||
SZ002146,0.23999999999999994,1,-332903.3189033188
|
||||
SZ002048,0.23999999999999994,6,-89949.67794416066
|
||||
SH600409,0.23999999999999994,2,-297789.44751456607
|
||||
SH600021,0.23999999999999994,9,684996.8578548955
|
||||
SH600446,0.23999999999999994,7,-135284.3908831667
|
||||
SH601778,0.23999999999999994,4,-241165.4712776163
|
||||
SZ300271,0.23999999999999994,4,326645.769091149
|
||||
SH601577,0.23999999999999994,1,88712.80619927283
|
||||
SH600827,0.23999999999999994,7,164399.5874588582
|
||||
SH688188,0.23999999999999994,11,617788.4243746779
|
||||
SH600131,0.23999999999999994,9,616242.14983013
|
||||
SH600808,0.23999999999999994,2,-203890.40443738308
|
||||
SZ002010,0.23999999999999994,5,-214139.5769006118
|
||||
SZ002925,0.23999999999999994,1,-172978.61045653457
|
||||
SH600663,0.23999999999999994,2,-84545.36781306674
|
||||
SZ300166,0.23999999999999994,7,-665625.6901477728
|
||||
SZ002124,0.23999999999999994,6,-511493.765948075
|
||||
SH600764,0.23999999999999994,7,-685527.9758283526
|
||||
SZ002690,0.23999999999999994,4,-75835.57119640318
|
||||
SZ000987,0.23999999999999994,2,-195615.5682460863
|
||||
SZ002174,0.23999999999999994,6,629400.5427588322
|
||||
SH600737,0.23999999999999994,2,282448.19885482185
|
||||
SH600908,0.23999999999999994,1,111991.45676830162
|
||||
SH603883,0.23999999999999994,8,-453434.7258024692
|
||||
SH603228,0.23999999999999994,6,-1248915.084637275
|
||||
SZ000883,0.23999999999999994,2,-257210.44089406607
|
||||
SZ002155,0.23999999999999994,6,1282182.4037307734
|
||||
SH600811,0.23999999999999994,3,-600240.107391387
|
||||
SH601106,0.23999999999999994,1,-116778.11648598696
|
||||
SZ002233,0.23999999999999994,1,80940.3385848245
|
||||
SZ002110,0.23999999999999994,1,-193260.27397260276
|
||||
SH600566,0.23999999999999994,1,226753.42465753428
|
||||
SZ002281,0.23999999999999994,7,2026525.265579026
|
||||
SH600158,0.23999999999999994,4,150661.94768058794
|
||||
SH600967,0.23999999999999994,1,9099.703182940557
|
||||
SH600707,0.23999999999999994,1,-196091.53041447204
|
||||
SH600572,0.23999999999999994,1,436246.5753424658
|
||||
SZ002440,0.23999999999999994,2,-55446.19512473103
|
||||
SZ000961,0.23999999999999994,2,-965105.679028499
|
||||
SZ000990,0.23999999999999994,2,-594968.0655555818
|
||||
SZ002183,0.23999999999999994,7,-278130.74736500153
|
||||
SH600435,0.23999999999999994,2,110460.64626986775
|
||||
SH601000,0.23999999999999994,1,215438.35616438347
|
||||
SZ000090,0.23999999999999994,5,99704.79287430948
|
||||
SZ000877,0.23999999999999994,2,-179201.93804078037
|
||||
SH600906,0.23999999999999994,2,-99517.17386772847
|
||||
SZ002429,0.23999999999999994,2,439315.06849315076
|
||||
SH688088,0.23999999999999994,9,-427312.1148504359
|
||||
SH600398,0.23999999999999994,4,807940.8638187079
|
||||
SH601200,0.23999999999999994,1,-77619.81786755417
|
||||
SZ002081,0.23999999999999994,1,-66738.88043294422
|
||||
SH600373,0.23999999999999994,2,225755.9012460336
|
||||
SH600037,0.23999999999999994,4,-952485.6179281805
|
||||
SZ002867,0.23999999999999994,3,441387.2193932439
|
||||
SH600376,0.23999999999999994,11,25957.20897034429
|
||||
SZ001914,0.23999999999999994,8,-558313.5825287102
|
||||
SZ002085,0.23999999999999994,7,261487.54323498294
|
||||
SH600167,0.23999999999999994,3,-220081.4814459467
|
||||
SZ000559,0.23999999999999994,3,-500042.5115762846
|
||||
SZ000959,0.23999999999999994,3,-449324.7652787983
|
||||
SZ000528,0.23999999999999994,1,-22071.621331391136
|
||||
SZ002416,0.23999999999999994,7,-14459.87490274635
|
||||
SH600195,0.23999999999999994,4,-238255.6153599094
|
||||
SH600329,0.23999999999999994,5,1102410.9589041097
|
||||
SH600259,0.23999999999999994,5,-1403866.8766314809
|
||||
SZ002434,0.23999999999999994,8,-215324.06540246654
|
||||
SH688321,0.23999999999999994,2,-459908.18142437574
|
||||
SH601718,0.23999999999999994,3,-156809.58588760858
|
||||
SH600026,0.23999999999999994,1,226657.53424657526
|
||||
SH603000,0.23999999999999994,9,3343287.6712328764
|
||||
SZ002038,0.23999999999999994,3,-164654.91405582882
|
||||
SH600120,0.23999999999999994,3,-284947.83479280164
|
||||
SZ002242,0.23999999999999994,2,-180779.46358353007
|
||||
SZ001965,0.23999999999999994,2,134344.25907719668
|
||||
SH601608,0.23999999999999994,2,-241493.13988022093
|
||||
SZ300133,0.23999999999999994,9,1499990.7962226463
|
||||
SH600126,0.23999999999999994,1,-26813.670831338677
|
||||
SZ002705,0.23999999999999994,4,-275473.0959059879
|
||||
SZ000402,0.23999999999999994,3,-464993.35730929306
|
||||
SZ000158,0.23999999999999994,8,-1375304.5059729
|
||||
SZ002390,0.23999999999999994,7,-1758455.1016589077
|
||||
SZ002387,0.23999999999999994,7,211899.79864642568
|
||||
SH601611,0.23999999999999994,2,-117538.91958813404
|
||||
SZ000758,0.23999999999999994,3,827563.5810156356
|
||||
SZ000415,0.23999999999999994,5,66417.40556438596
|
||||
SH600307,0.23999999999999994,1,-42153.20734215546
|
||||
SH601991,0.23999999999999994,6,828214.0197100405
|
||||
SH601598,0.23999999999999994,1,280627.5470204124
|
||||
SH603650,0.23999999999999994,7,-903995.9065298478
|
||||
SH600959,0.23999999999999994,1,-140231.6216793704
|
||||
SH688289,0.23999999999999994,1,-313049.8565376556
|
||||
SH600582,0.23999999999999994,3,389398.4746669768
|
||||
SH600643,0.23999999999999994,1,21366.661703394966
|
||||
SZ000563,0.23999999999999994,2,2317.887649553966
|
||||
SZ300257,0.23999999999999994,6,-848614.5105208516
|
||||
SH601958,0.23999999999999994,5,1535780.821917808
|
||||
SH600266,0.23999999999999994,7,730200.0751638908
|
||||
SZ000967,0.23999999999999994,1,-29095.75883393512
|
||||
SZ002399,0.23999999999999994,4,-825385.5926764316
|
||||
SH600056,0.23999999999999994,1,2151.1847995192393
|
||||
SZ002458,0.23999999999999994,4,1107684.9315068494
|
||||
SH601860,0.23999999999999994,1,-52849.00643384521
|
||||
SZ002563,0.23999999999999994,1,-38892.42318705994
|
||||
SZ003022,0.23999999999999994,13,-364249.4642036713
|
||||
SH601928,0.23999999999999994,4,1083328.7671232878
|
||||
SH600928,0.23999999999999994,1,-108188.82970308381
|
||||
SH600729,0.23999999999999994,3,324960.5830940388
|
||||
SZ002423,0.23999999999999994,5,70300.15271610071
|
||||
SH600968,0.23999999999999994,3,387179.0905988618
|
||||
SZ000937,0.23999999999999994,2,450438.35616438364
|
||||
SH600556,0.23999999999999994,11,-743833.9431495301
|
||||
SZ003035,0.23999999999999994,4,-620737.3731457555
|
||||
SH600649,0.23999999999999994,2,-144447.9980746712
|
||||
SH600787,0.23999999999999994,3,370729.19900128216
|
||||
SZ000028,0.23999999999999994,4,880452.0547945206
|
||||
SH600095,0.23999999999999994,13,1304873.8538465612
|
||||
SH600776,0.23999999999999994,6,-209306.48017921194
|
||||
SZ000031,0.23999999999999994,6,4142.774085372126
|
||||
SH600339,0.23999999999999994,5,1109602.7397260272
|
||||
SH600006,0.23999999999999994,7,-1611198.93277586
|
||||
SH603317,0.23999999999999994,6,500327.018795079
|
||||
SH600648,0.23999999999999994,4,-320142.22412696923
|
||||
SH600623,0.23999999999999994,2,-315058.51019633736
|
||||
SZ000062,0.23999999999999994,5,200654.69743051782
|
||||
SH600835,0.23999999999999994,5,-703933.362389107
|
||||
SZ002815,0.23999999999999994,3,-258904.85965067835
|
||||
SZ002424,0.23999999999999994,4,910092.9928223639
|
||||
SH600377,0.23999999999999994,1,55279.60882104716
|
||||
SH601139,0.23999999999999994,1,-85493.94819957169
|
||||
SH600299,0.23999999999999994,5,16935.144869784082
|
||||
SZ002948,0.23999999999999994,1,-130997.34930495129
|
||||
SZ000156,0.23999999999999994,3,98354.13973553944
|
||||
SZ002375,0.23999999999999994,5,-503704.1723574602
|
||||
SH600871,0.23999999999999994,1,212465.75342465754
|
||||
SZ300869,0.23999999999999994,1,-315929.3763211771
|
||||
SZ002302,0.23999999999999994,4,-345674.57053220057
|
||||
SH601228,0.23999999999999994,3,-204746.15346936608
|
||||
SH600639,0.23999999999999994,5,-874267.2713147431
|
||||
SH601298,0.23999999999999994,1,-5273.972602739588
|
||||
SH603379,0.23999999999999994,7,696080.2979047559
|
||||
SZ002945,0.23999999999999994,8,-208922.8332225199
|
||||
SZ002653,0.23999999999999994,8,1563206.2970911385
|
||||
SZ001872,0.23999999999999994,1,-181946.14910747032
|
||||
SH600823,0.23999999999999994,4,-1012634.7666783128
|
||||
SZ300741,0.23999999999999994,1,-175244.41893296523
|
||||
SH603056,0.23999999999999994,1,434712.32876712317
|
||||
SH601869,0.23999999999999994,5,155111.91156326624
|
||||
SH603786,0.23999999999999994,7,627636.9514816818
|
||||
SH603708,0.23999999999999994,2,137353.7448811492
|
||||
SZ000553,0.23999999999999994,5,-578522.740003638
|
||||
SH600350,0.23999999999999994,1,42420.46753100173
|
||||
SH600657,0.23999999999999994,2,280910.570705021
|
||||
SH603515,0.23999999999999994,2,-89726.10472652467
|
||||
SH603355,0.23999999999999994,6,55911.0146043969
|
||||
SH603719,0.23999999999999994,5,841904.7249719887
|
||||
SH601003,0.23999999999999994,3,-242322.08029099827
|
||||
SZ002946,0.23999999999999994,6,-166158.71718684668
|
||||
SH600917,0.23999999999999994,5,-55977.61636400802
|
||||
SZ002901,0.23999999999999994,7,211801.96585162956
|
||||
SH600903,0.23999999999999994,6,-434556.0797178237
|
||||
SH600956,0.23999999999999994,4,-1181595.5901998247
|
||||
SH601187,0.23999999999999994,1,-40634.25771244019
|
||||
SH603983,0.23999999999999994,3,-871427.2107680459
|
|
|
@ -0,0 +1,440 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.24999999999999994,6,-34174.77955076238
|
||||
SZ002340,0.24999999999999994,3,-235680.90374090194
|
||||
SZ000733,0.24999999999999994,3,-347623.76533204206
|
||||
SH601615,0.24999999999999994,7,-1615082.4259089434
|
||||
SH688005,0.24999999999999994,10,-797164.2427106651
|
||||
SZ002180,0.24999999999999994,4,-166632.27621242424
|
||||
SZ000723,0.24999999999999994,4,-752573.2644316294
|
||||
SZ002384,0.24999999999999994,9,1435834.7465416766
|
||||
SH600885,0.24999999999999994,4,-539707.3907344582
|
||||
SZ000009,0.24999999999999994,9,-89072.46795410733
|
||||
SZ300285,0.24999999999999994,2,-436343.7380088445
|
||||
SH605358,0.24999999999999994,4,-2129677.3155513634
|
||||
SH601555,0.24999999999999994,2,7402.496042942948
|
||||
SH601117,0.24999999999999994,7,-1419270.9231015937
|
||||
SZ002385,0.24999999999999994,4,-1043581.0961502332
|
||||
SH688099,0.24999999999999994,5,-1818086.9533308106
|
||||
SH600884,0.24999999999999994,6,-1746854.5990375176
|
||||
SH600298,0.24999999999999994,2,142927.99197252787
|
||||
SH600399,0.24999999999999994,9,-610985.3287744983
|
||||
SZ002028,0.24999999999999994,7,953995.8452438759
|
||||
SH603613,0.24999999999999994,6,-2402518.661542465
|
||||
SZ300037,0.24999999999999994,6,-1150056.8946055775
|
||||
SH600765,0.24999999999999994,8,759494.9523599121
|
||||
SH600256,0.24999999999999994,1,-3968.097514121813
|
||||
SH600487,0.24999999999999994,12,1073962.0054046034
|
||||
SH600563,0.24999999999999994,7,-901507.7334416701
|
||||
SH600754,0.24999999999999994,11,-338478.9869903226
|
||||
SZ002185,0.24999999999999994,1,-174280.51580036187
|
||||
SZ300363,0.24999999999999994,5,-1153048.6366468186
|
||||
SH601636,0.24999999999999994,1,-315662.8945801073
|
||||
SZ300751,0.24999999999999994,5,-300708.7505553808
|
||||
SZ300088,0.24999999999999994,5,-300961.51217268064
|
||||
SH603589,0.24999999999999994,6,182402.54225466104
|
||||
SZ000630,0.24999999999999994,5,-220627.59410271386
|
||||
SZ000988,0.24999999999999994,8,723001.4954359095
|
||||
SZ002268,0.24999999999999994,18,-845833.9327761072
|
||||
SZ002353,0.24999999999999994,5,-1261328.7973129307
|
||||
SH601689,0.24999999999999994,7,2098280.821917808
|
||||
SH601168,0.24999999999999994,7,-242377.7559865182
|
||||
SZ300763,0.24999999999999994,11,-2077935.2415100574
|
||||
SH600141,0.24999999999999994,9,-1869277.074102526
|
||||
SH600392,0.24999999999999994,6,-1819945.0393971722
|
||||
SZ000932,0.24999999999999994,2,3085.8256618069427
|
||||
SH603267,0.24999999999999994,5,-1418059.5726983906
|
||||
SZ300699,0.24999999999999994,7,-1438697.6939798968
|
||||
SH600233,0.24999999999999994,1,-15445.359583114072
|
||||
SZ000728,0.24999999999999994,2,-224139.38823790126
|
||||
SH600516,0.24999999999999994,3,-272761.19589548017
|
||||
SZ300058,0.24999999999999994,10,1071991.716033864
|
||||
SH600486,0.24999999999999994,3,-562409.3238461512
|
||||
SZ002797,0.24999999999999994,3,-148143.19422076663
|
||||
SH603456,0.24999999999999994,9,52329.46963976376
|
||||
SH603077,0.24999999999999994,6,-786827.0450873834
|
||||
SZ002138,0.24999999999999994,6,-137993.2340860105
|
||||
SH600862,0.24999999999999994,6,-341473.4067102635
|
||||
SZ300146,0.24999999999999994,2,-122617.02389449952
|
||||
SZ300223,0.24999999999999994,6,-2154586.3447719263
|
||||
SZ300136,0.24999999999999994,2,-661995.9748293064
|
||||
SH600188,0.24999999999999994,1,56099.89976612109
|
||||
SH600418,0.24999999999999994,13,1500890.1602332797
|
||||
SH600705,0.24999999999999994,4,-217199.7480643392
|
||||
SZ000960,0.24999999999999994,6,-1567198.2539201605
|
||||
SZ300308,0.24999999999999994,6,272074.95316863485
|
||||
SH688065,0.24999999999999994,5,-793622.7606358915
|
||||
SZ300253,0.24999999999999994,8,-1066602.2557843556
|
||||
SZ002080,0.24999999999999994,6,-1541985.6482786287
|
||||
SZ000998,0.24999999999999994,3,-108698.54774709925
|
||||
SH688536,0.24999999999999994,8,-2015093.1007088665
|
||||
SZ002092,0.24999999999999994,2,-200955.6268795189
|
||||
SH600875,0.24999999999999994,5,1180813.3754040326
|
||||
SZ000547,0.24999999999999994,5,-431690.60968294204
|
||||
SZ002409,0.24999999999999994,12,355241.7454850115
|
||||
SH600482,0.24999999999999994,3,120740.37890277487
|
||||
SH600521,0.24999999999999994,8,45928.473614992196
|
||||
SZ000807,0.24999999999999994,9,1083786.9338817222
|
||||
SH600733,0.24999999999999994,2,-634395.4619477554
|
||||
SH600988,0.24999999999999994,7,-414270.39680435054
|
||||
SZ000039,0.24999999999999994,2,-98696.25147860739
|
||||
SZ300296,0.24999999999999994,2,-152174.19326647877
|
||||
SZ002439,0.24999999999999994,5,281532.66587178945
|
||||
SZ002212,0.24999999999999994,1,-751249.3920035734
|
||||
SZ300418,0.24999999999999994,7,1314493.4835073352
|
||||
SZ002078,0.24999999999999994,3,235505.1156296732
|
||||
SZ002223,0.24999999999999994,7,572430.0906560353
|
||||
SH603893,0.24999999999999994,7,-2988859.4851462715
|
||||
SZ002191,0.24999999999999994,5,-588128.3567447163
|
||||
SZ002030,0.24999999999999994,5,-1099278.1718986314
|
||||
SH600699,0.24999999999999994,7,-1109495.6012393425
|
||||
SZ002603,0.24999999999999994,4,1344931.506849315
|
||||
SH600160,0.24999999999999994,3,219727.43581084468
|
||||
SZ002444,0.24999999999999994,9,-500547.0690338364
|
||||
SH601198,0.24999999999999994,3,135985.73668344688
|
||||
SZ300724,0.24999999999999994,12,22780.57855702832
|
||||
SH600637,0.24999999999999994,1,11196.223620881161
|
||||
SZ300474,0.24999999999999994,12,752810.653445231
|
||||
SZ002465,0.24999999999999994,1,1331.3315903262192
|
||||
SH603605,0.24999999999999994,3,-196393.47310201934
|
||||
SH600497,0.24999999999999994,6,-40914.23990344644
|
||||
SZ300383,0.24999999999999994,3,-1166022.8085433359
|
||||
SZ002507,0.24999999999999994,6,-1089443.7609141374
|
||||
SZ002557,0.24999999999999994,8,-1163436.976238242
|
||||
SH600549,0.24999999999999994,9,-608468.210361092
|
||||
SZ000739,0.24999999999999994,6,-1437007.8107000138
|
||||
SH600529,0.24999999999999994,7,366691.8039537818
|
||||
SH600704,0.24999999999999994,1,-91194.22216194228
|
||||
SH603290,0.24999999999999994,10,-880834.5023657188
|
||||
SZ002508,0.24999999999999994,6,-694048.6864327432
|
||||
SH600038,0.24999999999999994,4,-28103.386213273792
|
||||
SZ002739,0.24999999999999994,6,332484.91654064244
|
||||
SH603198,0.24999999999999994,9,1541388.3640592464
|
||||
SZ002156,0.24999999999999994,9,-533371.1596297836
|
||||
SZ000830,0.24999999999999994,4,-103429.55622913428
|
||||
SH600201,0.24999999999999994,1,-356130.5664030538
|
||||
SH600153,0.24999999999999994,1,128031.92337187794
|
||||
SH600369,0.24999999999999994,2,-46748.998771027036
|
||||
SZ000983,0.24999999999999994,5,773825.7091918485
|
||||
SH600642,0.24999999999999994,3,113158.60502510957
|
||||
SZ002299,0.24999999999999994,3,-211403.85156744893
|
||||
SZ000629,0.24999999999999994,2,25328.143060004542
|
||||
SZ002131,0.24999999999999994,5,495469.87147145625
|
||||
SZ000738,0.24999999999999994,6,-613838.8905420647
|
||||
SH603127,0.24999999999999994,9,-1835634.720772334
|
||||
SH601016,0.24999999999999994,2,-231764.87279666594
|
||||
SZ000825,0.24999999999999994,1,-299907.85894576914
|
||||
SZ000623,0.24999999999999994,1,13621.199038528765
|
||||
SH600879,0.24999999999999994,1,223212.3287671232
|
||||
SH600859,0.24999999999999994,9,659461.4726134406
|
||||
SZ000519,0.24999999999999994,8,41617.8156576521
|
||||
SH600039,0.24999999999999994,1,135844.80806376415
|
||||
SZ300618,0.24999999999999994,2,-575673.9780720558
|
||||
SH688521,0.24999999999999994,9,224466.64961463364
|
||||
SZ002273,0.24999999999999994,6,-724338.4543750377
|
||||
SH603444,0.24999999999999994,4,492382.7845193191
|
||||
SH600166,0.24999999999999994,7,939046.4338108333
|
||||
SZ002422,0.24999999999999994,2,458794.5205479453
|
||||
SH600732,0.24999999999999994,1,471356.1643835617
|
||||
SZ000750,0.24999999999999994,1,46073.27415968562
|
||||
SZ002373,0.24999999999999994,2,-539278.1116796873
|
||||
SH600803,0.24999999999999994,7,-156930.6654421079
|
||||
SH600170,0.24999999999999994,1,-116717.77849339836
|
||||
SZ000050,0.24999999999999994,1,-615461.6288614838
|
||||
SZ000887,0.24999999999999994,9,-837094.2637096718
|
||||
SZ300357,0.24999999999999994,6,-250330.8125193467
|
||||
SH601699,0.24999999999999994,8,2519773.9726027395
|
||||
SZ000656,0.24999999999999994,4,-1564916.565337401
|
||||
SH600118,0.24999999999999994,3,-151109.47018391412
|
||||
SZ300070,0.24999999999999994,2,177033.72372686406
|
||||
SZ002372,0.24999999999999994,5,814126.186854542
|
||||
SZ000400,0.24999999999999994,8,259139.70368284045
|
||||
SH600271,0.24999999999999994,2,-145996.14265563383
|
||||
SH600258,0.24999999999999994,7,1029977.429171525
|
||||
SZ002926,0.24999999999999994,4,169404.84223807906
|
||||
SZ300017,0.24999999999999994,5,550704.611507808
|
||||
SZ002153,0.24999999999999994,9,674072.9580668217
|
||||
SZ002152,0.24999999999999994,3,155020.15483689838
|
||||
SH600909,0.24999999999999994,2,-25378.865880474004
|
||||
SZ002195,0.24999999999999994,3,689390.4109589042
|
||||
SZ300168,0.24999999999999994,8,-799912.28303807
|
||||
SZ002572,0.24999999999999994,8,-19834.876287505016
|
||||
SH600315,0.24999999999999994,2,-222532.41476629057
|
||||
SZ002065,0.24999999999999994,3,-919173.3883635276
|
||||
SH600066,0.24999999999999994,5,458843.42624074337
|
||||
SH600580,0.24999999999999994,5,-619638.4427281643
|
||||
SZ000975,0.24999999999999994,3,1156239.7260273972
|
||||
SH600027,0.24999999999999994,3,701856.1643835616
|
||||
SZ000997,0.24999999999999994,4,667923.455900024
|
||||
SH603218,0.24999999999999994,6,-1085071.368206742
|
||||
SH600536,0.24999999999999994,2,1604294.520547945
|
||||
SZ002203,0.24999999999999994,2,15220.542859043773
|
||||
SH601005,0.24999999999999994,2,-146964.4117471273
|
||||
SZ002985,0.24999999999999994,3,-530708.9648837867
|
||||
SH600316,0.24999999999999994,2,-329106.02302721783
|
||||
SH600372,0.24999999999999994,5,-676339.0205785239
|
||||
SH603707,0.24999999999999994,3,-732052.9090152918
|
||||
SZ000027,0.24999999999999994,1,-18205.060818196755
|
||||
SZ000513,0.24999999999999994,3,-179884.73056256003
|
||||
SZ300182,0.24999999999999994,7,-456581.1732939095
|
||||
SZ002506,0.24999999999999994,6,-990325.7125181113
|
||||
SH603156,0.24999999999999994,1,34539.673571836945
|
||||
SZ002408,0.24999999999999994,4,-265761.98882982286
|
||||
SZ002056,0.24999999999999994,1,19059.269536669817
|
||||
SH600236,0.24999999999999994,4,-585278.6298415851
|
||||
SZ002266,0.24999999999999994,2,-164293.49848979473
|
||||
SZ300001,0.24999999999999994,6,211278.8120407184
|
||||
SZ300244,0.24999999999999994,6,-1348365.6663205456
|
||||
SZ002250,0.24999999999999994,4,-1236883.8701983693
|
||||
SH600801,0.24999999999999994,5,-623307.7875214815
|
||||
SZ002019,0.24999999999999994,4,98996.162347109
|
||||
SH600208,0.24999999999999994,2,-21246.374663863266
|
||||
SZ300024,0.24999999999999994,7,858999.9671972424
|
||||
SH601872,0.24999999999999994,1,235869.86301369872
|
||||
SH600998,0.24999999999999994,5,-62757.65458552803
|
||||
SZ300630,0.24999999999999994,2,-628071.6641555955
|
||||
SZ002221,0.24999999999999994,5,287461.48164385796
|
||||
SZ002249,0.24999999999999994,4,-580761.33905444
|
||||
SZ000021,0.24999999999999994,6,-105285.12603808066
|
||||
SH600348,0.24999999999999994,4,657092.0029618661
|
||||
SZ300251,0.24999999999999994,8,837913.9572919902
|
||||
SH600415,0.24999999999999994,1,-114364.32394838487
|
||||
SH600535,0.24999999999999994,2,29537.19415611413
|
||||
SZ000878,0.24999999999999994,3,233862.08123820624
|
||||
SZ002831,0.24999999999999994,3,-254285.3499027485
|
||||
SZ000012,0.24999999999999994,4,205593.1349225885
|
||||
SZ300009,0.24999999999999994,5,125960.89173737189
|
||||
SH600728,0.24999999999999994,5,-555760.1774863503
|
||||
SZ000686,0.24999999999999994,4,199041.16838364876
|
||||
SZ002430,0.24999999999999994,5,127853.30435293831
|
||||
SH600171,0.24999999999999994,6,-1304276.34612972
|
||||
SZ000537,0.24999999999999994,10,1061559.7094356033
|
||||
SZ300115,0.24999999999999994,11,-1722643.934761732
|
||||
SZ002683,0.24999999999999994,8,-1011498.0898804842
|
||||
SH601866,0.24999999999999994,2,-259384.2402137494
|
||||
SZ002745,0.24999999999999994,3,-942365.9858189356
|
||||
SZ000060,0.24999999999999994,1,221390.41095890402
|
||||
SH600718,0.24999999999999994,5,-496765.0986103117
|
||||
SH603568,0.24999999999999994,6,-521884.09186301986
|
||||
SZ002127,0.24999999999999994,1,-148860.4217156336
|
||||
SZ002532,0.24999999999999994,8,-164044.4247502291
|
||||
SH600390,0.24999999999999994,2,-46056.80706965229
|
||||
SZ300482,0.24999999999999994,8,-1180704.800701056
|
||||
SZ000970,0.24999999999999994,3,-458291.71995482803
|
||||
SH603858,0.24999999999999994,10,18509.764629653917
|
||||
SH600839,0.24999999999999994,1,-20908.56225212301
|
||||
SH600970,0.24999999999999994,6,-7702.920531236377
|
||||
SH600155,0.24999999999999994,3,69311.26906736357
|
||||
SZ002128,0.24999999999999994,5,-333992.11703894834
|
||||
SZ000690,0.24999999999999994,4,677617.5468495472
|
||||
SH600060,0.24999999999999994,4,1015986.3013698631
|
||||
SH600282,0.24999999999999994,3,463386.1709067187
|
||||
SH600517,0.24999999999999994,4,-467707.47385875665
|
||||
SH600985,0.24999999999999994,8,122881.51089609615
|
||||
SH600498,0.24999999999999994,2,-586332.6304971089
|
||||
SZ300026,0.24999999999999994,12,297560.29389737145
|
||||
SH600380,0.24999999999999994,4,178350.26969483093
|
||||
SH600673,0.24999999999999994,5,79040.22265518128
|
||||
SZ000778,0.24999999999999994,4,-629749.4109840433
|
||||
SH603712,0.24999999999999994,6,-164050.2963170139
|
||||
SH600528,0.24999999999999994,2,-140854.43912439237
|
||||
SZ300212,0.24999999999999994,6,1659934.2511178951
|
||||
SZ300072,0.24999999999999994,3,-448857.5478313231
|
||||
SZ000930,0.24999999999999994,2,-96092.57708463911
|
||||
SH600325,0.24999999999999994,3,1147897.2602739725
|
||||
SH600667,0.24999999999999994,3,-206883.07455217864
|
||||
SH600782,0.24999999999999994,1,-317279.9096411712
|
||||
SZ000729,0.24999999999999994,2,464260.27397260274
|
||||
SZ002939,0.24999999999999994,4,-190143.77018231727
|
||||
SH600895,0.24999999999999994,2,-483721.0738021395
|
||||
SH600511,0.24999999999999994,5,-17669.54038887372
|
||||
SH603885,0.24999999999999994,8,760555.4394004387
|
||||
SH688006,0.24999999999999994,5,-1592064.7888262859
|
||||
SZ002294,0.24999999999999994,3,176605.45346341765
|
||||
SH601456,0.24999999999999994,5,159203.77497195348
|
||||
SZ000581,0.24999999999999994,1,52322.02613257573
|
||||
SH600500,0.24999999999999994,4,-6496.972705584019
|
||||
SH600863,0.24999999999999994,5,-80200.10990962133
|
||||
SH601717,0.24999999999999994,6,-231072.92975745833
|
||||
SZ002505,0.24999999999999994,8,-1634118.5526090702
|
||||
SH601179,0.24999999999999994,2,-30915.683200300962
|
||||
SZ300315,0.24999999999999994,8,1409667.9198379198
|
||||
SH600216,0.24999999999999994,7,-599638.5430665831
|
||||
SH600755,0.24999999999999994,3,-74629.910846739
|
||||
SZ002396,0.24999999999999994,6,-927925.9309580743
|
||||
SZ000598,0.24999999999999994,1,40920.78618225126
|
||||
SH600297,0.24999999999999994,4,-697814.0837245702
|
||||
SZ002701,0.24999999999999994,1,-3085.778117467171
|
||||
SH600820,0.24999999999999994,2,-53811.814941572826
|
||||
SZ000709,0.24999999999999994,4,-296937.0205650787
|
||||
SH603927,0.24999999999999994,3,678650.6849315068
|
||||
SH603225,0.24999999999999994,3,-17558.46403724274
|
||||
SZ002670,0.24999999999999994,8,731916.8340412853
|
||||
SH600507,0.24999999999999994,2,-344692.65180842724
|
||||
SH603866,0.24999999999999994,3,-521144.11205804936
|
||||
SZ002595,0.24999999999999994,6,746058.8542004159
|
||||
SZ002004,0.24999999999999994,3,-149738.8182396688
|
||||
SZ002368,0.24999999999999994,5,1624047.9452054792
|
||||
SZ300376,0.24999999999999994,8,-1456021.0004717654
|
||||
SZ002146,0.24999999999999994,1,-332903.3189033188
|
||||
SZ002048,0.24999999999999994,6,-80545.56835511951
|
||||
SH600409,0.24999999999999994,2,-297789.44751456607
|
||||
SH600021,0.24999999999999994,8,484235.90509756823
|
||||
SH600446,0.24999999999999994,7,-97284.39088316646
|
||||
SH601778,0.24999999999999994,4,-241165.4712776163
|
||||
SZ300271,0.24999999999999994,4,-59084.30063086841
|
||||
SH601577,0.24999999999999994,1,88712.80619927283
|
||||
SH600827,0.24999999999999994,7,181194.1080068034
|
||||
SH688188,0.24999999999999994,11,664617.1914979655
|
||||
SH600131,0.24999999999999994,9,670653.1087342402
|
||||
SH600808,0.24999999999999994,2,-203890.40443738308
|
||||
SZ002010,0.24999999999999994,5,-214139.5769006118
|
||||
SZ002925,0.24999999999999994,1,-172978.61045653457
|
||||
SH600663,0.24999999999999994,2,-84545.36781306674
|
||||
SZ300166,0.24999999999999994,7,-637125.6901477729
|
||||
SZ002124,0.24999999999999994,6,-501993.765948075
|
||||
SH600764,0.24999999999999994,7,-676027.9758283526
|
||||
SZ002690,0.24999999999999994,4,-63547.89996352658
|
||||
SZ000987,0.24999999999999994,2,-195615.5682460863
|
||||
SZ002174,0.24999999999999994,6,695804.6523478734
|
||||
SH600737,0.24999999999999994,2,291948.1988548218
|
||||
SH600908,0.24999999999999994,1,111991.45676830162
|
||||
SH603883,0.24999999999999994,7,-416010.0682682226
|
||||
SH603228,0.24999999999999994,6,-1239415.084637275
|
||||
SZ000883,0.24999999999999994,2,-257210.44089406607
|
||||
SZ002155,0.24999999999999994,6,1340723.4996211838
|
||||
SH600811,0.24999999999999994,3,-600240.107391387
|
||||
SH601106,0.24999999999999994,1,-116778.11648598696
|
||||
SZ002233,0.24999999999999994,1,80940.3385848245
|
||||
SZ002110,0.24999999999999994,1,-193260.27397260276
|
||||
SH600566,0.24999999999999994,1,236253.42465753425
|
||||
SZ002281,0.24999999999999994,6,2111737.59434615
|
||||
SH600158,0.24999999999999994,4,179161.94768058794
|
||||
SH600967,0.24999999999999994,1,9099.703182940557
|
||||
SH600707,0.24999999999999994,1,-196091.53041447204
|
||||
SH600572,0.24999999999999994,2,453520.5479452056
|
||||
SZ002440,0.24999999999999994,2,-55446.19512473103
|
||||
SZ000961,0.24999999999999994,2,-965105.679028499
|
||||
SZ000990,0.24999999999999994,2,-594968.0655555818
|
||||
SZ002183,0.24999999999999994,7,-268630.7473650016
|
||||
SH600435,0.24999999999999994,2,119864.75585890887
|
||||
SH601000,0.24999999999999994,1,224458.90410958897
|
||||
SZ000090,0.24999999999999994,5,109204.79287430957
|
||||
SZ000877,0.24999999999999994,2,-179201.93804078037
|
||||
SH600906,0.24999999999999994,2,-99517.17386772847
|
||||
SZ002429,0.24999999999999994,2,458123.2876712327
|
||||
SH688088,0.24999999999999994,8,-351503.89567235403
|
||||
SH600398,0.24999999999999994,4,836344.9734077489
|
||||
SH601200,0.24999999999999994,1,-77619.81786755417
|
||||
SZ002081,0.24999999999999994,1,-66738.88043294422
|
||||
SH600373,0.24999999999999994,2,234201.10672548576
|
||||
SH600037,0.24999999999999994,4,-952485.6179281805
|
||||
SZ002867,0.24999999999999994,2,299338.1283725477
|
||||
SH600376,0.24999999999999994,11,-447637.4098378171
|
||||
SZ001914,0.24999999999999994,8,-558313.5825287102
|
||||
SZ002085,0.24999999999999994,7,280103.9815911473
|
||||
SH600167,0.24999999999999994,3,-220081.4814459467
|
||||
SZ000559,0.24999999999999994,3,-500042.5115762846
|
||||
SZ000959,0.24999999999999994,3,-449324.7652787983
|
||||
SZ000528,0.24999999999999994,1,-22071.621331391136
|
||||
SZ002416,0.24999999999999994,7,4540.1250972535345
|
||||
SH600195,0.24999999999999994,4,-238255.6153599094
|
||||
SH600329,0.24999999999999994,5,1147609.589041096
|
||||
SH600259,0.24999999999999994,5,-1403866.8766314809
|
||||
SZ002434,0.24999999999999994,8,-178091.1886901378
|
||||
SH688321,0.24999999999999994,2,-632794.5804530663
|
||||
SH601718,0.24999999999999994,3,-156809.58588760858
|
||||
SH600026,0.24999999999999994,1,236157.5342465753
|
||||
SH603000,0.24999999999999994,9,3476390.410958904
|
||||
SZ002038,0.24999999999999994,3,-164654.91405582882
|
||||
SH600120,0.24999999999999994,3,-284947.83479280164
|
||||
SZ002242,0.24999999999999994,2,-180779.46358353007
|
||||
SZ001965,0.24999999999999994,2,134344.25907719668
|
||||
SH601608,0.24999999999999994,2,-241493.13988022093
|
||||
SZ300133,0.24999999999999994,8,1201786.6994961689
|
||||
SH600126,0.24999999999999994,1,-26813.670831338677
|
||||
SZ002705,0.24999999999999994,4,-265973.0959059878
|
||||
SZ000402,0.24999999999999994,3,-464993.35730929306
|
||||
SZ000158,0.24999999999999994,8,-1346804.5059729
|
||||
SZ002390,0.24999999999999994,7,-1748955.1016589077
|
||||
SZ002387,0.24999999999999994,7,-3666.93826962628
|
||||
SH601611,0.24999999999999994,2,-117538.91958813404
|
||||
SZ000758,0.24999999999999994,4,724588.5163101249
|
||||
SZ000415,0.24999999999999994,5,66417.40556438596
|
||||
SH600307,0.24999999999999994,1,-42153.20734215546
|
||||
SH601991,0.24999999999999994,6,854987.9923127802
|
||||
SH601598,0.24999999999999994,1,280627.5470204124
|
||||
SH603650,0.24999999999999994,7,-875495.9065298475
|
||||
SH600959,0.24999999999999994,1,-140231.6216793704
|
||||
SH688289,0.24999999999999994,1,-313049.8565376556
|
||||
SH600582,0.24999999999999994,3,281923.3856419214
|
||||
SH600643,0.24999999999999994,1,21366.661703394966
|
||||
SZ000563,0.24999999999999994,2,2317.887649553966
|
||||
SZ300257,0.24999999999999994,6,-848614.5105208516
|
||||
SH601958,0.24999999999999994,4,1602184.9315068491
|
||||
SH600266,0.24999999999999994,7,628144.555242081
|
||||
SZ000967,0.24999999999999994,1,-29095.75883393512
|
||||
SZ002399,0.24999999999999994,4,-825385.5926764316
|
||||
SH600056,0.24999999999999994,1,2151.1847995192393
|
||||
SZ002458,0.24999999999999994,4,1155184.9315068494
|
||||
SH601860,0.24999999999999994,1,-52849.00643384521
|
||||
SZ002563,0.24999999999999994,1,-38892.42318705994
|
||||
SZ003022,0.24999999999999994,14,-279228.91625846596
|
||||
SH601928,0.24999999999999994,3,1123253.424657534
|
||||
SH600928,0.24999999999999994,1,-108188.82970308381
|
||||
SH600729,0.24999999999999994,3,342042.77487486054
|
||||
SZ002423,0.24999999999999994,5,89300.1527161006
|
||||
SH600968,0.24999999999999994,3,396679.0905988618
|
||||
SZ000937,0.24999999999999994,2,469342.4657534247
|
||||
SH600556,0.24999999999999994,11,-696333.9431495302
|
||||
SZ003035,0.24999999999999994,4,-620737.3731457555
|
||||
SH600649,0.24999999999999994,2,-144447.9980746712
|
||||
SH600787,0.24999999999999994,3,389729.1990012821
|
||||
SZ000028,0.24999999999999994,4,918356.1643835617
|
||||
SH600095,0.24999999999999994,12,1375702.620969849
|
||||
SH600776,0.24999999999999994,6,-180806.48017921177
|
||||
SZ000031,0.24999999999999994,6,23142.774085372097
|
||||
SH600339,0.24999999999999994,4,1157006.8493150685
|
||||
SH600006,0.24999999999999994,7,-1601698.9327758602
|
||||
SH603317,0.24999999999999994,7,538135.2379731609
|
||||
SH600648,0.24999999999999994,4,-320142.22412696923
|
||||
SH600623,0.24999999999999994,2,-315058.51019633736
|
||||
SZ000062,0.24999999999999994,5,210154.69743051793
|
||||
SH600835,0.24999999999999994,5,-694433.3623891072
|
||||
SZ002815,0.24999999999999994,3,-249404.85965067826
|
||||
SZ002424,0.24999999999999994,4,948092.9928223639
|
||||
SH600377,0.24999999999999994,1,55279.60882104716
|
||||
SH601139,0.24999999999999994,1,-85493.94819957169
|
||||
SH600299,0.24999999999999994,5,25763.911993071888
|
||||
SZ002948,0.24999999999999994,1,-130997.34930495129
|
||||
SZ000156,0.24999999999999994,3,107854.13973553933
|
||||
SZ002375,0.24999999999999994,5,-503704.1723574602
|
||||
SH600871,0.24999999999999994,1,221965.75342465757
|
||||
SZ300869,0.24999999999999994,1,-315929.3763211771
|
||||
SZ002302,0.24999999999999994,4,-345674.57053220057
|
||||
SH601228,0.24999999999999994,3,-204746.15346936608
|
||||
SH600639,0.24999999999999994,5,-874267.2713147431
|
||||
SH601298,0.24999999999999994,1,-5273.972602739588
|
||||
SH603379,0.24999999999999994,6,723333.72256229
|
||||
SZ002945,0.24999999999999994,8,-199422.83322251984
|
||||
SZ002653,0.24999999999999994,9,1499706.7853795919
|
||||
SZ001872,0.24999999999999994,1,-181946.14910747032
|
||||
SH600823,0.24999999999999994,4,-1012634.7666783128
|
||||
SZ300741,0.24999999999999994,1,-175244.41893296523
|
||||
SH603056,0.24999999999999994,1,453712.32876712317
|
||||
SH601869,0.24999999999999994,5,174111.91156326624
|
||||
SH603786,0.24999999999999994,7,674849.280248805
|
||||
SH603708,0.24999999999999994,2,137353.7448811492
|
||||
SZ000553,0.24999999999999994,5,-578522.740003638
|
||||
SH600350,0.24999999999999994,1,42420.46753100173
|
||||
SH600657,0.24999999999999994,2,290410.5707050209
|
||||
SH603515,0.24999999999999994,2,-89726.10472652467
|
||||
SH603355,0.24999999999999994,6,74911.01460439702
|
||||
SH603719,0.24999999999999994,5,898233.4920952762
|
||||
SH601003,0.24999999999999994,3,-242322.08029099827
|
||||
SZ002946,0.24999999999999994,6,-147542.2788306823
|
||||
SH600917,0.24999999999999994,5,-46477.61636400805
|
||||
SZ002901,0.24999999999999994,7,240301.9658516298
|
||||
SH600903,0.24999999999999994,6,-425056.07971782354
|
||||
SH600956,0.24999999999999994,4,-1181595.5901998247
|
||||
SH601187,0.24999999999999994,1,-40634.25771244019
|
||||
SH603983,0.24999999999999994,3,-861927.2107680459
|
|
|
@ -0,0 +1,440 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.25999999999999995,6,-24674.779550762265
|
||||
SZ002340,0.25999999999999995,3,-226180.9037409021
|
||||
SZ000733,0.25999999999999995,3,-347623.76533204206
|
||||
SH601615,0.25999999999999995,7,-1615082.4259089434
|
||||
SH688005,0.25999999999999995,10,-759260.1331216241
|
||||
SZ002180,0.25999999999999995,4,-157132.27621242424
|
||||
SZ000723,0.25999999999999995,4,-752573.2644316294
|
||||
SZ002384,0.25999999999999995,9,1530451.184897841
|
||||
SH600885,0.25999999999999995,4,-539707.3907344582
|
||||
SZ000009,0.25999999999999995,7,-265052.98758711474
|
||||
SZ300285,0.25999999999999995,2,-436343.7380088445
|
||||
SH605358,0.25999999999999995,4,-2129677.3155513634
|
||||
SH601555,0.25999999999999995,2,7402.496042942948
|
||||
SH601117,0.25999999999999995,7,-1410154.4847454294
|
||||
SZ002385,0.25999999999999995,4,-1043581.0961502332
|
||||
SH688099,0.25999999999999995,5,-1818086.9533308106
|
||||
SH600884,0.25999999999999995,6,-1746854.5990375176
|
||||
SH600298,0.25999999999999995,2,152427.99197252796
|
||||
SH600399,0.25999999999999995,9,-750021.593759173
|
||||
SZ002028,0.25999999999999995,7,991995.8452438756
|
||||
SH603613,0.25999999999999995,6,-2393018.661542465
|
||||
SZ300037,0.25999999999999995,6,-1140556.8946055772
|
||||
SH600765,0.25999999999999995,9,816303.1715379943
|
||||
SH600256,0.25999999999999995,1,-3968.097514121813
|
||||
SH600487,0.25999999999999995,12,1130674.3341717266
|
||||
SH600563,0.25999999999999995,7,-873007.7334416702
|
||||
SH600754,0.25999999999999995,11,-292992.6856204595
|
||||
SZ002185,0.25999999999999995,1,-174280.51580036187
|
||||
SZ300363,0.25999999999999995,4,-1383181.0353223062
|
||||
SH601636,0.25999999999999995,1,-315662.8945801073
|
||||
SZ300751,0.25999999999999995,5,-282188.2026101753
|
||||
SZ300088,0.25999999999999995,5,-291557.4025836395
|
||||
SH603589,0.25999999999999995,6,210902.54225466104
|
||||
SZ000630,0.25999999999999995,5,-211127.5941027138
|
||||
SZ000988,0.25999999999999995,8,779809.714613992
|
||||
SZ002268,0.25999999999999995,18,-751696.946474738
|
||||
SZ002353,0.25999999999999995,5,-1261328.7973129307
|
||||
SH601689,0.25999999999999995,6,1925082.1917808221
|
||||
SH601168,0.25999999999999995,7,-223953.09845227157
|
||||
SZ300763,0.25999999999999995,10,-2049818.803153893
|
||||
SH600141,0.25999999999999995,9,-1859777.074102526
|
||||
SH600392,0.25999999999999995,6,-1810445.0393971722
|
||||
SZ000932,0.25999999999999995,2,12202.264017971233
|
||||
SH603267,0.25999999999999995,5,-1418059.5726983906
|
||||
SZ300699,0.25999999999999995,7,-1419697.6939798968
|
||||
SH600233,0.25999999999999995,1,-15445.359583114072
|
||||
SZ000728,0.25999999999999995,2,-224139.38823790126
|
||||
SH600516,0.25999999999999995,3,-272761.19589548017
|
||||
SZ300058,0.25999999999999995,10,1137916.3735681106
|
||||
SH600486,0.25999999999999995,3,-562409.3238461512
|
||||
SZ002797,0.25999999999999995,3,-148143.19422076663
|
||||
SH603456,0.25999999999999995,9,90137.6888178456
|
||||
SH603077,0.25999999999999995,6,-786827.0450873834
|
||||
SZ002138,0.25999999999999995,6,-151737.9149370744
|
||||
SH600862,0.25999999999999995,6,-341473.4067102635
|
||||
SZ300146,0.25999999999999995,2,-122617.02389449952
|
||||
SZ300223,0.25999999999999995,6,-2145086.3447719263
|
||||
SZ300136,0.25999999999999995,2,-661995.9748293064
|
||||
SH600188,0.25999999999999995,1,56099.89976612109
|
||||
SH600418,0.25999999999999995,13,1605294.2698223214
|
||||
SH600705,0.25999999999999995,4,-207699.74806433925
|
||||
SZ000960,0.25999999999999995,6,-1557698.2539201607
|
||||
SZ300308,0.25999999999999995,6,290979.06275767594
|
||||
SH688065,0.25999999999999995,5,-793622.7606358915
|
||||
SZ300253,0.25999999999999995,8,-1019198.1461953141
|
||||
SZ002080,0.25999999999999995,6,-1541985.6482786287
|
||||
SZ000998,0.25999999999999995,3,-108698.54774709925
|
||||
SH688536,0.25999999999999995,8,-2005593.100708867
|
||||
SZ002092,0.25999999999999995,2,-200955.6268795189
|
||||
SH600875,0.25999999999999995,5,1227354.4712944434
|
||||
SZ000547,0.25999999999999995,5,-412690.6096829419
|
||||
SZ002409,0.25999999999999995,12,440262.2934302172
|
||||
SH600482,0.25999999999999995,2,-146600.768733355
|
||||
SH600521,0.25999999999999995,9,-101904.9194073613
|
||||
SZ000807,0.25999999999999995,9,1112286.9338817222
|
||||
SH600733,0.25999999999999995,2,-634395.4619477554
|
||||
SH600988,0.25999999999999995,7,-395270.3968043504
|
||||
SZ000039,0.25999999999999995,2,-98696.25147860739
|
||||
SZ300296,0.25999999999999995,2,-152174.19326647877
|
||||
SZ002439,0.25999999999999995,6,198265.68746650987
|
||||
SZ002212,0.25999999999999995,1,-751249.3920035734
|
||||
SZ300418,0.25999999999999995,7,1361897.5930963764
|
||||
SZ002078,0.25999999999999995,3,244909.22521871427
|
||||
SZ002223,0.25999999999999995,6,619834.2002450766
|
||||
SH603893,0.25999999999999995,7,-2988859.4851462715
|
||||
SZ002191,0.25999999999999995,5,-578628.3567447164
|
||||
SZ002030,0.25999999999999995,5,-1099278.1718986314
|
||||
SH600699,0.25999999999999995,6,-1090591.4916503015
|
||||
SZ002603,0.25999999999999995,4,1153972.6027397262
|
||||
SH600160,0.25999999999999995,3,229227.43581084488
|
||||
SZ002444,0.25999999999999995,9,-481547.06903383654
|
||||
SH601198,0.25999999999999995,3,135985.73668344688
|
||||
SZ300724,0.25999999999999995,12,-311809.958529367
|
||||
SH600637,0.25999999999999995,1,11196.223620881161
|
||||
SZ300474,0.25999999999999995,11,844262.7082397509
|
||||
SZ002465,0.25999999999999995,1,1331.3315903262192
|
||||
SH603605,0.25999999999999995,3,-196393.47310201934
|
||||
SH600497,0.25999999999999995,6,-31414.239903446352
|
||||
SZ300383,0.25999999999999995,2,-1351168.4713010378
|
||||
SZ002507,0.25999999999999995,6,-1089443.7609141374
|
||||
SZ002557,0.25999999999999995,8,-1163436.976238242
|
||||
SH600549,0.25999999999999995,9,-570947.6624158866
|
||||
SZ000739,0.25999999999999995,6,-1437007.8107000138
|
||||
SH600529,0.25999999999999995,7,204734.03057630121
|
||||
SH600704,0.25999999999999995,1,-91194.22216194228
|
||||
SH603290,0.25999999999999995,9,-855935.9052522449
|
||||
SZ002508,0.25999999999999995,6,-694048.6864327432
|
||||
SH600038,0.25999999999999995,4,-28103.386213273792
|
||||
SZ002739,0.25999999999999995,6,337389.02612968354
|
||||
SH603198,0.25999999999999995,9,1607504.8024154108
|
||||
SZ002156,0.25999999999999995,9,-476371.1596297836
|
||||
SZ000830,0.25999999999999995,4,-94313.11787296979
|
||||
SH600201,0.25999999999999995,1,-356130.5664030538
|
||||
SH600153,0.25999999999999995,1,128031.92337187794
|
||||
SH600369,0.25999999999999995,2,-46748.998771027036
|
||||
SZ000983,0.25999999999999995,4,809716.1201507526
|
||||
SH600642,0.25999999999999995,3,122658.60502510949
|
||||
SZ002299,0.25999999999999995,3,-202191.5228003256
|
||||
SZ000629,0.25999999999999995,2,34828.14306000466
|
||||
SZ002131,0.25999999999999995,5,299729.98466201517
|
||||
SZ000738,0.25999999999999995,6,-613838.8905420647
|
||||
SH603127,0.25999999999999995,8,-2127932.734340586
|
||||
SH601016,0.25999999999999995,2,-231764.87279666594
|
||||
SZ000825,0.25999999999999995,1,-299907.85894576914
|
||||
SZ000623,0.25999999999999995,1,13621.199038528765
|
||||
SH600879,0.25999999999999995,1,232712.32876712334
|
||||
SH600859,0.25999999999999995,9,289568.9003981262
|
||||
SZ000519,0.25999999999999995,9,88926.03483573406
|
||||
SH600039,0.25999999999999995,1,135844.80806376415
|
||||
SZ300618,0.25999999999999995,2,-575673.9780720558
|
||||
SH688521,0.25999999999999995,9,281370.7592036752
|
||||
SZ002273,0.25999999999999995,6,-942845.7133795503
|
||||
SH603444,0.25999999999999995,4,511095.11328644224
|
||||
SH600166,0.25999999999999995,8,565192.3318604334
|
||||
SZ002422,0.25999999999999995,2,477794.5205479452
|
||||
SH600732,0.25999999999999995,2,489972.6027397261
|
||||
SZ000750,0.25999999999999995,1,46073.27415968562
|
||||
SZ002373,0.25999999999999995,2,-529778.1116796873
|
||||
SH600803,0.25999999999999995,7,-147430.66544210783
|
||||
SH600170,0.25999999999999995,1,-116717.77849339836
|
||||
SZ000050,0.25999999999999995,1,-615461.6288614838
|
||||
SZ000887,0.25999999999999995,9,-808690.1541206308
|
||||
SZ300357,0.25999999999999995,6,-241022.59334126458
|
||||
SH601699,0.25999999999999995,8,2623123.287671233
|
||||
SZ000656,0.25999999999999995,4,-1564916.565337401
|
||||
SH600118,0.25999999999999995,3,-141609.47018391412
|
||||
SZ300070,0.25999999999999995,2,186533.723726864
|
||||
SZ002372,0.25999999999999995,4,860667.2827449532
|
||||
SZ000400,0.25999999999999995,9,435417.31325341994
|
||||
SH600271,0.25999999999999995,2,-145996.14265563383
|
||||
SH600258,0.25999999999999995,8,964907.5936598561
|
||||
SZ002926,0.25999999999999995,4,178904.84223807894
|
||||
SZ300017,0.25999999999999995,5,579204.6115078076
|
||||
SZ002153,0.25999999999999995,9,739805.8347791502
|
||||
SZ002152,0.25999999999999995,3,155020.15483689838
|
||||
SH600909,0.25999999999999995,2,-25378.865880474004
|
||||
SZ002195,0.25999999999999995,3,717410.9589041097
|
||||
SZ300168,0.25999999999999995,8,-771412.2830380701
|
||||
SZ002572,0.25999999999999995,8,15480.192205645624
|
||||
SH600315,0.25999999999999995,2,-222532.41476629057
|
||||
SZ002065,0.25999999999999995,3,-919173.3883635276
|
||||
SH600066,0.25999999999999995,5,487343.4262407435
|
||||
SH600580,0.25999999999999995,5,-619638.4427281643
|
||||
SZ000975,0.25999999999999995,4,1203068.493150685
|
||||
SH600027,0.25999999999999995,3,730356.1643835616
|
||||
SZ000997,0.25999999999999995,4,696423.4559000242
|
||||
SH603218,0.25999999999999995,6,-1075571.368206742
|
||||
SH600536,0.25999999999999995,2,1670602.7397260272
|
||||
SZ002203,0.25999999999999995,2,15220.542859043773
|
||||
SH601005,0.25999999999999995,2,-146964.4117471273
|
||||
SZ002985,0.25999999999999995,3,-530708.9648837867
|
||||
SH600316,0.25999999999999995,2,-329106.02302721783
|
||||
SH600372,0.25999999999999995,5,-676339.0205785239
|
||||
SH603707,0.25999999999999995,3,-732052.9090152918
|
||||
SZ000027,0.25999999999999995,1,-18205.060818196755
|
||||
SZ000513,0.25999999999999995,3,-179884.73056256003
|
||||
SZ300182,0.25999999999999995,7,-428848.2965815807
|
||||
SZ002506,0.25999999999999995,6,-980921.6029290701
|
||||
SH603156,0.25999999999999995,1,34539.673571836945
|
||||
SZ002408,0.25999999999999995,4,-265761.98882982286
|
||||
SZ002056,0.25999999999999995,1,19059.269536669817
|
||||
SH600236,0.25999999999999995,4,-585278.6298415851
|
||||
SZ002266,0.25999999999999995,2,-164293.49848979473
|
||||
SZ300001,0.25999999999999995,6,239778.81204071827
|
||||
SZ300244,0.25999999999999995,6,-1348365.6663205456
|
||||
SZ002250,0.25999999999999995,4,-1236883.8701983693
|
||||
SH600801,0.25999999999999995,5,-613807.7875214815
|
||||
SZ002019,0.25999999999999995,4,98996.162347109
|
||||
SH600208,0.25999999999999995,2,-21246.374663863266
|
||||
SZ300024,0.25999999999999995,7,906499.9671972422
|
||||
SH601872,0.25999999999999995,1,244986.30136986304
|
||||
SH600998,0.25999999999999995,5,-62757.65458552803
|
||||
SZ300630,0.25999999999999995,2,-628071.6641555955
|
||||
SZ002221,0.25999999999999995,5,296961.481643858
|
||||
SZ002249,0.25999999999999995,4,-580761.33905444
|
||||
SZ000021,0.25999999999999995,7,-76881.01644903957
|
||||
SH600348,0.25999999999999995,4,685592.0029618661
|
||||
SZ300251,0.25999999999999995,8,894818.0668810314
|
||||
SH600415,0.25999999999999995,1,-114364.32394838487
|
||||
SH600535,0.25999999999999995,2,48537.19415611401
|
||||
SZ000878,0.25999999999999995,3,243362.08123820627
|
||||
SZ002831,0.25999999999999995,3,-245264.80195754312
|
||||
SZ000012,0.25999999999999995,4,224593.13492258845
|
||||
SZ300009,0.25999999999999995,5,138536.2342031252
|
||||
SH600728,0.25999999999999995,5,-546260.1774863503
|
||||
SZ000686,0.25999999999999995,4,208541.16838364885
|
||||
SZ002430,0.25999999999999995,5,156257.4139419794
|
||||
SH600171,0.25999999999999995,6,-1294776.34612972
|
||||
SZ000537,0.25999999999999995,9,990011.034144001
|
||||
SZ300115,0.25999999999999995,10,-1879858.1476743342
|
||||
SZ002683,0.25999999999999995,8,-1001998.0898804844
|
||||
SH601866,0.25999999999999995,2,-259384.2402137494
|
||||
SZ002745,0.25999999999999995,3,-942365.9858189356
|
||||
SZ000060,0.25999999999999995,1,230890.41095890413
|
||||
SH600718,0.25999999999999995,5,-487265.0986103117
|
||||
SH603568,0.25999999999999995,6,-512384.09186301986
|
||||
SZ002127,0.25999999999999995,1,-148860.4217156336
|
||||
SZ002532,0.25999999999999995,8,-154544.4247502291
|
||||
SH600390,0.25999999999999995,2,-46056.80706965229
|
||||
SZ300482,0.25999999999999995,8,-1152204.800701056
|
||||
SZ000970,0.25999999999999995,3,-458291.71995482803
|
||||
SH603858,0.25999999999999995,8,-277204.11261201615
|
||||
SH600839,0.25999999999999995,1,-20908.56225212301
|
||||
SH600970,0.25999999999999995,6,1797.0794687636226
|
||||
SH600155,0.25999999999999995,3,78811.26906736351
|
||||
SZ002128,0.25999999999999995,5,-324492.1170389483
|
||||
SZ000690,0.25999999999999995,4,715617.5468495474
|
||||
SH600060,0.25999999999999995,4,1053410.9589041097
|
||||
SH600282,0.25999999999999995,3,482002.6092628834
|
||||
SH600517,0.25999999999999995,4,-467707.47385875665
|
||||
SH600985,0.25999999999999995,8,151381.51089609638
|
||||
SH600498,0.25999999999999995,2,-576832.6304971089
|
||||
SZ300026,0.25999999999999995,12,353601.38978778286
|
||||
SH600380,0.25999999999999995,4,186316.02311948844
|
||||
SH600673,0.25999999999999995,5,96218.30484696213
|
||||
SZ000778,0.25999999999999995,4,-629749.4109840433
|
||||
SH603712,0.25999999999999995,6,-137084.54289235652
|
||||
SH600528,0.25999999999999995,2,-140854.43912439237
|
||||
SZ300212,0.25999999999999995,7,1763858.908652142
|
||||
SZ300072,0.25999999999999995,3,-448857.5478313231
|
||||
SZ000930,0.25999999999999995,2,-96092.57708463911
|
||||
SH600325,0.25999999999999995,2,1195301.369863014
|
||||
SH600667,0.25999999999999995,3,-197383.07455217853
|
||||
SH600782,0.25999999999999995,1,-317279.9096411712
|
||||
SZ000729,0.25999999999999995,2,483260.27397260256
|
||||
SZ002939,0.25999999999999995,4,-190143.77018231727
|
||||
SH600895,0.25999999999999995,2,-483721.0738021395
|
||||
SH600511,0.25999999999999995,5,-107.89655325736385
|
||||
SH603885,0.25999999999999995,7,788959.5489894797
|
||||
SH688006,0.25999999999999995,5,-1592064.7888262859
|
||||
SZ002294,0.25999999999999995,3,186105.45346341777
|
||||
SH601456,0.25999999999999995,5,122089.70428025711
|
||||
SZ000581,0.25999999999999995,1,52322.02613257573
|
||||
SH600500,0.25999999999999995,4,3003.027294416039
|
||||
SH600863,0.25999999999999995,5,-70796.0003205803
|
||||
SH601717,0.25999999999999995,6,-221572.92975745833
|
||||
SZ002505,0.25999999999999995,8,-1624714.4430200295
|
||||
SH601179,0.25999999999999995,2,-30915.683200300962
|
||||
SZ300315,0.25999999999999995,8,1465900.7965502485
|
||||
SH600216,0.25999999999999995,7,-590138.543066583
|
||||
SH600755,0.25999999999999995,3,-74629.910846739
|
||||
SZ002396,0.25999999999999995,6,-920151.9583553346
|
||||
SZ000598,0.25999999999999995,1,40920.78618225126
|
||||
SH600297,0.25999999999999995,4,-697814.0837245702
|
||||
SZ002701,0.25999999999999995,1,-3085.778117467171
|
||||
SH600820,0.25999999999999995,2,-53811.814941572826
|
||||
SZ000709,0.25999999999999995,4,-287437.0205650787
|
||||
SH603927,0.25999999999999995,3,707150.6849315069
|
||||
SH603225,0.25999999999999995,3,-17558.46403724274
|
||||
SZ002670,0.25999999999999995,8,760416.8340412852
|
||||
SH600507,0.25999999999999995,2,-344692.65180842724
|
||||
SH603866,0.25999999999999995,3,-521144.11205804936
|
||||
SZ002595,0.25999999999999995,6,765058.854200416
|
||||
SZ002004,0.25999999999999995,3,-149738.8182396688
|
||||
SZ002368,0.25999999999999995,5,1690547.9452054796
|
||||
SZ300376,0.25999999999999995,8,-1447863.4662251896
|
||||
SZ002146,0.25999999999999995,1,-332903.3189033188
|
||||
SZ002048,0.25999999999999995,6,-71045.5683551196
|
||||
SH600409,0.25999999999999995,2,-297789.44751456607
|
||||
SH600021,0.25999999999999995,8,522235.905097568
|
||||
SH600446,0.25999999999999995,7,-59284.390883166576
|
||||
SH601778,0.25999999999999995,4,-241165.4712776163
|
||||
SZ300271,0.25999999999999995,4,-30680.191041827435
|
||||
SH601577,0.25999999999999995,1,88712.80619927283
|
||||
SH600827,0.25999999999999995,7,199810.54636296778
|
||||
SH688188,0.25999999999999995,11,710966.5065664586
|
||||
SH600131,0.25999999999999995,9,587221.4547409419
|
||||
SH600808,0.25999999999999995,2,-203890.40443738308
|
||||
SZ002010,0.25999999999999995,5,-214139.5769006118
|
||||
SZ002925,0.25999999999999995,1,-172978.61045653457
|
||||
SH600663,0.25999999999999995,2,-84545.36781306674
|
||||
SZ300166,0.25999999999999995,7,-608625.6901477729
|
||||
SZ002124,0.25999999999999995,6,-492493.76594807504
|
||||
SH600764,0.25999999999999995,7,-666527.9758283527
|
||||
SZ002690,0.25999999999999995,4,-47904.06434708828
|
||||
SZ000987,0.25999999999999995,2,-195615.5682460863
|
||||
SZ002174,0.25999999999999995,6,762304.6523478734
|
||||
SH600737,0.25999999999999995,2,301448.19885482185
|
||||
SH600908,0.25999999999999995,1,111991.45676830162
|
||||
SH603883,0.25999999999999995,7,-378010.06826822227
|
||||
SH603228,0.25999999999999995,6,-1229915.084637275
|
||||
SZ000883,0.25999999999999995,2,-257210.44089406607
|
||||
SZ002155,0.25999999999999995,4,1168374.184552691
|
||||
SH600811,0.25999999999999995,3,-600240.107391387
|
||||
SH601106,0.25999999999999995,1,-116778.11648598696
|
||||
SZ002233,0.25999999999999995,1,80940.3385848245
|
||||
SZ002110,0.25999999999999995,1,-193260.27397260276
|
||||
SH600566,0.25999999999999995,1,245753.42465753423
|
||||
SZ002281,0.25999999999999995,6,2196566.361469437
|
||||
SH600158,0.25999999999999995,4,207661.94768058794
|
||||
SH600967,0.25999999999999995,1,9099.703182940557
|
||||
SH600707,0.25999999999999995,1,-196091.53041447204
|
||||
SH600572,0.25999999999999995,2,472520.54794520553
|
||||
SZ002440,0.25999999999999995,2,-55446.19512473103
|
||||
SZ000961,0.25999999999999995,2,-965105.679028499
|
||||
SZ000990,0.25999999999999995,2,-594968.0655555818
|
||||
SZ002183,0.25999999999999995,7,-450644.5944722795
|
||||
SH600435,0.25999999999999995,2,129364.75585890873
|
||||
SH601000,0.25999999999999995,1,233958.904109589
|
||||
SZ000090,0.25999999999999995,5,118704.79287430945
|
||||
SZ000877,0.25999999999999995,2,-179201.93804078037
|
||||
SH600906,0.25999999999999995,2,-99517.17386772847
|
||||
SZ002429,0.25999999999999995,1,159452.47880556196
|
||||
SH688088,0.25999999999999995,8,-523558.6901929017
|
||||
SH600398,0.25999999999999995,4,864557.302174872
|
||||
SH601200,0.25999999999999995,1,-77619.81786755417
|
||||
SZ002081,0.25999999999999995,1,-66738.88043294422
|
||||
SH600373,0.25999999999999995,2,243701.10672548582
|
||||
SH600037,0.25999999999999995,4,-952485.6179281805
|
||||
SZ002867,0.25999999999999995,2,308838.1283725478
|
||||
SH600376,0.25999999999999995,11,-476988.1561064737
|
||||
SZ001914,0.25999999999999995,8,-558313.5825287102
|
||||
SZ002085,0.25999999999999995,7,96959.94957857783
|
||||
SH600167,0.25999999999999995,3,-220081.4814459467
|
||||
SZ000559,0.25999999999999995,3,-500042.5115762846
|
||||
SZ000959,0.25999999999999995,3,-449324.7652787983
|
||||
SZ000528,0.25999999999999995,1,-22071.621331391136
|
||||
SZ002416,0.25999999999999995,7,23540.125097253767
|
||||
SH600195,0.25999999999999995,4,-238255.6153599094
|
||||
SH600329,0.25999999999999995,5,1193767.1232876715
|
||||
SH600259,0.25999999999999995,5,-1403866.8766314809
|
||||
SZ002434,0.25999999999999995,8,-301596.337877783
|
||||
SH688321,0.25999999999999995,2,-632794.5804530663
|
||||
SH601718,0.25999999999999995,3,-156809.58588760858
|
||||
SH600026,0.25999999999999995,1,245561.6438356164
|
||||
SH603000,0.25999999999999995,8,3618602.739726027
|
||||
SZ002038,0.25999999999999995,3,-164654.91405582882
|
||||
SH600120,0.25999999999999995,3,-284947.83479280164
|
||||
SZ002242,0.25999999999999995,2,-180779.46358353007
|
||||
SZ001965,0.25999999999999995,2,134344.25907719668
|
||||
SH601608,0.25999999999999995,2,-241493.13988022093
|
||||
SZ300133,0.25999999999999995,8,1257731.904975621
|
||||
SH600126,0.25999999999999995,1,-26813.670831338677
|
||||
SZ002705,0.25999999999999995,4,-256568.98631694663
|
||||
SZ000402,0.25999999999999995,3,-464993.35730929306
|
||||
SZ000158,0.25999999999999995,8,-1364289.591764662
|
||||
SZ002390,0.25999999999999995,7,-1739455.1016589073
|
||||
SZ002387,0.25999999999999995,7,5833.061730373778
|
||||
SH601611,0.25999999999999995,2,-117538.91958813404
|
||||
SZ000758,0.25999999999999995,4,753088.5163101249
|
||||
SZ000415,0.25999999999999995,5,66417.40556438596
|
||||
SH600307,0.25999999999999995,1,-42153.20734215546
|
||||
SH601991,0.25999999999999995,6,883200.3210799034
|
||||
SH601598,0.25999999999999995,1,280627.5470204124
|
||||
SH603650,0.25999999999999995,7,-846995.9065298478
|
||||
SH600959,0.25999999999999995,1,-140231.6216793704
|
||||
SH688289,0.25999999999999995,1,-313049.8565376556
|
||||
SH600582,0.25999999999999995,3,281923.3856419214
|
||||
SH600643,0.25999999999999995,1,21366.661703394966
|
||||
SZ000563,0.25999999999999995,2,2317.887649553966
|
||||
SZ300257,0.25999999999999995,6,-848614.5105208516
|
||||
SH601958,0.25999999999999995,4,1668684.9315068491
|
||||
SH600266,0.25999999999999995,7,656644.555242081
|
||||
SZ000967,0.25999999999999995,1,-29095.75883393512
|
||||
SZ002399,0.25999999999999995,4,-825385.5926764316
|
||||
SH600056,0.25999999999999995,1,2151.1847995192393
|
||||
SZ002458,0.25999999999999995,4,1202684.9315068494
|
||||
SH601860,0.25999999999999995,1,-52849.00643384521
|
||||
SZ002563,0.25999999999999995,1,-38892.42318705994
|
||||
SZ003022,0.25999999999999995,13,-194304.2587242192
|
||||
SH601928,0.25999999999999995,3,1169602.7397260275
|
||||
SH600928,0.25999999999999995,1,-108188.82970308381
|
||||
SH600729,0.25999999999999995,3,360946.8844639017
|
||||
SZ002423,0.25999999999999995,5,-125215.6089607437
|
||||
SH600968,0.25999999999999995,3,406179.0905988617
|
||||
SZ000937,0.25999999999999995,2,488150.68493150675
|
||||
SH600556,0.25999999999999995,10,-810341.9637847014
|
||||
SZ003035,0.25999999999999995,4,-620737.3731457555
|
||||
SH600649,0.25999999999999995,2,-144447.9980746712
|
||||
SH600787,0.25999999999999995,2,405852.48667251505
|
||||
SZ000028,0.25999999999999995,4,956356.1643835617
|
||||
SH600095,0.25999999999999995,11,1126670.567329784
|
||||
SH600776,0.25999999999999995,6,-152306.480179212
|
||||
SZ000031,0.25999999999999995,6,42142.77408537236
|
||||
SH600339,0.25999999999999995,4,1204506.8493150682
|
||||
SH600006,0.25999999999999995,7,-1592198.93277586
|
||||
SH603317,0.25999999999999995,7,576135.2379731614
|
||||
SH600648,0.25999999999999995,4,-320142.22412696923
|
||||
SH600623,0.25999999999999995,2,-315058.51019633736
|
||||
SZ000062,0.25999999999999995,5,77424.99648156941
|
||||
SH600835,0.25999999999999995,5,-684933.362389107
|
||||
SZ002815,0.25999999999999995,3,-239904.8596506782
|
||||
SZ002424,0.25999999999999995,4,986092.992822364
|
||||
SH600377,0.25999999999999995,1,55279.60882104716
|
||||
SH601139,0.25999999999999995,1,-85493.94819957169
|
||||
SH600299,0.25999999999999995,5,35263.911993071866
|
||||
SZ002948,0.25999999999999995,1,-130997.34930495129
|
||||
SZ000156,0.25999999999999995,3,117354.13973553921
|
||||
SZ002375,0.25999999999999995,5,-503704.1723574602
|
||||
SH600871,0.25999999999999995,1,74805.1630532484
|
||||
SZ300869,0.25999999999999995,1,-315929.3763211771
|
||||
SZ002302,0.25999999999999995,4,-345674.57053220057
|
||||
SH601228,0.25999999999999995,3,-204746.15346936608
|
||||
SH600639,0.25999999999999995,5,-874267.2713147431
|
||||
SH601298,0.25999999999999995,1,-5273.972602739588
|
||||
SH603379,0.25999999999999995,6,750011.8047540708
|
||||
SZ002945,0.25999999999999995,8,-190018.72363347892
|
||||
SZ002653,0.25999999999999995,9,1575227.333324797
|
||||
SZ001872,0.25999999999999995,1,-181946.14910747032
|
||||
SH600823,0.25999999999999995,4,-1012634.7666783128
|
||||
SZ300741,0.25999999999999995,1,-175244.41893296523
|
||||
SH603056,0.25999999999999995,1,472712.32876712317
|
||||
SH601869,0.25999999999999995,5,193111.91156326648
|
||||
SH603786,0.25999999999999995,7,722157.4994268874
|
||||
SH603708,0.25999999999999995,2,137353.7448811492
|
||||
SZ000553,0.25999999999999995,5,-578522.740003638
|
||||
SH600350,0.25999999999999995,1,42420.46753100173
|
||||
SH600657,0.25999999999999995,2,299910.5707050211
|
||||
SH603515,0.25999999999999995,2,-89726.10472652467
|
||||
SH603355,0.25999999999999995,6,93048.00090576698
|
||||
SH603719,0.25999999999999995,5,688216.6074331223
|
||||
SH601003,0.25999999999999995,3,-242322.08029099827
|
||||
SZ002946,0.25999999999999995,6,-128542.27883068207
|
||||
SH600917,0.25999999999999995,5,-36977.61636400808
|
||||
SZ002901,0.25999999999999995,7,268801.96585163
|
||||
SH600903,0.25999999999999995,5,-492868.6188254448
|
||||
SH600956,0.25999999999999995,4,-1181595.5901998247
|
||||
SH601187,0.25999999999999995,1,-40634.25771244019
|
||||
SH603983,0.25999999999999995,3,-852427.2107680459
|
|
|
@ -0,0 +1,440 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.26999999999999996,6,-15174.779550762381
|
||||
SZ002340,0.26999999999999996,3,-216680.903740902
|
||||
SZ000733,0.26999999999999996,3,-347623.76533204206
|
||||
SH601615,0.26999999999999996,7,-1615082.4259089434
|
||||
SH688005,0.26999999999999996,10,-721260.133121624
|
||||
SZ002180,0.26999999999999996,4,-147632.27621242413
|
||||
SZ000723,0.26999999999999996,4,-752573.2644316294
|
||||
SZ002384,0.26999999999999996,10,1622670.3629800323
|
||||
SH600885,0.26999999999999996,4,-539707.3907344582
|
||||
SZ000009,0.26999999999999996,6,-236744.76840903255
|
||||
SZ300285,0.26999999999999996,2,-436343.7380088445
|
||||
SH605358,0.26999999999999996,4,-2129677.3155513634
|
||||
SH601555,0.26999999999999996,2,7402.496042942948
|
||||
SH601117,0.26999999999999996,7,-1401325.7176221414
|
||||
SZ002385,0.26999999999999996,4,-1043581.0961502332
|
||||
SH688099,0.26999999999999996,5,-1818086.9533308106
|
||||
SH600884,0.26999999999999996,6,-1746854.5990375176
|
||||
SH600298,0.26999999999999996,2,161927.99197252787
|
||||
SH600399,0.26999999999999996,9,-721521.593759173
|
||||
SZ002028,0.26999999999999996,7,1029995.8452438756
|
||||
SH603613,0.26999999999999996,6,-2383518.661542465
|
||||
SZ300037,0.26999999999999996,6,-1131056.8946055775
|
||||
SH600765,0.26999999999999996,10,385526.04748090304
|
||||
SH600256,0.26999999999999996,1,-3968.097514121813
|
||||
SH600487,0.26999999999999996,12,1187386.6629388505
|
||||
SH600563,0.26999999999999996,8,-844891.2950855055
|
||||
SH600754,0.26999999999999996,10,-488135.1508052357
|
||||
SZ002185,0.26999999999999996,1,-174280.51580036187
|
||||
SZ300363,0.26999999999999996,4,-1373681.0353223062
|
||||
SH601636,0.26999999999999996,1,-315662.8945801073
|
||||
SZ300751,0.26999999999999996,5,-263284.0930211342
|
||||
SZ300088,0.26999999999999996,5,-282057.4025836394
|
||||
SH603589,0.26999999999999996,6,238251.85732315417
|
||||
SZ000630,0.26999999999999996,5,-201723.48451367283
|
||||
SZ000988,0.26999999999999996,8,836809.7146139919
|
||||
SZ002268,0.26999999999999996,16,-926421.7440269169
|
||||
SZ002353,0.26999999999999996,5,-1261328.7973129307
|
||||
SH601689,0.26999999999999996,7,2000890.4109589043
|
||||
SH601168,0.26999999999999996,7,-204953.09845227157
|
||||
SZ300763,0.26999999999999996,11,-2021798.2552086874
|
||||
SH600141,0.26999999999999996,9,-1852194.8823217042
|
||||
SH600392,0.26999999999999996,6,-1800945.0393971722
|
||||
SZ000932,0.26999999999999996,2,21702.26401797135
|
||||
SH603267,0.26999999999999996,5,-1418059.5726983906
|
||||
SZ300699,0.26999999999999996,7,-1400697.6939798968
|
||||
SH600233,0.26999999999999996,1,-15445.359583114072
|
||||
SZ000728,0.26999999999999996,2,-224139.38823790126
|
||||
SH600516,0.26999999999999996,3,-272761.19589548017
|
||||
SZ300058,0.26999999999999996,9,922576.5630557706
|
||||
SH600486,0.26999999999999996,3,-562409.3238461512
|
||||
SZ002797,0.26999999999999996,3,-148143.19422076663
|
||||
SH603456,0.26999999999999996,8,127082.89429729787
|
||||
SH603077,0.26999999999999996,6,-786827.0450873834
|
||||
SZ002138,0.26999999999999996,6,-151737.9149370744
|
||||
SH600862,0.26999999999999996,6,-341473.4067102635
|
||||
SZ300146,0.26999999999999996,2,-122617.02389449952
|
||||
SZ300223,0.26999999999999996,6,-2505360.9559267154
|
||||
SZ300136,0.26999999999999996,2,-661995.9748293064
|
||||
SH600188,0.26999999999999996,1,56099.89976612109
|
||||
SH600418,0.26999999999999996,11,1411872.628797789
|
||||
SH600705,0.26999999999999996,4,-198199.7480643393
|
||||
SZ000960,0.26999999999999996,6,-1548198.2539201607
|
||||
SZ300308,0.26999999999999996,6,309979.06275767577
|
||||
SH688065,0.26999999999999996,5,-793622.7606358915
|
||||
SZ300253,0.26999999999999996,8,-971698.1461953144
|
||||
SZ002080,0.26999999999999996,6,-1541985.6482786287
|
||||
SZ000998,0.26999999999999996,3,-108698.54774709925
|
||||
SH688536,0.26999999999999996,8,-1996093.1007088665
|
||||
SZ002092,0.26999999999999996,2,-200955.6268795189
|
||||
SH600875,0.26999999999999996,5,1274758.580883485
|
||||
SZ000547,0.26999999999999996,6,-867536.3097556427
|
||||
SZ002409,0.26999999999999996,12,167032.28565159324
|
||||
SH600482,0.26999999999999996,2,-146600.768733355
|
||||
SH600521,0.26999999999999996,9,-82904.9194073613
|
||||
SZ000807,0.26999999999999996,9,1140786.933881722
|
||||
SH600733,0.26999999999999996,2,-634395.4619477554
|
||||
SH600988,0.26999999999999996,7,-376270.39680435054
|
||||
SZ000039,0.26999999999999996,2,-98696.25147860739
|
||||
SZ300296,0.26999999999999996,2,-152174.19326647877
|
||||
SZ002439,0.26999999999999996,6,235306.78335692105
|
||||
SZ002212,0.26999999999999996,1,-751249.3920035734
|
||||
SZ300418,0.26999999999999996,7,1409397.5930963764
|
||||
SZ002078,0.26999999999999996,3,254025.66357487877
|
||||
SZ002223,0.26999999999999996,6,667238.3098341178
|
||||
SH603893,0.26999999999999996,7,-2988859.4851462715
|
||||
SZ002191,0.26999999999999996,5,-569128.3567447163
|
||||
SZ002030,0.26999999999999996,5,-1099278.1718986314
|
||||
SH600699,0.26999999999999996,6,-1071591.4916503015
|
||||
SZ002603,0.26999999999999996,4,1201376.7123287674
|
||||
SH600160,0.26999999999999996,3,238727.43581084482
|
||||
SZ002444,0.26999999999999996,8,-462738.84985575423
|
||||
SH601198,0.26999999999999996,3,135985.73668344688
|
||||
SZ300724,0.26999999999999996,11,-250324.18352604925
|
||||
SH600637,0.26999999999999996,1,11196.223620881161
|
||||
SZ300474,0.26999999999999996,11,656323.0547522397
|
||||
SZ002465,0.26999999999999996,1,1331.3315903262192
|
||||
SH603605,0.26999999999999996,3,-196393.47310201934
|
||||
SH600497,0.26999999999999996,6,-21914.23990344644
|
||||
SZ300383,0.26999999999999996,2,-1351168.4713010378
|
||||
SZ002507,0.26999999999999996,6,-1089443.7609141374
|
||||
SZ002557,0.26999999999999996,8,-1163436.976238242
|
||||
SH600549,0.26999999999999996,9,-533523.0048816401
|
||||
SZ000739,0.26999999999999996,6,-1437007.8107000138
|
||||
SH600529,0.26999999999999996,7,214138.14016534237
|
||||
SH600704,0.26999999999999996,1,-91194.22216194228
|
||||
SH603290,0.26999999999999996,8,-1096216.7271700534
|
||||
SZ002508,0.26999999999999996,6,-694048.6864327432
|
||||
SH600038,0.26999999999999996,4,-28103.386213273792
|
||||
SZ002739,0.26999999999999996,6,356389.02612968354
|
||||
SH603198,0.26999999999999996,9,1489197.958438574
|
||||
SZ002156,0.26999999999999996,9,-485825.23095743614
|
||||
SZ000830,0.26999999999999996,4,-85388.46033872316
|
||||
SH600201,0.26999999999999996,1,-356130.5664030538
|
||||
SH600153,0.26999999999999996,1,128031.92337187794
|
||||
SH600369,0.26999999999999996,2,-46748.998771027036
|
||||
SZ000983,0.26999999999999996,4,847716.1201507527
|
||||
SH600642,0.26999999999999996,3,132158.60502510957
|
||||
SZ002299,0.26999999999999996,3,-193075.0844441613
|
||||
SZ000629,0.26999999999999996,2,44328.143060004484
|
||||
SZ002131,0.26999999999999996,5,318729.9846620153
|
||||
SZ000738,0.26999999999999996,6,-613838.8905420647
|
||||
SH603127,0.26999999999999996,8,-2118432.734340586
|
||||
SH601016,0.26999999999999996,2,-231764.87279666594
|
||||
SZ000825,0.26999999999999996,1,-299907.85894576914
|
||||
SZ000623,0.26999999999999996,1,13621.199038528765
|
||||
SH600879,0.26999999999999996,1,241445.2054794521
|
||||
SH600859,0.26999999999999996,9,337068.9003981262
|
||||
SZ000519,0.26999999999999996,8,384116.5202677256
|
||||
SH600039,0.26999999999999996,1,135844.80806376415
|
||||
SZ300618,0.26999999999999996,2,-575673.9780720558
|
||||
SH688521,0.26999999999999996,10,338083.08797079825
|
||||
SZ002273,0.26999999999999996,6,-942845.7133795503
|
||||
SH603444,0.26999999999999996,4,530095.1132864424
|
||||
SH600166,0.26999999999999996,8,582562.1948741323
|
||||
SZ002422,0.26999999999999996,2,496794.52054794517
|
||||
SH600732,0.26999999999999996,2,508972.60273972596
|
||||
SZ000750,0.26999999999999996,1,46073.27415968562
|
||||
SZ002373,0.26999999999999996,2,-520278.1116796873
|
||||
SH600803,0.26999999999999996,7,-137930.66544210777
|
||||
SH600170,0.26999999999999996,1,-116717.77849339836
|
||||
SZ000050,0.26999999999999996,1,-615461.6288614838
|
||||
SZ000887,0.26999999999999996,9,-780765.4965863843
|
||||
SZ300357,0.26999999999999996,6,-231522.59334126447
|
||||
SH601699,0.26999999999999996,9,2043308.824904382
|
||||
SZ000656,0.26999999999999996,4,-1564916.565337401
|
||||
SH600118,0.26999999999999996,3,-132109.47018391412
|
||||
SZ300070,0.26999999999999996,2,196033.72372686397
|
||||
SZ002372,0.26999999999999996,4,908167.2827449532
|
||||
SZ000400,0.26999999999999996,8,473321.4228424609
|
||||
SH600271,0.26999999999999996,2,-145996.14265563383
|
||||
SH600258,0.26999999999999996,10,-134491.8603875283
|
||||
SZ002926,0.26999999999999996,4,-30595.66460193618
|
||||
SZ300017,0.26999999999999996,5,607704.6115078077
|
||||
SZ002153,0.26999999999999996,9,806305.8347791502
|
||||
SZ002152,0.26999999999999996,3,155020.15483689838
|
||||
SH600909,0.26999999999999996,2,-25378.865880474004
|
||||
SZ002195,0.26999999999999996,3,745910.9589041097
|
||||
SZ300168,0.26999999999999996,8,-743008.1734490291
|
||||
SZ002572,0.26999999999999996,8,52808.959328933255
|
||||
SH600315,0.26999999999999996,2,-222532.41476629057
|
||||
SZ002065,0.26999999999999996,3,-919173.3883635276
|
||||
SH600066,0.26999999999999996,5,513158.494733894
|
||||
SH600580,0.26999999999999996,5,-619638.4427281643
|
||||
SZ000975,0.26999999999999996,4,1249609.5890410962
|
||||
SH600027,0.26999999999999996,3,758568.4931506847
|
||||
SZ000997,0.26999999999999996,4,724923.455900024
|
||||
SH603218,0.26999999999999996,6,-1068276.8476587967
|
||||
SH600536,0.26999999999999996,2,1737102.7397260272
|
||||
SZ002203,0.26999999999999996,2,15220.542859043773
|
||||
SH601005,0.26999999999999996,2,-146964.4117471273
|
||||
SZ002985,0.26999999999999996,3,-530708.9648837867
|
||||
SH600316,0.26999999999999996,2,-329106.02302721783
|
||||
SH600372,0.26999999999999996,5,-676339.0205785239
|
||||
SH603707,0.26999999999999996,3,-732052.9090152918
|
||||
SZ000027,0.26999999999999996,1,-18205.060818196755
|
||||
SZ000513,0.26999999999999996,3,-179884.73056256003
|
||||
SZ300182,0.26999999999999996,7,-400348.29658158077
|
||||
SZ002506,0.26999999999999996,6,-971421.6029290701
|
||||
SH603156,0.26999999999999996,1,34539.673571836945
|
||||
SZ002408,0.26999999999999996,4,-265761.98882982286
|
||||
SZ002056,0.26999999999999996,1,19059.269536669817
|
||||
SH600236,0.26999999999999996,4,-585278.6298415851
|
||||
SZ002266,0.26999999999999996,2,-164293.49848979473
|
||||
SZ300001,0.26999999999999996,6,268182.9216297595
|
||||
SZ300244,0.26999999999999996,6,-1348365.6663205456
|
||||
SZ002250,0.26999999999999996,4,-1236883.8701983693
|
||||
SH600801,0.26999999999999996,5,-604307.7875214815
|
||||
SZ002019,0.26999999999999996,4,98996.162347109
|
||||
SH600208,0.26999999999999996,2,-21246.374663863266
|
||||
SZ300024,0.26999999999999996,7,953999.9671972424
|
||||
SH601872,0.26999999999999996,1,254390.4109589041
|
||||
SH600998,0.26999999999999996,5,-62757.65458552803
|
||||
SZ300630,0.26999999999999996,2,-628071.6641555955
|
||||
SZ002221,0.26999999999999996,5,306461.481643858
|
||||
SZ002249,0.26999999999999996,4,-580761.33905444
|
||||
SZ000021,0.26999999999999996,6,-268967.95566214516
|
||||
SH600348,0.26999999999999996,3,712845.4276194006
|
||||
SZ300251,0.26999999999999996,7,795416.5389628235
|
||||
SH600415,0.26999999999999996,1,-114364.32394838487
|
||||
SH600535,0.26999999999999996,2,67537.19415611413
|
||||
SZ000878,0.26999999999999996,3,252862.08123820633
|
||||
SZ002831,0.26999999999999996,3,-235860.6923685021
|
||||
SZ000012,0.26999999999999996,4,243593.1349225885
|
||||
SZ300009,0.26999999999999996,5,157536.2342031252
|
||||
SH600728,0.26999999999999996,5,-536760.1774863503
|
||||
SZ000686,0.26999999999999996,4,218041.16838364882
|
||||
SZ002430,0.26999999999999996,4,182072.48243513016
|
||||
SH600171,0.26999999999999996,6,-1285276.34612972
|
||||
SZ000537,0.26999999999999996,9,1056511.0341440013
|
||||
SZ300115,0.26999999999999996,10,-1793606.9130852905
|
||||
SZ002683,0.26999999999999996,8,-992689.8707024021
|
||||
SH601866,0.26999999999999996,2,-259384.2402137494
|
||||
SZ002745,0.26999999999999996,3,-942365.9858189356
|
||||
SZ000060,0.26999999999999996,1,240390.41095890405
|
||||
SH600718,0.26999999999999996,5,-478628.1123089417
|
||||
SH603568,0.26999999999999996,6,-502884.09186301986
|
||||
SZ002127,0.26999999999999996,1,-148860.4217156336
|
||||
SZ002532,0.26999999999999996,8,-145044.424750229
|
||||
SH600390,0.26999999999999996,2,-46056.80706965229
|
||||
SZ300482,0.26999999999999996,7,-1123896.5815229737
|
||||
SZ000970,0.26999999999999996,3,-458291.71995482803
|
||||
SH603858,0.26999999999999996,8,-267704.1126120161
|
||||
SH600839,0.26999999999999996,1,-20908.56225212301
|
||||
SH600970,0.26999999999999996,6,11105.298646845811
|
||||
SH600155,0.26999999999999996,3,88311.26906736348
|
||||
SZ002128,0.26999999999999996,5,-314992.1170389483
|
||||
SZ000690,0.26999999999999996,3,753329.8756166706
|
||||
SH600060,0.26999999999999996,4,1049836.0628774173
|
||||
SH600282,0.26999999999999996,3,500043.70515329426
|
||||
SH600517,0.26999999999999996,4,-467707.47385875665
|
||||
SH600985,0.26999999999999996,7,-58631.66469070857
|
||||
SH600498,0.26999999999999996,2,-567332.6304971088
|
||||
SZ300026,0.26999999999999996,11,-23595.847004859184
|
||||
SH600380,0.26999999999999996,4,195816.02311948832
|
||||
SH600673,0.26999999999999996,5,115218.3048469619
|
||||
SZ000778,0.26999999999999996,4,-629749.4109840433
|
||||
SH603712,0.26999999999999996,6,-110406.4607005755
|
||||
SH600528,0.26999999999999996,2,-140854.43912439237
|
||||
SZ300212,0.26999999999999996,6,1618128.3070594072
|
||||
SZ300072,0.26999999999999996,3,-448857.5478313231
|
||||
SZ000930,0.26999999999999996,2,-96092.57708463911
|
||||
SH600325,0.26999999999999996,2,1241267.1232876712
|
||||
SH600667,0.26999999999999996,3,-187883.07455217862
|
||||
SH600782,0.26999999999999996,1,-317279.9096411712
|
||||
SZ000729,0.26999999999999996,2,494301.3698630136
|
||||
SZ002939,0.26999999999999996,4,-190143.77018231727
|
||||
SH600895,0.26999999999999996,2,-483721.0738021395
|
||||
SH600511,0.26999999999999996,5,18892.10344674252
|
||||
SH603885,0.26999999999999996,8,693011.6167684838
|
||||
SH688006,0.26999999999999996,5,-1592064.7888262859
|
||||
SZ002294,0.26999999999999996,3,195509.56305245904
|
||||
SH601456,0.26999999999999996,5,122089.70428025711
|
||||
SZ000581,0.26999999999999996,1,52322.02613257573
|
||||
SH600500,0.26999999999999996,4,12503.027294416097
|
||||
SH600863,0.26999999999999996,5,-61296.00032058024
|
||||
SH601717,0.26999999999999996,6,-212072.92975745833
|
||||
SZ002505,0.26999999999999996,8,-1615310.3334309882
|
||||
SH601179,0.26999999999999996,2,-30915.683200300962
|
||||
SZ300315,0.26999999999999996,8,1522613.125317372
|
||||
SH600216,0.26999999999999996,7,-580638.543066583
|
||||
SH600755,0.26999999999999996,3,-74629.910846739
|
||||
SZ002396,0.26999999999999996,6,-910843.7391772524
|
||||
SZ000598,0.26999999999999996,1,40920.78618225126
|
||||
SH600297,0.26999999999999996,4,-697814.0837245702
|
||||
SZ002701,0.26999999999999996,1,-3085.778117467171
|
||||
SH600820,0.26999999999999996,2,-53811.814941572826
|
||||
SZ000709,0.26999999999999996,4,-277937.02056507877
|
||||
SH603927,0.26999999999999996,3,735650.684931507
|
||||
SH603225,0.26999999999999996,3,-17558.46403724274
|
||||
SZ002670,0.26999999999999996,8,788916.8340412853
|
||||
SH600507,0.26999999999999996,2,-344692.65180842724
|
||||
SH603866,0.26999999999999996,3,-521144.11205804936
|
||||
SZ002595,0.26999999999999996,6,784058.8542004159
|
||||
SZ002004,0.26999999999999996,3,-149738.8182396688
|
||||
SZ002368,0.26999999999999996,5,1751198.6301369863
|
||||
SZ300376,0.26999999999999996,8,-1438363.4662251899
|
||||
SZ002146,0.26999999999999996,1,-332903.3189033188
|
||||
SZ002048,0.26999999999999996,6,-61545.56835511954
|
||||
SH600409,0.26999999999999996,2,-297789.44751456607
|
||||
SH600021,0.26999999999999996,7,286105.47471193597
|
||||
SH600446,0.26999999999999996,7,-21284.390883166692
|
||||
SH601778,0.26999999999999996,4,-241165.4712776163
|
||||
SZ300271,0.26999999999999996,5,-2276.0814527863404
|
||||
SH601577,0.26999999999999996,1,88712.80619927283
|
||||
SH600827,0.26999999999999996,7,217084.5189657077
|
||||
SH688188,0.26999999999999996,9,378428.6913001081
|
||||
SH600131,0.26999999999999996,9,633954.3314532706
|
||||
SH600808,0.26999999999999996,2,-203890.40443738308
|
||||
SZ002010,0.26999999999999996,5,-214139.5769006118
|
||||
SZ002925,0.26999999999999996,1,-172978.61045653457
|
||||
SH600663,0.26999999999999996,2,-84545.36781306674
|
||||
SZ300166,0.26999999999999996,6,-738646.9766021281
|
||||
SZ002124,0.26999999999999996,6,-483089.656359034
|
||||
SH600764,0.26999999999999996,7,-740856.9395550275
|
||||
SZ002690,0.26999999999999996,4,-28904.064347088395
|
||||
SZ000987,0.26999999999999996,2,-195615.5682460863
|
||||
SZ002174,0.26999999999999996,6,827845.7482382844
|
||||
SH600737,0.26999999999999996,2,310948.1988548219
|
||||
SH600908,0.26999999999999996,1,111991.45676830162
|
||||
SH603883,0.26999999999999996,7,-340010.06826822227
|
||||
SH603228,0.26999999999999996,6,-1220415.084637275
|
||||
SZ000883,0.26999999999999996,2,-257210.44089406607
|
||||
SZ002155,0.26999999999999996,5,1225182.4037307731
|
||||
SH600811,0.26999999999999996,3,-600240.107391387
|
||||
SH601106,0.26999999999999996,1,-116778.11648598696
|
||||
SZ002233,0.26999999999999996,1,80940.3385848245
|
||||
SZ002110,0.26999999999999996,1,-193260.27397260276
|
||||
SH600566,0.26999999999999996,1,254390.41095890422
|
||||
SZ002281,0.26999999999999996,7,2281970.471058478
|
||||
SH600158,0.26999999999999996,4,236161.94768058782
|
||||
SH600967,0.26999999999999996,1,9099.703182940557
|
||||
SH600707,0.26999999999999996,1,-196091.53041447204
|
||||
SH600572,0.26999999999999996,2,489698.63013698626
|
||||
SZ002440,0.26999999999999996,2,-55446.19512473103
|
||||
SZ000961,0.26999999999999996,2,-965105.679028499
|
||||
SZ000990,0.26999999999999996,2,-594968.0655555818
|
||||
SZ002183,0.26999999999999996,7,-450644.5944722795
|
||||
SH600435,0.26999999999999996,2,138864.7558589088
|
||||
SH601000,0.26999999999999996,1,243458.90410958903
|
||||
SZ000090,0.26999999999999996,5,128013.01205239173
|
||||
SZ000877,0.26999999999999996,2,-179201.93804078037
|
||||
SH600906,0.26999999999999996,2,-99517.17386772847
|
||||
SZ002429,0.26999999999999996,1,159452.47880556196
|
||||
SH688088,0.26999999999999996,8,-457058.6901929014
|
||||
SH600398,0.26999999999999996,4,892386.06929816
|
||||
SH601200,0.26999999999999996,1,-77619.81786755417
|
||||
SZ002081,0.26999999999999996,1,-66738.88043294422
|
||||
SH600373,0.26999999999999996,2,253201.10672548576
|
||||
SH600037,0.26999999999999996,4,-952485.6179281805
|
||||
SZ002867,0.26999999999999996,2,318338.1283725478
|
||||
SH600376,0.26999999999999996,10,-439084.0465174326
|
||||
SZ001914,0.26999999999999996,8,-558313.5825287102
|
||||
SZ002085,0.26999999999999996,7,106459.94957857794
|
||||
SH600167,0.26999999999999996,3,-220081.4814459467
|
||||
SZ000559,0.26999999999999996,3,-500042.5115762846
|
||||
SZ000959,0.26999999999999996,3,-449324.7652787983
|
||||
SZ000528,0.26999999999999996,1,-22071.621331391136
|
||||
SZ002416,0.26999999999999996,7,42540.125097253534
|
||||
SH600195,0.26999999999999996,4,-238255.6153599094
|
||||
SH600329,0.26999999999999996,5,1240979.4520547942
|
||||
SH600259,0.26999999999999996,5,-1403866.8766314809
|
||||
SZ002434,0.26999999999999996,8,-273384.0091106598
|
||||
SH688321,0.26999999999999996,2,-632794.5804530663
|
||||
SH601718,0.26999999999999996,3,-156809.58588760858
|
||||
SH600026,0.26999999999999996,1,255061.64383561644
|
||||
SH603000,0.26999999999999996,8,3760335.6164383567
|
||||
SZ002038,0.26999999999999996,3,-164654.91405582882
|
||||
SH600120,0.26999999999999996,3,-284947.83479280164
|
||||
SZ002242,0.26999999999999996,2,-180779.46358353007
|
||||
SZ001965,0.26999999999999996,2,134344.25907719668
|
||||
SH601608,0.26999999999999996,2,-241493.13988022093
|
||||
SZ300133,0.26999999999999996,8,1312526.4255235663
|
||||
SH600126,0.26999999999999996,1,-26813.670831338677
|
||||
SZ002705,0.26999999999999996,4,-479210.04200532107
|
||||
SZ000402,0.26999999999999996,3,-464993.35730929306
|
||||
SZ000158,0.26999999999999996,8,-1345385.4821756207
|
||||
SZ002390,0.26999999999999996,7,-1729955.1016589077
|
||||
SZ002387,0.26999999999999996,7,15333.061730373836
|
||||
SH601611,0.26999999999999996,2,-117538.91958813404
|
||||
SZ000758,0.26999999999999996,4,781588.516310125
|
||||
SZ000415,0.26999999999999996,5,66417.40556438596
|
||||
SH600307,0.26999999999999996,1,-42153.20734215546
|
||||
SH601991,0.26999999999999996,6,911508.5402579856
|
||||
SH601598,0.26999999999999996,1,280627.5470204124
|
||||
SH603650,0.26999999999999996,7,-818495.9065298478
|
||||
SH600959,0.26999999999999996,1,-140231.6216793704
|
||||
SH688289,0.26999999999999996,1,-313049.8565376556
|
||||
SH600582,0.26999999999999996,3,281923.3856419214
|
||||
SH600643,0.26999999999999996,1,21366.661703394966
|
||||
SZ000563,0.26999999999999996,2,2317.887649553966
|
||||
SZ300257,0.26999999999999996,6,-848614.5105208516
|
||||
SH601958,0.26999999999999996,4,1731828.767123288
|
||||
SH600266,0.26999999999999996,7,685144.5552420812
|
||||
SZ000967,0.26999999999999996,1,-29095.75883393512
|
||||
SZ002399,0.26999999999999996,4,-825385.5926764316
|
||||
SH600056,0.26999999999999996,1,2151.1847995192393
|
||||
SZ002458,0.26999999999999996,5,1250089.0410958903
|
||||
SH601860,0.26999999999999996,1,-52849.00643384521
|
||||
SZ002563,0.26999999999999996,1,-38892.42318705994
|
||||
SZ003022,0.26999999999999996,13,-628792.8210412195
|
||||
SH601928,0.26999999999999996,3,1217006.8493150685
|
||||
SH600928,0.26999999999999996,1,-108188.82970308381
|
||||
SH600729,0.26999999999999996,3,378892.0899433539
|
||||
SZ002423,0.26999999999999996,5,-115715.60896074373
|
||||
SH600968,0.26999999999999996,3,415679.0905988618
|
||||
SZ000937,0.26999999999999996,2,507150.68493150687
|
||||
SH600556,0.26999999999999996,9,-915951.0468077977
|
||||
SZ003035,0.26999999999999996,4,-620737.3731457555
|
||||
SH600649,0.26999999999999996,2,-144447.9980746712
|
||||
SH600787,0.26999999999999996,2,424852.486672515
|
||||
SZ000028,0.26999999999999996,4,994260.2739726026
|
||||
SH600095,0.26999999999999996,11,1211978.7865078663
|
||||
SH600776,0.26999999999999996,6,-123806.48017921165
|
||||
SZ000031,0.26999999999999996,6,61142.77408537207
|
||||
SH600339,0.26999999999999996,4,1250376.7123287672
|
||||
SH600006,0.26999999999999996,7,-1582794.823186819
|
||||
SH603317,0.26999999999999996,7,402654.0003617141
|
||||
SH600648,0.26999999999999996,4,-320142.22412696923
|
||||
SH600623,0.26999999999999996,2,-315058.51019633736
|
||||
SZ000062,0.26999999999999996,5,77424.99648156941
|
||||
SH600835,0.26999999999999996,5,-675433.362389107
|
||||
SZ002815,0.26999999999999996,3,-230692.53088355498
|
||||
SZ002424,0.26999999999999996,4,1024092.992822364
|
||||
SH600377,0.26999999999999996,1,55279.60882104716
|
||||
SH601139,0.26999999999999996,1,-85493.94819957169
|
||||
SH600299,0.26999999999999996,5,44763.91199307181
|
||||
SZ002948,0.26999999999999996,1,-130997.34930495129
|
||||
SZ000156,0.26999999999999996,3,126182.9068588271
|
||||
SZ002375,0.26999999999999996,5,-503704.1723574602
|
||||
SH600871,0.26999999999999996,1,74805.1630532484
|
||||
SZ300869,0.26999999999999996,1,-315929.3763211771
|
||||
SZ002302,0.26999999999999996,4,-345674.57053220057
|
||||
SH601228,0.26999999999999996,3,-204746.15346936608
|
||||
SH600639,0.26999999999999996,5,-874267.2713147431
|
||||
SH601298,0.26999999999999996,1,-5273.972602739588
|
||||
SH603379,0.26999999999999996,6,778511.804754071
|
||||
SZ002945,0.26999999999999996,8,-180518.7236334788
|
||||
SZ002653,0.26999999999999996,8,1644802.6757905507
|
||||
SZ001872,0.26999999999999996,1,-181946.14910747032
|
||||
SH600823,0.26999999999999996,4,-1012634.7666783128
|
||||
SZ300741,0.26999999999999996,1,-175244.41893296523
|
||||
SH603056,0.26999999999999996,2,491616.43835616455
|
||||
SH601869,0.26999999999999996,5,211536.5690975128
|
||||
SH603786,0.26999999999999996,7,769657.4994268871
|
||||
SH603708,0.26999999999999996,2,137353.7448811492
|
||||
SZ000553,0.26999999999999996,5,-578522.740003638
|
||||
SH600350,0.26999999999999996,1,42420.46753100173
|
||||
SH600657,0.26999999999999996,2,309410.57070502103
|
||||
SH603515,0.26999999999999996,2,-89726.10472652467
|
||||
SH603355,0.26999999999999996,6,112048.00090576698
|
||||
SH603719,0.26999999999999996,3,757555.4099034956
|
||||
SH601003,0.26999999999999996,3,-242322.08029099827
|
||||
SZ002946,0.26999999999999996,6,-109542.27883068207
|
||||
SH600917,0.26999999999999996,5,-27477.616364007874
|
||||
SZ002901,0.26999999999999996,7,297301.9658516297
|
||||
SH600903,0.26999999999999996,5,-492868.6188254448
|
||||
SH600956,0.26999999999999996,4,-1181595.5901998247
|
||||
SH601187,0.26999999999999996,1,-40634.25771244019
|
||||
SH603983,0.26999999999999996,3,-842927.210768046
|
|
|
@ -0,0 +1,340 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.27999999999999997,3,-1513444.412158909
|
||||
SZ000733,0.27999999999999997,2,-435244.91645000386
|
||||
SH601615,0.27999999999999997,2,-823319.4230701359
|
||||
SH688005,0.27999999999999997,1,-244133.99111549443
|
||||
SZ002180,0.27999999999999997,1,-123694.66662118028
|
||||
SZ002384,0.27999999999999997,3,-25897.15789954079
|
||||
SH600885,0.27999999999999997,1,15045.655835719805
|
||||
SZ300285,0.27999999999999997,1,-50935.17863806413
|
||||
SH605358,0.27999999999999997,1,-828078.0799780886
|
||||
SH601117,0.27999999999999997,2,403504.4718668631
|
||||
SZ002385,0.27999999999999997,1,-868767.5923760945
|
||||
SH688099,0.27999999999999997,3,-40599.85048236279
|
||||
SH600399,0.27999999999999997,2,-821528.450223403
|
||||
SH603613,0.27999999999999997,4,-1920724.8274091799
|
||||
SZ300037,0.27999999999999997,1,-358519.0504778355
|
||||
SH600765,0.27999999999999997,1,-244734.09263107023
|
||||
SH600256,0.27999999999999997,2,-363514.4042124454
|
||||
SH600487,0.27999999999999997,2,-882054.7201026274
|
||||
SH600563,0.27999999999999997,1,-813925.7052548798
|
||||
SH600754,0.27999999999999997,2,-581104.6645359143
|
||||
SZ002185,0.27999999999999997,1,-84128.50294244921
|
||||
SH601636,0.27999999999999997,1,-248015.44974821468
|
||||
SZ300751,0.27999999999999997,4,-1258508.165734733
|
||||
SZ300088,0.27999999999999997,1,-111603.75099279743
|
||||
SH603589,0.27999999999999997,2,-293261.02371649235
|
||||
SZ000630,0.27999999999999997,1,53263.52449500815
|
||||
SZ000988,0.27999999999999997,1,253917.80821917803
|
||||
SZ002268,0.27999999999999997,3,41642.6681708683
|
||||
SZ002353,0.27999999999999997,2,-359420.5714566336
|
||||
SH601689,0.27999999999999997,1,-1267314.6749274961
|
||||
SH601168,0.27999999999999997,3,486828.74406162096
|
||||
SZ300763,0.27999999999999997,6,-1826818.1331785503
|
||||
SH600141,0.27999999999999997,1,-401897.9913151059
|
||||
SH600392,0.27999999999999997,2,-212692.3833084136
|
||||
SZ000932,0.27999999999999997,1,13084.2682362079
|
||||
SZ300699,0.27999999999999997,1,-624779.0538711724
|
||||
SH600233,0.27999999999999997,1,-128919.90234786177
|
||||
SH600516,0.27999999999999997,1,-11806.650311141068
|
||||
SZ300058,0.27999999999999997,4,1574232.8767123292
|
||||
SH603456,0.27999999999999997,1,-100279.26348554276
|
||||
SZ002138,0.27999999999999997,1,-423561.8280298068
|
||||
SH600862,0.27999999999999997,1,-49604.07733259935
|
||||
SZ300146,0.27999999999999997,1,197057.5074153619
|
||||
SZ300223,0.27999999999999997,2,-453970.2580735048
|
||||
SZ300136,0.27999999999999997,1,-260512.04288398303
|
||||
SH600188,0.27999999999999997,2,-791270.8444057853
|
||||
SH600418,0.27999999999999997,4,-329611.4926197169
|
||||
SH600705,0.27999999999999997,1,264753.42465753434
|
||||
SZ000960,0.27999999999999997,2,37610.25502695062
|
||||
SZ300308,0.27999999999999997,1,262835.61643835617
|
||||
SH688065,0.27999999999999997,1,-131607.7732849428
|
||||
SZ300253,0.27999999999999997,6,1708737.2571053442
|
||||
SZ002080,0.27999999999999997,1,-67968.28526942959
|
||||
SZ000998,0.27999999999999997,1,-155353.94328346726
|
||||
SH688536,0.27999999999999997,3,-1224963.7279819294
|
||||
SZ002092,0.27999999999999997,1,132692.47743552108
|
||||
SH600875,0.27999999999999997,1,-426999.23836363544
|
||||
SZ000547,0.27999999999999997,1,-137505.14378280676
|
||||
SZ002409,0.27999999999999997,2,407518.658818017
|
||||
SH600521,0.27999999999999997,2,-430087.5621215715
|
||||
SZ000807,0.27999999999999997,2,559657.534066806
|
||||
SH600988,0.27999999999999997,2,-348446.375789569
|
||||
SZ000039,0.27999999999999997,1,-32380.930268555046
|
||||
SZ300296,0.27999999999999997,1,-34205.89456205892
|
||||
SZ002439,0.27999999999999997,1,254780.82191780827
|
||||
SZ002212,0.27999999999999997,1,-360806.8703581906
|
||||
SZ300418,0.27999999999999997,2,526246.5753424658
|
||||
SZ002078,0.27999999999999997,2,47659.029954266145
|
||||
SZ002223,0.27999999999999997,2,-480776.9775343193
|
||||
SH603893,0.27999999999999997,3,-121523.79109993391
|
||||
SZ002030,0.27999999999999997,1,-636236.0045284857
|
||||
SH600699,0.27999999999999997,1,-24170.05322164726
|
||||
SH600160,0.27999999999999997,1,-266234.42815695767
|
||||
SZ002444,0.27999999999999997,1,-537604.0222512218
|
||||
SH601198,0.27999999999999997,1,81171.81332714178
|
||||
SZ300724,0.27999999999999997,1,-677780.009921089
|
||||
SH600637,0.27999999999999997,1,119002.52842217442
|
||||
SZ300474,0.27999999999999997,4,1467823.0402922535
|
||||
SZ002465,0.27999999999999997,1,-52937.71384977277
|
||||
SH688208,0.27999999999999997,6,-1056435.554969274
|
||||
SH603605,0.27999999999999997,1,-85250.13662380211
|
||||
SZ300383,0.27999999999999997,1,-501552.11704701756
|
||||
SZ002507,0.27999999999999997,2,139258.2442578951
|
||||
SZ002557,0.27999999999999997,1,-189788.26158249407
|
||||
SH600549,0.27999999999999997,1,-424205.94930489524
|
||||
SZ000739,0.27999999999999997,1,-509463.5833356554
|
||||
SH600529,0.27999999999999997,2,-328485.8275631084
|
||||
SH600704,0.27999999999999997,1,30733.62267733604
|
||||
SH603290,0.27999999999999997,1,-313747.8383818299
|
||||
SZ002508,0.27999999999999997,1,-450018.4305258162
|
||||
SZ002739,0.27999999999999997,1,239429.66496981378
|
||||
SZ000636,0.27999999999999997,1,-223440.62372133648
|
||||
SH603198,0.27999999999999997,3,450997.1605846802
|
||||
SZ002156,0.27999999999999997,4,310690.1956103523
|
||||
SZ000830,0.27999999999999997,2,155646.31349749063
|
||||
SH600201,0.27999999999999997,2,155332.87967099642
|
||||
SH600153,0.27999999999999997,2,-141299.12977052468
|
||||
SZ000983,0.27999999999999997,3,-597970.1907742193
|
||||
SH600642,0.27999999999999997,1,248260.27397260285
|
||||
SZ002299,0.27999999999999997,1,-298496.8585956324
|
||||
SZ000629,0.27999999999999997,1,-453969.69837083487
|
||||
SZ002131,0.27999999999999997,2,552471.7725249963
|
||||
SZ000738,0.27999999999999997,2,-366119.0996708082
|
||||
SH603127,0.27999999999999997,2,-956553.9952791857
|
||||
SZ000623,0.27999999999999997,1,84973.97960374317
|
||||
SH600859,0.27999999999999997,3,-235740.14264353516
|
||||
SZ000519,0.27999999999999997,1,-416957.88092634187
|
||||
SH688521,0.27999999999999997,3,790424.6575342466
|
||||
SZ002273,0.27999999999999997,1,-200717.58507996763
|
||||
SH603444,0.27999999999999997,1,262068.49315068492
|
||||
SH600166,0.27999999999999997,2,253011.66920345012
|
||||
SZ002422,0.27999999999999997,1,250273.97260273984
|
||||
SH600732,0.27999999999999997,1,-74246.66904835813
|
||||
SZ002373,0.27999999999999997,2,382679.39592456573
|
||||
SH600803,0.27999999999999997,2,309292.9706360899
|
||||
SZ000050,0.27999999999999997,1,-271008.0285098457
|
||||
SZ000887,0.27999999999999997,1,-229827.11445533464
|
||||
SZ300357,0.27999999999999997,2,-45993.66252081178
|
||||
SH601699,0.27999999999999997,2,515027.3972602739
|
||||
SH600118,0.27999999999999997,1,-22487.197798630576
|
||||
SZ300070,0.27999999999999997,1,105982.91172927697
|
||||
SZ002372,0.27999999999999997,1,-186578.70969457328
|
||||
SZ000400,0.27999999999999997,1,8309.581773159014
|
||||
SH600271,0.27999999999999997,1,-32443.20193830951
|
||||
SH600258,0.27999999999999997,2,-530386.3423364589
|
||||
SZ300017,0.27999999999999997,1,265136.98630136973
|
||||
SZ002153,0.27999999999999997,5,1485022.2248347043
|
||||
SZ002152,0.27999999999999997,1,-7064.421846866502
|
||||
SZ002195,0.27999999999999997,2,523178.0821917809
|
||||
SZ300168,0.27999999999999997,2,534892.0367591758
|
||||
SZ002572,0.27999999999999997,2,112798.04968992787
|
||||
SH600315,0.27999999999999997,1,-44.37628252561626
|
||||
SZ002065,0.27999999999999997,1,-47862.65023413376
|
||||
SH600066,0.27999999999999997,1,261205.47945205486
|
||||
SZ000975,0.27999999999999997,1,179807.33324704343
|
||||
SH600027,0.27999999999999997,3,628294.472036212
|
||||
SZ000997,0.27999999999999997,1,121256.95978789235
|
||||
SH603218,0.27999999999999997,3,489552.52769568167
|
||||
SZ002203,0.27999999999999997,1,-35065.16884423813
|
||||
SZ002985,0.27999999999999997,1,-52346.75372453739
|
||||
SH600372,0.27999999999999997,2,-467381.62920061353
|
||||
SZ000513,0.27999999999999997,2,-125652.67299245916
|
||||
SZ300182,0.27999999999999997,2,823494.951094615
|
||||
SZ002506,0.27999999999999997,1,-36489.72602739728
|
||||
SH603156,0.27999999999999997,1,16759.01531841083
|
||||
SZ002408,0.27999999999999997,1,-162080.61778275188
|
||||
SZ002056,0.27999999999999997,1,-214483.52882205462
|
||||
SH600236,0.27999999999999997,1,-72654.4489695175
|
||||
SZ300001,0.27999999999999997,2,520638.96124459
|
||||
SZ300244,0.27999999999999997,1,-96758.57419513245
|
||||
SZ002250,0.27999999999999997,1,-319715.7034371034
|
||||
SZ002019,0.27999999999999997,1,85143.583447531
|
||||
SZ300024,0.27999999999999997,1,265041.09589041094
|
||||
SH601872,0.27999999999999997,3,-16693.082552861306
|
||||
SH600998,0.27999999999999997,1,162354.9682453791
|
||||
SZ300630,0.27999999999999997,1,-1007365.4423248414
|
||||
SZ002221,0.27999999999999997,1,29835.108502840547
|
||||
SZ000021,0.27999999999999997,1,263698.63013698626
|
||||
SH600348,0.27999999999999997,1,-163126.9860270784
|
||||
SZ300251,0.27999999999999997,3,1277747.1393800366
|
||||
SH600535,0.27999999999999997,2,606310.6538879281
|
||||
SZ000401,0.27999999999999997,1,94462.21829429975
|
||||
SZ000878,0.27999999999999997,1,-42475.16738730365
|
||||
SZ002831,0.27999999999999997,1,-210586.34659230086
|
||||
SZ300009,0.27999999999999997,2,115067.01216610166
|
||||
SH600728,0.27999999999999997,2,334182.3956353467
|
||||
SZ000686,0.27999999999999997,1,22844.439284885004
|
||||
SZ002430,0.27999999999999997,2,621562.6893486246
|
||||
SH600171,0.27999999999999997,1,-177214.17854564197
|
||||
SZ000537,0.27999999999999997,1,-154090.92829778875
|
||||
SZ300115,0.27999999999999997,1,-358638.2423844078
|
||||
SZ002683,0.27999999999999997,1,-77096.6918709695
|
||||
SZ002745,0.27999999999999997,1,-18533.19283456267
|
||||
SH600718,0.27999999999999997,1,-52359.65140299732
|
||||
SH603568,0.27999999999999997,1,-149165.163554819
|
||||
SZ002127,0.27999999999999997,1,-160562.04508296528
|
||||
SZ002532,0.27999999999999997,1,-287110.07818603644
|
||||
SH600390,0.27999999999999997,1,41204.474048007934
|
||||
SZ300482,0.27999999999999997,5,-1015844.5318751282
|
||||
SZ000970,0.27999999999999997,1,-152294.8948460112
|
||||
SH603858,0.27999999999999997,2,-7948.695167989645
|
||||
SH600970,0.27999999999999997,1,257561.64383561656
|
||||
SZ000690,0.27999999999999997,1,216739.5252398844
|
||||
SH600060,0.27999999999999997,1,255931.5068493152
|
||||
SH600282,0.27999999999999997,1,68721.70797037432
|
||||
SZ300463,0.27999999999999997,2,-543243.3943136034
|
||||
SH600498,0.27999999999999997,2,198965.9143900659
|
||||
SZ300026,0.27999999999999997,2,-684826.3565631679
|
||||
SH600380,0.27999999999999997,2,76291.94930422664
|
||||
SH600673,0.27999999999999997,1,-719279.0478975195
|
||||
SH603712,0.27999999999999997,1,-230341.23689260427
|
||||
SH600528,0.27999999999999997,1,86659.33090464931
|
||||
SZ300212,0.27999999999999997,4,2081876.7123287674
|
||||
SZ300072,0.27999999999999997,1,-130114.76699220028
|
||||
SZ000930,0.27999999999999997,1,28652.51016107185
|
||||
SH600325,0.27999999999999997,1,263219.1780821918
|
||||
SH600667,0.27999999999999997,2,9572.485033621546
|
||||
SZ002382,0.27999999999999997,1,-130999.57684425372
|
||||
SZ000729,0.27999999999999997,1,258328.7671232876
|
||||
SH600895,0.27999999999999997,1,-80461.7952777588
|
||||
SH600511,0.27999999999999997,2,517616.43835616455
|
||||
SH603885,0.27999999999999997,2,584766.9934428362
|
||||
SH688006,0.27999999999999997,1,-336845.09424186486
|
||||
SH601456,0.27999999999999997,1,-82496.13298131563
|
||||
SZ000581,0.27999999999999997,1,-111322.10502009522
|
||||
SH600500,0.27999999999999997,1,-95779.76145786009
|
||||
SH601717,0.27999999999999997,2,91388.1520476846
|
||||
SZ002505,0.27999999999999997,1,-301590.3755469239
|
||||
SZ300315,0.27999999999999997,3,783808.2191780823
|
||||
SH600216,0.27999999999999997,1,-133293.33836612516
|
||||
SZ002396,0.27999999999999997,1,-633432.4414896511
|
||||
SH603927,0.27999999999999997,1,252191.78082191793
|
||||
SH603638,0.27999999999999997,1,-145402.9629438503
|
||||
SH603225,0.27999999999999997,1,-333730.1995594551
|
||||
SZ002670,0.27999999999999997,1,-374249.24802401423
|
||||
SH600507,0.27999999999999997,1,-139833.76527212147
|
||||
SH603866,0.27999999999999997,1,-177187.2905346045
|
||||
SZ002004,0.27999999999999997,2,-98249.19623980546
|
||||
SZ002368,0.27999999999999997,2,522027.39726027404
|
||||
SZ300376,0.27999999999999997,1,-86290.84792891405
|
||||
SZ002048,0.27999999999999997,1,-139349.2905189767
|
||||
SH600446,0.27999999999999997,3,775369.8630136987
|
||||
SH601778,0.27999999999999997,1,-212928.6654808382
|
||||
SZ300271,0.27999999999999997,1,-244730.38432223932
|
||||
SH601577,0.27999999999999997,1,34506.15152961919
|
||||
SH688188,0.27999999999999997,1,-39543.25652740188
|
||||
SH600131,0.27999999999999997,3,500197.63592912594
|
||||
SZ002010,0.27999999999999997,1,-49868.78800909125
|
||||
SZ002925,0.27999999999999997,1,-280996.755190962
|
||||
SH600663,0.27999999999999997,1,-111377.21064052435
|
||||
SZ300166,0.27999999999999997,2,135632.77767881542
|
||||
SZ002124,0.27999999999999997,1,-45383.56164383554
|
||||
SH600546,0.27999999999999997,2,114099.8145857684
|
||||
SH600764,0.27999999999999997,1,42256.72142901252
|
||||
SZ002690,0.27999999999999997,2,23868.223162499286
|
||||
SZ002174,0.27999999999999997,5,1573178.0821917807
|
||||
SH600597,0.27999999999999997,1,128936.09814842683
|
||||
SH600908,0.27999999999999997,1,111991.45676830162
|
||||
SH603883,0.27999999999999997,1,-373612.00157317956
|
||||
SH603228,0.27999999999999997,1,-182012.17991804672
|
||||
SZ002155,0.27999999999999997,1,257082.19178082203
|
||||
SH600566,0.27999999999999997,1,290129.54516193585
|
||||
SZ002281,0.27999999999999997,3,810357.8110957359
|
||||
SH600158,0.27999999999999997,1,-156914.9466925897
|
||||
SH600707,0.27999999999999997,1,-46697.984320517295
|
||||
SH600572,0.27999999999999997,2,508698.6301369864
|
||||
SZ002440,0.27999999999999997,2,-81300.12468645762
|
||||
SZ000961,0.27999999999999997,1,-336126.3460895936
|
||||
SH688029,0.27999999999999997,2,-279270.5189466817
|
||||
SZ000990,0.27999999999999997,1,-49743.61714003223
|
||||
SZ002183,0.27999999999999997,1,-76247.37698347209
|
||||
SH600435,0.27999999999999997,1,264369.8630136986
|
||||
SH601000,0.27999999999999997,1,252863.01369863018
|
||||
SZ000090,0.27999999999999997,1,42129.648806177494
|
||||
SH600906,0.27999999999999997,1,-57340.10804763426
|
||||
SZ002429,0.27999999999999997,1,-83813.95697613162
|
||||
SH688088,0.27999999999999997,3,270539.7822065453
|
||||
SH600398,0.27999999999999997,2,412311.96787556866
|
||||
SH600373,0.27999999999999997,1,264273.97260273976
|
||||
SH600037,0.27999999999999997,1,93497.528872809
|
||||
SZ002867,0.27999999999999997,2,514036.89506786864
|
||||
SH600376,0.27999999999999997,3,-876128.8313875379
|
||||
SZ001914,0.27999999999999997,1,-106114.87684669509
|
||||
SZ002085,0.27999999999999997,1,-139543.91557772027
|
||||
SH600167,0.27999999999999997,1,-3706.3234162753506
|
||||
SZ002416,0.27999999999999997,1,-288404.60409325134
|
||||
SZ002244,0.27999999999999997,1,263602.73972602753
|
||||
SH600329,0.27999999999999997,2,517904.1095890412
|
||||
SH600259,0.27999999999999997,1,-182437.11859343652
|
||||
SH688321,0.27999999999999997,1,-341926.1377308939
|
||||
SH601718,0.27999999999999997,1,17651.441024728676
|
||||
SH600026,0.27999999999999997,1,525287.6712328767
|
||||
SH603000,0.27999999999999997,2,1059205.479452055
|
||||
SZ002038,0.27999999999999997,1,26001.152585139454
|
||||
SZ002242,0.27999999999999997,1,-75026.78134114269
|
||||
SZ300133,0.27999999999999997,1,261205.47945205492
|
||||
SZ002705,0.27999999999999997,1,-192650.40977703256
|
||||
SZ000402,0.27999999999999997,1,-168408.8178462791
|
||||
SZ000158,0.27999999999999997,1,-50488.68629182845
|
||||
SZ002390,0.27999999999999997,1,-460004.06356281514
|
||||
SZ002387,0.27999999999999997,2,150480.09908860672
|
||||
SZ000415,0.27999999999999997,1,-84200.88522845072
|
||||
SH601991,0.27999999999999997,2,515274.037163403
|
||||
SH601975,0.27999999999999997,1,-57825.43812657848
|
||||
SH603650,0.27999999999999997,4,407375.36749334435
|
||||
SH600959,0.27999999999999997,1,85480.9527474218
|
||||
SH688289,0.27999999999999997,1,-234151.4408451484
|
||||
SH600582,0.27999999999999997,2,157908.24406621233
|
||||
SH600062,0.27999999999999997,1,-310588.7763167048
|
||||
SZ300257,0.27999999999999997,1,-100973.5523320915
|
||||
SH600266,0.27999999999999997,2,11980.247400852095
|
||||
SZ002399,0.27999999999999997,2,-409059.01035052026
|
||||
SH600056,0.27999999999999997,3,1074818.1771470266
|
||||
SZ003022,0.27999999999999997,2,-743945.8168532269
|
||||
SH601928,0.27999999999999997,3,763191.7808219179
|
||||
SH600729,0.27999999999999997,2,489393.6319881526
|
||||
SZ002423,0.27999999999999997,1,393902.81213322
|
||||
SZ002468,0.27999999999999997,2,-47630.44991014914
|
||||
SH600556,0.27999999999999997,2,-233785.9085408912
|
||||
SZ003035,0.27999999999999997,1,-438044.38177176344
|
||||
SH600787,0.27999999999999997,1,250945.20547945204
|
||||
SZ000028,0.27999999999999997,3,770671.2328767122
|
||||
SH600095,0.27999999999999997,2,-42573.83761708264
|
||||
SH600776,0.27999999999999997,1,-6013.0195750683
|
||||
SZ000031,0.27999999999999997,1,-77882.60936834523
|
||||
SH600339,0.27999999999999997,3,776328.7671232878
|
||||
SH600006,0.27999999999999997,1,-249264.60456111893
|
||||
SH603317,0.27999999999999997,1,-150409.15504277474
|
||||
SZ000062,0.27999999999999997,1,-11708.979037746254
|
||||
SH600835,0.27999999999999997,1,56151.14686845231
|
||||
SZ002815,0.27999999999999997,1,-252504.07705149206
|
||||
SZ002424,0.27999999999999997,3,850104.6642245633
|
||||
SH600299,0.27999999999999997,1,-26473.269412054466
|
||||
SZ002948,0.27999999999999997,1,-69899.45569697082
|
||||
SZ000156,0.27999999999999997,1,129003.9245010847
|
||||
SZ002375,0.27999999999999997,1,-28782.381111482235
|
||||
SH601828,0.27999999999999997,2,-76847.87290165958
|
||||
SZ300869,0.27999999999999997,3,-1077072.349230677
|
||||
SZ002302,0.27999999999999997,1,-14126.419728664943
|
||||
SH601228,0.27999999999999997,1,100430.26357430262
|
||||
SH601969,0.27999999999999997,1,-234490.04055335387
|
||||
SH603379,0.27999999999999997,1,-260187.66938711266
|
||||
SZ002945,0.27999999999999997,1,-165933.4118780609
|
||||
SZ002653,0.27999999999999997,2,509657.5342465753
|
||||
SH600823,0.27999999999999997,2,-632480.1781465504
|
||||
SZ300741,0.27999999999999997,1,-53309.09346133779
|
||||
SH603056,0.27999999999999997,2,217637.48189188482
|
||||
SH601869,0.27999999999999997,1,-535028.9303980002
|
||||
SH603786,0.27999999999999997,1,-386578.31189975026
|
||||
SZ000553,0.27999999999999997,1,-113668.25242161949
|
||||
SZ001203,0.27999999999999997,1,-945682.7211139722
|
||||
SH600657,0.27999999999999997,1,-637372.4789524117
|
||||
SH603355,0.27999999999999997,1,-144376.35722650908
|
||||
SH603719,0.27999999999999997,1,-240478.5410107494
|
||||
SH601003,0.27999999999999997,1,26329.158787201864
|
||||
SZ002946,0.27999999999999997,2,376201.16753402597
|
||||
SH603868,0.27999999999999997,1,-146359.49823391563
|
||||
SZ002901,0.27999999999999997,2,-528921.5500645036
|
||||
SH600903,0.27999999999999997,1,-44908.59216886615
|
|
|
@ -0,0 +1,341 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.29,3,-1513444.412158909
|
||||
SZ000733,0.29,2,-435244.91645000386
|
||||
SH601615,0.29,2,-823319.4230701359
|
||||
SH688005,0.29,1,-244133.99111549443
|
||||
SZ002180,0.29,1,-123694.66662118028
|
||||
SZ002384,0.29,3,-6897.157899540733
|
||||
SH600885,0.29,1,15045.655835719805
|
||||
SZ300285,0.29,1,-50935.17863806413
|
||||
SH605358,0.29,1,-828078.0799780886
|
||||
SH601117,0.29,2,413004.4718668631
|
||||
SZ002385,0.29,1,-868767.5923760945
|
||||
SH688099,0.29,3,-184267.35262485652
|
||||
SH600399,0.29,2,-821528.450223403
|
||||
SH603613,0.29,4,-1920724.8274091799
|
||||
SZ300037,0.29,1,-358519.0504778355
|
||||
SH600765,0.29,1,-244734.09263107023
|
||||
SH600256,0.29,2,-363514.4042124454
|
||||
SH600487,0.29,2,-882054.7201026274
|
||||
SH600563,0.29,1,-813925.7052548798
|
||||
SH600754,0.29,2,-581104.6645359143
|
||||
SZ002185,0.29,1,-84128.50294244921
|
||||
SH601636,0.29,1,-248015.44974821468
|
||||
SZ300751,0.29,4,-1258508.165734733
|
||||
SZ300088,0.29,1,-111603.75099279743
|
||||
SH603589,0.29,2,-283761.0237164923
|
||||
SZ000630,0.29,1,53263.52449500815
|
||||
SZ000988,0.29,1,263417.8082191781
|
||||
SZ002268,0.29,3,69759.10652703245
|
||||
SZ002353,0.29,2,-359420.5714566336
|
||||
SH601689,0.29,1,-1267314.6749274961
|
||||
SH601168,0.29,2,505732.85365066206
|
||||
SZ300763,0.29,6,-1826818.1331785503
|
||||
SH600141,0.29,1,-401897.9913151059
|
||||
SH600392,0.29,2,-212692.3833084136
|
||||
SZ000932,0.29,1,13084.2682362079
|
||||
SZ300699,0.29,1,-624779.0538711724
|
||||
SH600233,0.29,1,-128919.90234786177
|
||||
SH600516,0.29,1,-11806.650311141068
|
||||
SZ300058,0.29,4,1630945.2054794522
|
||||
SH603456,0.29,1,-100279.26348554276
|
||||
SZ002138,0.29,1,-423561.8280298068
|
||||
SH600862,0.29,1,-49604.07733259935
|
||||
SZ300146,0.29,1,197057.5074153619
|
||||
SZ300223,0.29,2,-444470.25807350466
|
||||
SZ300136,0.29,1,-260512.04288398303
|
||||
SH600188,0.29,2,-791270.8444057853
|
||||
SH600418,0.29,4,-310611.49261971685
|
||||
SH600705,0.29,1,274253.4246575343
|
||||
SZ000960,0.29,2,47110.25502695053
|
||||
SZ300308,0.29,1,272335.6164383562
|
||||
SH688065,0.29,1,-131607.7732849428
|
||||
SZ300253,0.29,6,1775237.2571053447
|
||||
SZ002080,0.29,1,-67968.28526942959
|
||||
SZ000998,0.29,1,-155353.94328346726
|
||||
SH688536,0.29,3,-1224963.7279819294
|
||||
SZ002092,0.29,1,132692.47743552108
|
||||
SH600875,0.29,1,-426999.23836363544
|
||||
SZ000547,0.29,1,-137505.14378280676
|
||||
SZ002409,0.29,2,417018.6588180169
|
||||
SH600521,0.29,2,-411087.5621215716
|
||||
SZ000807,0.29,2,578657.534066806
|
||||
SH600988,0.29,2,-348446.375789569
|
||||
SZ000039,0.29,1,-32380.930268555046
|
||||
SZ300296,0.29,1,-34205.89456205892
|
||||
SZ002439,0.29,1,264089.0410958904
|
||||
SZ002212,0.29,1,-360806.8703581906
|
||||
SZ300418,0.29,2,545246.5753424659
|
||||
SZ002078,0.29,2,47659.029954266145
|
||||
SZ002223,0.29,2,-480776.9775343193
|
||||
SH603893,0.29,2,-331922.2377894429
|
||||
SZ002030,0.29,1,-636236.0045284857
|
||||
SH600699,0.29,1,-24170.05322164726
|
||||
SH600160,0.29,1,-266234.42815695767
|
||||
SZ002444,0.29,1,-537604.0222512218
|
||||
SH601198,0.29,1,81171.81332714178
|
||||
SZ300724,0.29,1,-677780.009921089
|
||||
SH600637,0.29,1,119002.52842217442
|
||||
SZ300474,0.29,5,1524727.1498812945
|
||||
SZ002465,0.29,1,-52937.71384977277
|
||||
SH688208,0.29,6,-1037435.554969274
|
||||
SH603605,0.29,1,-85250.13662380211
|
||||
SZ300383,0.29,1,-501552.11704701756
|
||||
SZ002507,0.29,2,139258.2442578951
|
||||
SZ002557,0.29,1,-189788.26158249407
|
||||
SH600549,0.29,1,-424205.94930489524
|
||||
SZ000739,0.29,1,-509463.5833356554
|
||||
SH600529,0.29,2,-328485.8275631084
|
||||
SH600704,0.29,1,30733.62267733604
|
||||
SH603290,0.29,1,-313747.8383818299
|
||||
SZ002508,0.29,1,-450018.4305258162
|
||||
SZ002739,0.29,1,239429.66496981378
|
||||
SZ000636,0.29,1,-223440.62372133648
|
||||
SH603198,0.29,3,469997.1605846802
|
||||
SZ002156,0.29,4,348402.5243774756
|
||||
SZ000830,0.29,2,165050.42308653184
|
||||
SH600201,0.29,2,164832.8796709964
|
||||
SH600153,0.29,2,-131895.0201814836
|
||||
SZ000983,0.29,3,-588470.1907742193
|
||||
SH600642,0.29,1,257760.27397260274
|
||||
SZ002299,0.29,1,-298496.8585956324
|
||||
SZ000629,0.29,1,-453969.69837083487
|
||||
SZ002131,0.29,2,561971.7725249964
|
||||
SZ000738,0.29,2,-366119.0996708082
|
||||
SH603127,0.29,2,-956553.9952791857
|
||||
SZ000623,0.29,1,84973.97960374317
|
||||
SH600859,0.29,3,-216740.14264353516
|
||||
SZ000519,0.29,1,-416957.88092634187
|
||||
SH688521,0.29,2,818636.9863013698
|
||||
SZ002273,0.29,1,-200717.58507996763
|
||||
SH603444,0.29,1,271568.4931506849
|
||||
SH600166,0.29,2,262415.7787924912
|
||||
SZ002422,0.29,1,259773.97260273973
|
||||
SH600732,0.29,1,-74246.66904835813
|
||||
SZ002373,0.29,2,392179.39592456573
|
||||
SH600803,0.29,2,318697.08022513083
|
||||
SZ000050,0.29,1,-271008.0285098457
|
||||
SZ000887,0.29,1,-229827.11445533464
|
||||
SZ300357,0.29,2,-45993.66252081178
|
||||
SH601699,0.29,2,534027.397260274
|
||||
SH600118,0.29,1,-22487.197798630576
|
||||
SZ300070,0.29,1,105982.91172927697
|
||||
SZ002372,0.29,1,-186578.70969457328
|
||||
SZ000400,0.29,1,8309.581773159014
|
||||
SH600271,0.29,1,-32443.20193830951
|
||||
SH600258,0.29,2,-530386.3423364589
|
||||
SZ300017,0.29,1,274636.98630136985
|
||||
SZ002153,0.29,5,1542022.2248347045
|
||||
SZ002152,0.29,1,-7064.421846866502
|
||||
SZ002195,0.29,2,542178.0821917809
|
||||
SZ300168,0.29,2,544392.0367591758
|
||||
SZ002572,0.29,2,121339.14558033898
|
||||
SH600315,0.29,1,-44.37628252561626
|
||||
SZ002065,0.29,1,-47862.65023413376
|
||||
SH600066,0.29,1,270705.4794520547
|
||||
SZ000975,0.29,1,179807.33324704343
|
||||
SH600027,0.29,3,637794.472036212
|
||||
SZ000997,0.29,1,121256.95978789235
|
||||
SH603218,0.29,3,508360.74687376374
|
||||
SZ002203,0.29,1,-35065.16884423813
|
||||
SZ002985,0.29,1,-52346.75372453739
|
||||
SH600372,0.29,2,-467381.62920061353
|
||||
SZ000513,0.29,2,-125652.67299245916
|
||||
SZ300182,0.29,2,832994.951094615
|
||||
SZ002506,0.29,1,-36489.72602739728
|
||||
SH603156,0.29,1,16759.01531841083
|
||||
SZ002408,0.29,1,-162080.61778275188
|
||||
SZ002056,0.29,1,-214483.52882205462
|
||||
SH600236,0.29,1,-72654.4489695175
|
||||
SZ300001,0.29,2,530043.070833631
|
||||
SZ300244,0.29,1,-96758.57419513245
|
||||
SZ002250,0.29,1,-319715.7034371034
|
||||
SZ002019,0.29,1,85143.583447531
|
||||
SZ300024,0.29,1,274541.09589041094
|
||||
SH601872,0.29,3,-7193.082552861219
|
||||
SH600998,0.29,1,162354.9682453791
|
||||
SZ300630,0.29,1,-1007365.4423248414
|
||||
SZ002221,0.29,1,29835.108502840547
|
||||
SZ000021,0.29,1,273198.6301369864
|
||||
SH600348,0.29,1,-163126.9860270784
|
||||
SZ300251,0.29,3,1315747.1393800366
|
||||
SH600535,0.29,3,625118.8730660105
|
||||
SZ000401,0.29,1,94462.21829429975
|
||||
SZ000878,0.29,1,-42475.16738730365
|
||||
SZ002831,0.29,1,-210586.34659230086
|
||||
SZ300009,0.29,2,123895.77928938926
|
||||
SH600728,0.29,2,343682.3956353467
|
||||
SZ000686,0.29,1,22844.439284885004
|
||||
SZ002430,0.29,2,631062.6893486247
|
||||
SH600171,0.29,1,-177214.17854564197
|
||||
SZ000537,0.29,1,-154090.92829778875
|
||||
SZ300115,0.29,1,-358638.2423844078
|
||||
SZ002683,0.29,1,-77096.6918709695
|
||||
SZ002745,0.29,1,-18533.19283456267
|
||||
SH600718,0.29,1,-52359.65140299732
|
||||
SH603568,0.29,1,-149165.163554819
|
||||
SZ002127,0.29,1,-160562.04508296528
|
||||
SZ002532,0.29,1,-287110.07818603644
|
||||
SH600390,0.29,1,41204.474048007934
|
||||
SZ300482,0.29,5,-996844.5318751279
|
||||
SZ000970,0.29,1,-152294.8948460112
|
||||
SH603858,0.29,2,1551.3048320103553
|
||||
SH600970,0.29,1,267061.64383561653
|
||||
SZ000690,0.29,1,216739.5252398844
|
||||
SH600060,0.29,1,265143.8356164383
|
||||
SH600282,0.29,1,68721.70797037432
|
||||
SZ300463,0.29,2,-543243.3943136034
|
||||
SH600498,0.29,2,207219.3390476002
|
||||
SZ300026,0.29,2,-684826.3565631679
|
||||
SH600380,0.29,2,76291.94930422664
|
||||
SH600673,0.29,1,-719279.0478975195
|
||||
SH603712,0.29,1,-230341.23689260427
|
||||
SH600528,0.29,1,86659.33090464931
|
||||
SZ300212,0.29,4,2156917.8082191786
|
||||
SZ300072,0.29,1,-130114.76699220028
|
||||
SZ000930,0.29,1,28652.51016107185
|
||||
SH600325,0.29,1,272623.28767123295
|
||||
SH600667,0.29,2,19072.485033621488
|
||||
SZ002382,0.29,1,-130999.57684425372
|
||||
SZ000729,0.29,1,267732.8767123287
|
||||
SH600895,0.29,1,-80461.7952777588
|
||||
SH600511,0.29,2,536520.5479452056
|
||||
SH603885,0.29,3,603671.103031877
|
||||
SH688006,0.29,1,-336845.09424186486
|
||||
SH601456,0.29,1,-82496.13298131563
|
||||
SZ000581,0.29,1,-111322.10502009522
|
||||
SH600500,0.29,1,-95779.76145786009
|
||||
SH601717,0.29,2,91388.1520476846
|
||||
SZ002505,0.29,1,-301590.3755469239
|
||||
SZ300315,0.29,3,812308.2191780824
|
||||
SH600216,0.29,1,-133293.33836612516
|
||||
SZ002396,0.29,1,-633432.4414896511
|
||||
SH603927,0.29,1,261691.78082191775
|
||||
SH603638,0.29,1,-145402.9629438503
|
||||
SH603225,0.29,1,-333730.1995594551
|
||||
SZ002670,0.29,1,-374249.24802401423
|
||||
SH600507,0.29,1,-139833.76527212147
|
||||
SH603866,0.29,1,-177187.2905346045
|
||||
SZ002595,0.29,2,216402.83698956395
|
||||
SZ002004,0.29,2,-98249.19623980546
|
||||
SZ002368,0.29,2,540931.5068493154
|
||||
SZ300376,0.29,1,-86290.84792891405
|
||||
SZ002048,0.29,1,-139349.2905189767
|
||||
SH600446,0.29,3,642447.926561848
|
||||
SH601778,0.29,1,-212928.6654808382
|
||||
SZ300271,0.29,1,-244730.38432223932
|
||||
SH601577,0.29,1,34506.15152961919
|
||||
SH688188,0.29,1,-39543.25652740188
|
||||
SH600131,0.29,3,519101.74551816704
|
||||
SZ002010,0.29,1,-49868.78800909125
|
||||
SZ002925,0.29,1,-280996.755190962
|
||||
SH600663,0.29,1,-111377.21064052435
|
||||
SZ300166,0.29,2,145132.77767881547
|
||||
SZ002124,0.29,1,-45383.56164383554
|
||||
SH600546,0.29,2,114099.8145857684
|
||||
SH600764,0.29,1,42256.72142901252
|
||||
SZ002690,0.29,2,33080.55192962257
|
||||
SZ002174,0.29,5,1630178.082191781
|
||||
SH600597,0.29,1,128936.09814842683
|
||||
SH600908,0.29,1,111991.45676830162
|
||||
SH603883,0.29,1,-373612.00157317956
|
||||
SH603228,0.29,1,-182012.17991804672
|
||||
SZ002155,0.29,1,266582.19178082206
|
||||
SH600566,0.29,1,290129.54516193585
|
||||
SZ002281,0.29,3,838857.811095736
|
||||
SH600158,0.29,1,-156914.9466925897
|
||||
SH600707,0.29,1,-46697.984320517295
|
||||
SH600572,0.29,1,527602.7397260275
|
||||
SZ002440,0.29,2,-81300.12468645762
|
||||
SZ000961,0.29,1,-336126.3460895936
|
||||
SH688029,0.29,2,-279270.5189466817
|
||||
SZ000990,0.29,1,-49743.61714003223
|
||||
SZ002183,0.29,1,-76247.37698347209
|
||||
SH600435,0.29,1,24295.930701047648
|
||||
SH601000,0.29,1,262363.0136986302
|
||||
SZ000090,0.29,1,42129.648806177494
|
||||
SH600906,0.29,1,-57340.10804763426
|
||||
SZ002429,0.29,1,-83813.95697613162
|
||||
SH688088,0.29,3,20402.560474142083
|
||||
SH600398,0.29,2,421811.96787556866
|
||||
SH600373,0.29,1,273773.97260273964
|
||||
SH600037,0.29,1,93497.528872809
|
||||
SZ002867,0.29,2,523536.8950678687
|
||||
SH600376,0.29,3,-866628.8313875378
|
||||
SZ001914,0.29,1,-106114.87684669509
|
||||
SZ002085,0.29,1,-139543.91557772027
|
||||
SH600167,0.29,1,-3706.3234162753506
|
||||
SZ002416,0.29,1,-288404.60409325134
|
||||
SZ002244,0.29,1,272719.1780821919
|
||||
SH600329,0.29,2,536904.1095890413
|
||||
SH600259,0.29,1,-182437.11859343652
|
||||
SH688321,0.29,1,-341926.1377308939
|
||||
SH601718,0.29,1,17651.441024728676
|
||||
SH600026,0.29,1,543328.7671232878
|
||||
SH603000,0.29,1,1097109.5890410957
|
||||
SZ002038,0.29,1,26001.152585139454
|
||||
SZ002242,0.29,1,-75026.78134114269
|
||||
SZ300133,0.29,1,270705.47945205483
|
||||
SZ002705,0.29,1,-192650.40977703256
|
||||
SZ000402,0.29,1,-168408.8178462791
|
||||
SZ000158,0.29,1,-50488.68629182845
|
||||
SZ002390,0.29,1,-460004.06356281514
|
||||
SZ002387,0.29,2,159980.09908860654
|
||||
SZ000415,0.29,1,-84200.88522845072
|
||||
SH601991,0.29,2,515274.037163403
|
||||
SH601975,0.29,1,-57825.43812657848
|
||||
SH603650,0.29,4,435587.69626046764
|
||||
SH600959,0.29,1,85480.9527474218
|
||||
SH688289,0.29,1,-234151.4408451484
|
||||
SH600582,0.29,2,157908.24406621233
|
||||
SH600062,0.29,1,-310588.7763167048
|
||||
SZ300257,0.29,1,-100973.5523320915
|
||||
SH600266,0.29,2,21480.24740085198
|
||||
SZ002399,0.29,2,-409059.01035052026
|
||||
SH600056,0.29,3,1112818.1771470266
|
||||
SZ003022,0.29,2,-743945.8168532269
|
||||
SH601928,0.29,3,791212.3287671232
|
||||
SH600729,0.29,2,498893.6319881526
|
||||
SZ002423,0.29,1,403402.81213322
|
||||
SZ002468,0.29,2,-47630.44991014914
|
||||
SH600556,0.29,2,-390069.14117424015
|
||||
SZ003035,0.29,1,-438044.38177176344
|
||||
SH600787,0.29,1,260445.20547945215
|
||||
SZ000028,0.29,2,799075.3424657533
|
||||
SH600095,0.29,2,-23573.837617082754
|
||||
SH600776,0.29,1,-6013.0195750683
|
||||
SZ000031,0.29,1,-77882.60936834523
|
||||
SH600339,0.29,3,804732.876712329
|
||||
SH600006,0.29,1,-249264.60456111893
|
||||
SH603317,0.29,1,-150409.15504277474
|
||||
SZ000062,0.29,1,-11708.979037746254
|
||||
SH600835,0.29,1,56151.14686845231
|
||||
SZ002815,0.29,1,-252504.07705149206
|
||||
SZ002424,0.29,4,878508.7738136043
|
||||
SH600299,0.29,1,-26473.269412054466
|
||||
SZ002948,0.29,1,-69899.45569697082
|
||||
SZ000156,0.29,1,129003.9245010847
|
||||
SZ002375,0.29,1,-28782.381111482235
|
||||
SH601828,0.29,2,-67347.87290165946
|
||||
SZ300869,0.29,3,-1077072.349230677
|
||||
SZ002302,0.29,1,-14126.419728664943
|
||||
SH601228,0.29,1,100430.26357430262
|
||||
SH601969,0.29,1,-234490.04055335387
|
||||
SH603379,0.29,1,-260187.66938711266
|
||||
SZ002945,0.29,1,-165933.4118780609
|
||||
SZ002653,0.29,2,528465.7534246575
|
||||
SH600823,0.29,2,-632480.1781465504
|
||||
SZ300741,0.29,1,-53309.09346133779
|
||||
SH603056,0.29,2,227137.48189188488
|
||||
SH601869,0.29,1,-535028.9303980002
|
||||
SH603786,0.29,1,-386578.31189975026
|
||||
SZ000553,0.29,1,-113668.25242161949
|
||||
SZ001203,0.29,1,-945682.7211139722
|
||||
SH600657,0.29,1,-637372.4789524117
|
||||
SH603355,0.29,1,-144376.35722650908
|
||||
SH603719,0.29,1,-240478.5410107494
|
||||
SH601003,0.29,1,26329.158787201864
|
||||
SZ002946,0.29,2,385701.1675340258
|
||||
SH603868,0.29,1,-146359.49823391563
|
||||
SZ002901,0.29,2,-528921.5500645036
|
||||
SH600903,0.29,1,-44908.59216886615
|
|
|
@ -0,0 +1,341 @@
|
|||
symbol,take_profit_pct,trades,profit
|
||||
SH600522,0.3,3,-1513444.412158909
|
||||
SZ000733,0.3,2,-435244.91645000386
|
||||
SH601615,0.3,2,-823319.4230701359
|
||||
SH688005,0.3,1,-244133.99111549443
|
||||
SZ002180,0.3,1,-123694.66662118028
|
||||
SZ002384,0.3,3,12102.842100459384
|
||||
SH600885,0.3,1,15045.655835719805
|
||||
SZ300285,0.3,1,-50935.17863806413
|
||||
SH605358,0.3,1,-828078.0799780886
|
||||
SH601117,0.3,2,422504.4718668631
|
||||
SZ002385,0.3,1,-868767.5923760945
|
||||
SH688099,0.3,3,-165267.35262485652
|
||||
SH600399,0.3,2,-821528.450223403
|
||||
SH603613,0.3,4,-1920724.8274091799
|
||||
SZ300037,0.3,1,-358519.0504778355
|
||||
SH600765,0.3,1,-244734.09263107023
|
||||
SH600256,0.3,2,-363514.4042124454
|
||||
SH600487,0.3,2,-882054.7201026274
|
||||
SH600563,0.3,1,-813925.7052548798
|
||||
SH600754,0.3,2,-581104.6645359143
|
||||
SZ002185,0.3,1,-84128.50294244921
|
||||
SH601636,0.3,1,-248015.44974821468
|
||||
SZ300751,0.3,4,-1258508.165734733
|
||||
SZ300088,0.3,1,-111603.75099279743
|
||||
SH603589,0.3,1,-571209.5993851457
|
||||
SZ000630,0.3,1,53263.52449500815
|
||||
SZ000988,0.3,1,271383.56164383556
|
||||
SZ002268,0.3,3,-182450.77041014552
|
||||
SZ002353,0.3,2,-359420.5714566336
|
||||
SH601689,0.3,1,-1267314.6749274961
|
||||
SH601168,0.3,2,524732.8536506619
|
||||
SZ300763,0.3,6,-1826818.1331785503
|
||||
SH600141,0.3,1,-401897.9913151059
|
||||
SH600392,0.3,2,-212692.3833084136
|
||||
SZ000932,0.3,1,13084.2682362079
|
||||
SZ300699,0.3,1,-624779.0538711724
|
||||
SH600233,0.3,1,-128919.90234786177
|
||||
SH600516,0.3,1,-11806.650311141068
|
||||
SZ300058,0.3,4,1687945.2054794522
|
||||
SH603456,0.3,1,-100279.26348554276
|
||||
SZ002138,0.3,1,-423561.8280298068
|
||||
SH600862,0.3,1,-49604.07733259935
|
||||
SZ300146,0.3,1,197057.5074153619
|
||||
SZ300223,0.3,2,-434970.2580735047
|
||||
SZ300136,0.3,1,-260512.04288398303
|
||||
SH600188,0.3,2,-791270.8444057853
|
||||
SH600418,0.3,4,-291707.3830306759
|
||||
SH600705,0.3,1,283753.4246575342
|
||||
SZ000960,0.3,2,56610.25502695047
|
||||
SZ300308,0.3,1,281739.7260273973
|
||||
SH688065,0.3,1,-131607.7732849428
|
||||
SZ300253,0.3,4,1230984.8746722974
|
||||
SZ002080,0.3,1,-67968.28526942959
|
||||
SZ000998,0.3,1,-155353.94328346726
|
||||
SH688536,0.3,3,-1224963.7279819294
|
||||
SZ002092,0.3,1,132692.47743552108
|
||||
SH600875,0.3,1,-426999.23836363544
|
||||
SZ000547,0.3,1,-137505.14378280676
|
||||
SZ002409,0.3,2,426518.658818017
|
||||
SH600521,0.3,2,-392087.5621215715
|
||||
SZ000807,0.3,2,597657.5340668058
|
||||
SH600988,0.3,2,-348446.375789569
|
||||
SZ000039,0.3,1,-32380.930268555046
|
||||
SZ300296,0.3,1,-34205.89456205892
|
||||
SZ002439,0.3,1,273493.1506849315
|
||||
SZ002212,0.3,1,-360806.8703581906
|
||||
SZ300418,0.3,2,564246.5753424659
|
||||
SZ002078,0.3,2,47659.029954266145
|
||||
SZ002223,0.3,2,-480776.9775343193
|
||||
SH603893,0.3,2,-303422.2377894429
|
||||
SZ002030,0.3,1,-636236.0045284857
|
||||
SH600699,0.3,1,-24170.05322164726
|
||||
SH600160,0.3,1,-266234.42815695767
|
||||
SZ002444,0.3,1,-537604.0222512218
|
||||
SH601198,0.3,1,81171.81332714178
|
||||
SZ300724,0.3,1,-677780.009921089
|
||||
SH600637,0.3,1,119002.52842217442
|
||||
SZ300474,0.3,5,1581727.1498812947
|
||||
SZ002465,0.3,1,-52937.71384977277
|
||||
SH688208,0.3,6,-1162579.3949928957
|
||||
SH603605,0.3,1,-85250.13662380211
|
||||
SZ300383,0.3,1,-501552.11704701756
|
||||
SZ002507,0.3,2,139258.2442578951
|
||||
SZ002557,0.3,1,-189788.26158249407
|
||||
SH600549,0.3,1,-424205.94930489524
|
||||
SZ000739,0.3,1,-509463.5833356554
|
||||
SH600529,0.3,2,-328485.8275631084
|
||||
SH600704,0.3,1,30733.62267733604
|
||||
SH603290,0.3,1,-313747.8383818299
|
||||
SZ002508,0.3,1,-450018.4305258162
|
||||
SZ002739,0.3,1,239429.66496981378
|
||||
SZ000636,0.3,1,-223440.62372133648
|
||||
SH603198,0.3,3,488997.1605846802
|
||||
SZ002156,0.3,4,386402.52437747584
|
||||
SZ000830,0.3,2,174550.42308653172
|
||||
SH600201,0.3,2,174332.8796709964
|
||||
SH600153,0.3,2,-504979.5218879453
|
||||
SZ000983,0.3,2,-734281.6879017295
|
||||
SH600642,0.3,1,237993.07556781723
|
||||
SZ002299,0.3,1,-298496.8585956324
|
||||
SZ000629,0.3,1,-453969.69837083487
|
||||
SZ002131,0.3,2,571471.7725249964
|
||||
SZ000738,0.3,2,-366119.0996708082
|
||||
SH603127,0.3,2,-956553.9952791857
|
||||
SZ000623,0.3,1,84973.97960374317
|
||||
SH600859,0.3,3,-197740.14264353516
|
||||
SZ000519,0.3,1,-416957.88092634187
|
||||
SH688521,0.3,2,846753.4246575346
|
||||
SZ002273,0.3,1,-200717.58507996763
|
||||
SH603444,0.3,1,281068.49315068504
|
||||
SH600166,0.3,2,271915.7787924911
|
||||
SZ002422,0.3,1,269273.9726027398
|
||||
SH600732,0.3,1,-74246.66904835813
|
||||
SZ002373,0.3,2,401679.39592456573
|
||||
SH600803,0.3,2,325799.81995115837
|
||||
SZ000050,0.3,1,-271008.0285098457
|
||||
SZ000887,0.3,1,-229827.11445533464
|
||||
SZ300357,0.3,2,-45993.66252081178
|
||||
SH601699,0.3,2,553027.397260274
|
||||
SH600118,0.3,1,-22487.197798630576
|
||||
SZ300070,0.3,1,105982.91172927697
|
||||
SZ002372,0.3,1,-186578.70969457328
|
||||
SZ000400,0.3,1,8309.581773159014
|
||||
SH600271,0.3,1,-32443.20193830951
|
||||
SH600258,0.3,2,-530386.3423364589
|
||||
SZ300017,0.3,1,284136.98630137
|
||||
SZ002153,0.3,5,1309707.156341554
|
||||
SZ002152,0.3,1,-7064.421846866502
|
||||
SZ002195,0.3,2,561178.0821917809
|
||||
SZ300168,0.3,2,553892.0367591758
|
||||
SZ002572,0.3,2,130839.14558033887
|
||||
SH600315,0.3,1,-44.37628252561626
|
||||
SZ002065,0.3,1,-47862.65023413376
|
||||
SH600066,0.3,1,280205.4794520548
|
||||
SZ000975,0.3,1,179807.33324704343
|
||||
SH600027,0.3,3,647294.472036212
|
||||
SZ000997,0.3,1,121256.95978789235
|
||||
SH603218,0.3,3,527360.7468737639
|
||||
SZ002203,0.3,1,-35065.16884423813
|
||||
SZ002985,0.3,1,-52346.75372453739
|
||||
SH600372,0.3,2,-467381.62920061353
|
||||
SZ000513,0.3,2,-125652.67299245916
|
||||
SZ300182,0.3,2,842494.9510946149
|
||||
SZ002506,0.3,1,-36489.72602739728
|
||||
SH603156,0.3,1,16759.01531841083
|
||||
SZ002408,0.3,1,-162080.61778275188
|
||||
SZ002056,0.3,1,-214483.52882205462
|
||||
SH600236,0.3,1,-72654.4489695175
|
||||
SZ300001,0.3,2,539543.0708336311
|
||||
SZ300244,0.3,1,-96758.57419513245
|
||||
SZ002250,0.3,1,-319715.7034371034
|
||||
SZ002019,0.3,1,85143.583447531
|
||||
SZ300024,0.3,1,284041.0958904109
|
||||
SH601872,0.3,2,-297112.0184755601
|
||||
SH600998,0.3,1,162354.9682453791
|
||||
SZ300630,0.3,1,-1007365.4423248414
|
||||
SZ002221,0.3,1,29835.108502840547
|
||||
SZ000021,0.3,1,282698.6301369865
|
||||
SH600348,0.3,1,-163126.9860270784
|
||||
SZ300251,0.3,2,1244234.293354636
|
||||
SH600535,0.3,3,644118.8730660104
|
||||
SZ000401,0.3,1,94462.21829429975
|
||||
SZ000878,0.3,1,-42475.16738730365
|
||||
SZ002831,0.3,1,-210586.34659230086
|
||||
SZ300009,0.3,1,-61596.64274500308
|
||||
SH600728,0.3,2,353182.3956353467
|
||||
SZ000686,0.3,1,22844.439284885004
|
||||
SZ002430,0.3,2,640562.6893486246
|
||||
SH600171,0.3,1,-177214.17854564197
|
||||
SZ000537,0.3,1,-154090.92829778875
|
||||
SZ300115,0.3,1,-358638.2423844078
|
||||
SZ002683,0.3,1,-77096.6918709695
|
||||
SZ002745,0.3,1,-18533.19283456267
|
||||
SH600718,0.3,1,-52359.65140299732
|
||||
SH603568,0.3,1,-149165.163554819
|
||||
SZ002127,0.3,1,-160562.04508296528
|
||||
SZ002532,0.3,1,-287110.07818603644
|
||||
SH600390,0.3,1,41204.474048007934
|
||||
SZ300482,0.3,5,-977844.5318751279
|
||||
SZ000970,0.3,1,-152294.8948460112
|
||||
SH603858,0.3,2,10475.96236625698
|
||||
SH600970,0.3,1,276273.9726027398
|
||||
SZ000690,0.3,1,216739.5252398844
|
||||
SH600060,0.3,1,274643.8356164384
|
||||
SH600282,0.3,1,68721.70797037432
|
||||
SZ300463,0.3,2,-543243.3943136034
|
||||
SH600498,0.3,2,216719.3390476003
|
||||
SZ300026,0.3,2,-684826.3565631679
|
||||
SH600380,0.3,2,76291.94930422664
|
||||
SH600673,0.3,1,-719279.0478975195
|
||||
SH603712,0.3,1,-230341.23689260427
|
||||
SH600528,0.3,1,86659.33090464931
|
||||
SZ300212,0.3,5,2232150.684931507
|
||||
SZ300072,0.3,1,-130114.76699220028
|
||||
SZ000930,0.3,1,28652.51016107185
|
||||
SH600325,0.3,1,282123.287671233
|
||||
SH600667,0.3,2,28572.485033621604
|
||||
SZ002382,0.3,1,-130999.57684425372
|
||||
SZ000729,0.3,1,277232.8767123287
|
||||
SH600895,0.3,1,-80461.7952777588
|
||||
SH600511,0.3,2,459476.16670360795
|
||||
SH603885,0.3,3,622671.103031877
|
||||
SH688006,0.3,1,-336845.09424186486
|
||||
SH601456,0.3,1,-82496.13298131563
|
||||
SZ000581,0.3,1,-111322.10502009522
|
||||
SH600500,0.3,1,-95779.76145786009
|
||||
SH601717,0.3,2,91388.1520476846
|
||||
SZ002505,0.3,1,-301590.3755469239
|
||||
SZ300315,0.3,3,840808.2191780824
|
||||
SH600216,0.3,1,-133293.33836612516
|
||||
SZ002396,0.3,1,-633432.4414896511
|
||||
SH603927,0.3,1,271191.7808219178
|
||||
SH603638,0.3,1,-145402.9629438503
|
||||
SH603225,0.3,1,-333730.1995594551
|
||||
SZ002670,0.3,1,-374249.24802401423
|
||||
SH600507,0.3,1,-139833.76527212147
|
||||
SH603866,0.3,1,-177187.2905346045
|
||||
SZ002595,0.3,2,222642.5630169612
|
||||
SZ002004,0.3,2,-98249.19623980546
|
||||
SZ002368,0.3,2,559931.5068493153
|
||||
SZ300376,0.3,1,-86290.84792891405
|
||||
SZ002048,0.3,1,-139349.2905189767
|
||||
SH600446,0.3,3,660776.6936851358
|
||||
SH601778,0.3,1,-212928.6654808382
|
||||
SZ300271,0.3,1,-244730.38432223932
|
||||
SH601577,0.3,1,34506.15152961919
|
||||
SH688188,0.3,1,-39543.25652740188
|
||||
SH600131,0.3,2,354881.27746776666
|
||||
SZ002010,0.3,1,-49868.78800909125
|
||||
SZ002925,0.3,1,-280996.755190962
|
||||
SH600663,0.3,1,-111377.21064052435
|
||||
SZ300166,0.3,2,154632.77767881547
|
||||
SZ002124,0.3,1,-45383.56164383554
|
||||
SH600546,0.3,2,114099.8145857684
|
||||
SH600764,0.3,1,42256.72142901252
|
||||
SZ002690,0.3,2,42580.55192962263
|
||||
SZ002174,0.3,5,1687082.191780822
|
||||
SH600597,0.3,1,128936.09814842683
|
||||
SH600908,0.3,1,111991.45676830162
|
||||
SH603883,0.3,1,-373612.00157317956
|
||||
SH603228,0.3,1,-182012.17991804672
|
||||
SZ002155,0.3,1,276082.19178082206
|
||||
SH600566,0.3,1,290129.54516193585
|
||||
SZ002281,0.3,3,867357.8110957359
|
||||
SH600158,0.3,1,-156914.9466925897
|
||||
SH600707,0.3,1,-46697.984320517295
|
||||
SH600572,0.3,1,546602.7397260275
|
||||
SZ002440,0.3,2,-81300.12468645762
|
||||
SZ000961,0.3,1,-336126.3460895936
|
||||
SH688029,0.3,2,-279270.5189466817
|
||||
SZ000990,0.3,1,-49743.61714003223
|
||||
SZ002183,0.3,1,-76247.37698347209
|
||||
SH600435,0.3,1,24295.930701047648
|
||||
SH601000,0.3,1,271863.01369863027
|
||||
SZ000090,0.3,1,42129.648806177494
|
||||
SH600906,0.3,1,-57340.10804763426
|
||||
SZ002429,0.3,1,-83813.95697613162
|
||||
SH688088,0.3,3,39402.56047414185
|
||||
SH600398,0.3,2,431311.9678755688
|
||||
SH600373,0.3,1,283178.0821917809
|
||||
SH600037,0.3,1,93497.528872809
|
||||
SZ002867,0.3,2,532653.3334240331
|
||||
SH600376,0.3,3,-857128.8313875378
|
||||
SZ001914,0.3,1,-106114.87684669509
|
||||
SZ002085,0.3,1,-139543.91557772027
|
||||
SH600167,0.3,1,-3706.3234162753506
|
||||
SZ002416,0.3,1,-288404.60409325134
|
||||
SZ002244,0.3,1,-2270.8882957858586
|
||||
SH600329,0.3,2,553986.301369863
|
||||
SH600259,0.3,1,-182437.11859343652
|
||||
SH688321,0.3,1,-341926.1377308939
|
||||
SH601718,0.3,1,17651.441024728676
|
||||
SH600026,0.3,1,562136.9863013698
|
||||
SH603000,0.3,2,1134342.465753425
|
||||
SZ002038,0.3,1,26001.152585139454
|
||||
SZ002242,0.3,1,-75026.78134114269
|
||||
SZ300133,0.3,1,280205.4794520549
|
||||
SZ002705,0.3,1,-192650.40977703256
|
||||
SZ000402,0.3,1,-168408.8178462791
|
||||
SZ000158,0.3,1,-50488.68629182845
|
||||
SZ002390,0.3,1,-460004.06356281514
|
||||
SZ002387,0.3,2,169480.0990886066
|
||||
SZ000415,0.3,1,-84200.88522845072
|
||||
SH601991,0.3,2,515274.037163403
|
||||
SH601975,0.3,1,-57825.43812657848
|
||||
SH603650,0.3,4,463416.46338375553
|
||||
SH600959,0.3,1,85480.9527474218
|
||||
SH688289,0.3,1,-234151.4408451484
|
||||
SH600582,0.3,2,157908.24406621233
|
||||
SH600062,0.3,1,-310588.7763167048
|
||||
SZ300257,0.3,1,-100973.5523320915
|
||||
SH600266,0.3,2,30980.247400851862
|
||||
SZ002399,0.3,2,-409059.01035052026
|
||||
SH600056,0.3,3,1150818.1771470269
|
||||
SZ003022,0.3,2,-743945.8168532269
|
||||
SH601928,0.3,3,819712.3287671232
|
||||
SH600729,0.3,2,508297.7415771937
|
||||
SZ002423,0.3,1,412902.81213322
|
||||
SZ002468,0.3,2,-47630.44991014914
|
||||
SH600556,0.3,2,-380569.14117424015
|
||||
SZ003035,0.3,1,-438044.38177176344
|
||||
SH600787,0.3,1,269945.2054794521
|
||||
SZ000028,0.3,2,827575.3424657537
|
||||
SH600095,0.3,2,-4573.837617082871
|
||||
SH600776,0.3,1,-6013.0195750683
|
||||
SZ000031,0.3,1,-77882.60936834523
|
||||
SH600339,0.3,3,830835.6164383563
|
||||
SH600006,0.3,1,-249264.60456111893
|
||||
SH603317,0.3,1,-150409.15504277474
|
||||
SZ000062,0.3,1,-11708.979037746254
|
||||
SH600835,0.3,1,56151.14686845231
|
||||
SZ002815,0.3,1,-252504.07705149206
|
||||
SZ002424,0.3,4,907008.7738136043
|
||||
SH600299,0.3,1,-26473.269412054466
|
||||
SZ002948,0.3,1,-69899.45569697082
|
||||
SZ000156,0.3,1,129003.9245010847
|
||||
SZ002375,0.3,1,-28782.381111482235
|
||||
SH601828,0.3,2,-57847.872901659575
|
||||
SZ300869,0.3,3,-1077072.349230677
|
||||
SZ002302,0.3,1,-14126.419728664943
|
||||
SH601228,0.3,1,100430.26357430262
|
||||
SH601969,0.3,1,-234490.04055335387
|
||||
SH603379,0.3,1,-260187.66938711266
|
||||
SZ002945,0.3,1,-165933.4118780609
|
||||
SZ002653,0.3,2,547465.7534246575
|
||||
SH600823,0.3,2,-632480.1781465504
|
||||
SZ300741,0.3,1,-53309.09346133779
|
||||
SH603056,0.3,2,236637.48189188493
|
||||
SH601869,0.3,1,-535028.9303980002
|
||||
SH603786,0.3,1,-386578.31189975026
|
||||
SZ000553,0.3,1,-113668.25242161949
|
||||
SZ001203,0.3,1,-945682.7211139722
|
||||
SH600657,0.3,1,-637372.4789524117
|
||||
SH603355,0.3,1,-144376.35722650908
|
||||
SH603719,0.3,1,-240478.5410107494
|
||||
SH601003,0.3,1,26329.158787201864
|
||||
SZ002946,0.3,2,395201.16753402585
|
||||
SH603868,0.3,1,-146359.49823391563
|
||||
SZ002901,0.3,2,-528921.5500645036
|
||||
SH600903,0.3,1,-44908.59216886615
|
|
|
@ -0,0 +1,62 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SH600157,no_valid_signals,0.23999999999999994
|
||||
SH601077,no_valid_signals,0.23999999999999994
|
||||
SZ002013,empty_data,0.23999999999999994
|
||||
SZ002673,no_valid_signals,0.23999999999999994
|
||||
SH601128,no_valid_signals,0.23999999999999994
|
||||
SH600177,no_valid_signals,0.23999999999999994
|
||||
SH600739,no_valid_signals,0.23999999999999994
|
||||
SH688208,no_valid_signals,0.23999999999999994
|
||||
SH688002,no_valid_signals,0.23999999999999994
|
||||
SH601997,no_valid_signals,0.23999999999999994
|
||||
SZ000636,no_valid_signals,0.23999999999999994
|
||||
SZ002936,no_valid_signals,0.23999999999999994
|
||||
SH600867,no_valid_signals,0.23999999999999994
|
||||
SH600008,no_valid_signals,0.23999999999999994
|
||||
SZ000999,no_valid_signals,0.23999999999999994
|
||||
SZ002002,empty_data,0.23999999999999994
|
||||
SZ002500,no_valid_signals,0.23999999999999994
|
||||
SZ000401,no_valid_signals,0.23999999999999994
|
||||
SZ002511,no_valid_signals,0.23999999999999994
|
||||
SH601992,no_valid_signals,0.23999999999999994
|
||||
SZ002966,no_valid_signals,0.23999999999999994
|
||||
SZ300463,no_valid_signals,0.23999999999999994
|
||||
SZ002382,no_valid_signals,0.23999999999999994
|
||||
SZ000540,empty_data,0.23999999999999994
|
||||
SZ002958,no_valid_signals,0.23999999999999994
|
||||
SH600567,no_valid_signals,0.23999999999999994
|
||||
SH603638,no_valid_signals,0.23999999999999994
|
||||
SZ002075,no_valid_signals,0.23999999999999994
|
||||
SH601880,no_valid_signals,0.23999999999999994
|
||||
SH600598,no_valid_signals,0.23999999999999994
|
||||
SH600022,no_valid_signals,0.23999999999999994
|
||||
SH600546,no_valid_signals,0.23999999999999994
|
||||
SH600597,no_valid_signals,0.23999999999999994
|
||||
SZ000898,no_valid_signals,0.23999999999999994
|
||||
SH601118,no_valid_signals,0.23999999999999994
|
||||
SZ000488,no_valid_signals,0.23999999999999994
|
||||
SH688029,no_valid_signals,0.23999999999999994
|
||||
SH600064,no_valid_signals,0.23999999999999994
|
||||
SH601333,no_valid_signals,0.23999999999999994
|
||||
SZ000089,no_valid_signals,0.23999999999999994
|
||||
SZ002244,no_valid_signals,0.23999999999999994
|
||||
SZ000685,no_valid_signals,0.23999999999999994
|
||||
SZ000671,empty_data,0.23999999999999994
|
||||
SH601098,no_valid_signals,0.23999999999999994
|
||||
SH601975,no_valid_signals,0.23999999999999994
|
||||
SZ000718,no_valid_signals,0.23999999999999994
|
||||
SH600062,no_valid_signals,0.23999999999999994
|
||||
SH600901,no_valid_signals,0.23999999999999994
|
||||
SH600717,no_valid_signals,0.23999999999999994
|
||||
SZ002468,no_valid_signals,0.23999999999999994
|
||||
SZ000717,no_valid_signals,0.23999999999999994
|
||||
SZ000869,no_valid_signals,0.23999999999999994
|
||||
SH601828,no_valid_signals,0.23999999999999994
|
||||
SH601969,no_valid_signals,0.23999999999999994
|
||||
SZ000046,empty_data,0.23999999999999994
|
||||
SH601156,insufficient_history_217days,0.23999999999999994
|
||||
SZ001203,insufficient_history_239days,0.23999999999999994
|
||||
SH601568,no_valid_signals,0.23999999999999994
|
||||
SH600466,empty_data,0.23999999999999994
|
||||
SH601665,insufficient_history_211days,0.23999999999999994
|
||||
SH603868,no_valid_signals,0.23999999999999994
|
|
|
@ -0,0 +1,62 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SH600157,no_valid_signals,0.24999999999999994
|
||||
SH601077,no_valid_signals,0.24999999999999994
|
||||
SZ002013,empty_data,0.24999999999999994
|
||||
SZ002673,no_valid_signals,0.24999999999999994
|
||||
SH601128,no_valid_signals,0.24999999999999994
|
||||
SH600177,no_valid_signals,0.24999999999999994
|
||||
SH600739,no_valid_signals,0.24999999999999994
|
||||
SH688208,no_valid_signals,0.24999999999999994
|
||||
SH688002,no_valid_signals,0.24999999999999994
|
||||
SH601997,no_valid_signals,0.24999999999999994
|
||||
SZ000636,no_valid_signals,0.24999999999999994
|
||||
SZ002936,no_valid_signals,0.24999999999999994
|
||||
SH600867,no_valid_signals,0.24999999999999994
|
||||
SH600008,no_valid_signals,0.24999999999999994
|
||||
SZ000999,no_valid_signals,0.24999999999999994
|
||||
SZ002002,empty_data,0.24999999999999994
|
||||
SZ002500,no_valid_signals,0.24999999999999994
|
||||
SZ000401,no_valid_signals,0.24999999999999994
|
||||
SZ002511,no_valid_signals,0.24999999999999994
|
||||
SH601992,no_valid_signals,0.24999999999999994
|
||||
SZ002966,no_valid_signals,0.24999999999999994
|
||||
SZ300463,no_valid_signals,0.24999999999999994
|
||||
SZ002382,no_valid_signals,0.24999999999999994
|
||||
SZ000540,empty_data,0.24999999999999994
|
||||
SZ002958,no_valid_signals,0.24999999999999994
|
||||
SH600567,no_valid_signals,0.24999999999999994
|
||||
SH603638,no_valid_signals,0.24999999999999994
|
||||
SZ002075,no_valid_signals,0.24999999999999994
|
||||
SH601880,no_valid_signals,0.24999999999999994
|
||||
SH600598,no_valid_signals,0.24999999999999994
|
||||
SH600022,no_valid_signals,0.24999999999999994
|
||||
SH600546,no_valid_signals,0.24999999999999994
|
||||
SH600597,no_valid_signals,0.24999999999999994
|
||||
SZ000898,no_valid_signals,0.24999999999999994
|
||||
SH601118,no_valid_signals,0.24999999999999994
|
||||
SZ000488,no_valid_signals,0.24999999999999994
|
||||
SH688029,no_valid_signals,0.24999999999999994
|
||||
SH600064,no_valid_signals,0.24999999999999994
|
||||
SH601333,no_valid_signals,0.24999999999999994
|
||||
SZ000089,no_valid_signals,0.24999999999999994
|
||||
SZ002244,no_valid_signals,0.24999999999999994
|
||||
SZ000685,no_valid_signals,0.24999999999999994
|
||||
SZ000671,empty_data,0.24999999999999994
|
||||
SH601098,no_valid_signals,0.24999999999999994
|
||||
SH601975,no_valid_signals,0.24999999999999994
|
||||
SZ000718,no_valid_signals,0.24999999999999994
|
||||
SH600062,no_valid_signals,0.24999999999999994
|
||||
SH600901,no_valid_signals,0.24999999999999994
|
||||
SH600717,no_valid_signals,0.24999999999999994
|
||||
SZ002468,no_valid_signals,0.24999999999999994
|
||||
SZ000717,no_valid_signals,0.24999999999999994
|
||||
SZ000869,no_valid_signals,0.24999999999999994
|
||||
SH601828,no_valid_signals,0.24999999999999994
|
||||
SH601969,no_valid_signals,0.24999999999999994
|
||||
SZ000046,empty_data,0.24999999999999994
|
||||
SH601156,insufficient_history_217days,0.24999999999999994
|
||||
SZ001203,insufficient_history_239days,0.24999999999999994
|
||||
SH601568,no_valid_signals,0.24999999999999994
|
||||
SH600466,empty_data,0.24999999999999994
|
||||
SH601665,insufficient_history_211days,0.24999999999999994
|
||||
SH603868,no_valid_signals,0.24999999999999994
|
|
|
@ -0,0 +1,62 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SH600157,no_valid_signals,0.25999999999999995
|
||||
SH601077,no_valid_signals,0.25999999999999995
|
||||
SZ002013,empty_data,0.25999999999999995
|
||||
SZ002673,no_valid_signals,0.25999999999999995
|
||||
SH601128,no_valid_signals,0.25999999999999995
|
||||
SH600177,no_valid_signals,0.25999999999999995
|
||||
SH600739,no_valid_signals,0.25999999999999995
|
||||
SH688208,no_valid_signals,0.25999999999999995
|
||||
SH688002,no_valid_signals,0.25999999999999995
|
||||
SH601997,no_valid_signals,0.25999999999999995
|
||||
SZ000636,no_valid_signals,0.25999999999999995
|
||||
SZ002936,no_valid_signals,0.25999999999999995
|
||||
SH600867,no_valid_signals,0.25999999999999995
|
||||
SH600008,no_valid_signals,0.25999999999999995
|
||||
SZ000999,no_valid_signals,0.25999999999999995
|
||||
SZ002002,empty_data,0.25999999999999995
|
||||
SZ002500,no_valid_signals,0.25999999999999995
|
||||
SZ000401,no_valid_signals,0.25999999999999995
|
||||
SZ002511,no_valid_signals,0.25999999999999995
|
||||
SH601992,no_valid_signals,0.25999999999999995
|
||||
SZ002966,no_valid_signals,0.25999999999999995
|
||||
SZ300463,no_valid_signals,0.25999999999999995
|
||||
SZ002382,no_valid_signals,0.25999999999999995
|
||||
SZ000540,empty_data,0.25999999999999995
|
||||
SZ002958,no_valid_signals,0.25999999999999995
|
||||
SH600567,no_valid_signals,0.25999999999999995
|
||||
SH603638,no_valid_signals,0.25999999999999995
|
||||
SZ002075,no_valid_signals,0.25999999999999995
|
||||
SH601880,no_valid_signals,0.25999999999999995
|
||||
SH600598,no_valid_signals,0.25999999999999995
|
||||
SH600022,no_valid_signals,0.25999999999999995
|
||||
SH600546,no_valid_signals,0.25999999999999995
|
||||
SH600597,no_valid_signals,0.25999999999999995
|
||||
SZ000898,no_valid_signals,0.25999999999999995
|
||||
SH601118,no_valid_signals,0.25999999999999995
|
||||
SZ000488,no_valid_signals,0.25999999999999995
|
||||
SH688029,no_valid_signals,0.25999999999999995
|
||||
SH600064,no_valid_signals,0.25999999999999995
|
||||
SH601333,no_valid_signals,0.25999999999999995
|
||||
SZ000089,no_valid_signals,0.25999999999999995
|
||||
SZ002244,no_valid_signals,0.25999999999999995
|
||||
SZ000685,no_valid_signals,0.25999999999999995
|
||||
SZ000671,empty_data,0.25999999999999995
|
||||
SH601098,no_valid_signals,0.25999999999999995
|
||||
SH601975,no_valid_signals,0.25999999999999995
|
||||
SZ000718,no_valid_signals,0.25999999999999995
|
||||
SH600062,no_valid_signals,0.25999999999999995
|
||||
SH600901,no_valid_signals,0.25999999999999995
|
||||
SH600717,no_valid_signals,0.25999999999999995
|
||||
SZ002468,no_valid_signals,0.25999999999999995
|
||||
SZ000717,no_valid_signals,0.25999999999999995
|
||||
SZ000869,no_valid_signals,0.25999999999999995
|
||||
SH601828,no_valid_signals,0.25999999999999995
|
||||
SH601969,no_valid_signals,0.25999999999999995
|
||||
SZ000046,empty_data,0.25999999999999995
|
||||
SH601156,insufficient_history_217days,0.25999999999999995
|
||||
SZ001203,insufficient_history_239days,0.25999999999999995
|
||||
SH601568,no_valid_signals,0.25999999999999995
|
||||
SH600466,empty_data,0.25999999999999995
|
||||
SH601665,insufficient_history_211days,0.25999999999999995
|
||||
SH603868,no_valid_signals,0.25999999999999995
|
|
|
@ -0,0 +1,62 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SH600157,no_valid_signals,0.26999999999999996
|
||||
SH601077,no_valid_signals,0.26999999999999996
|
||||
SZ002013,empty_data,0.26999999999999996
|
||||
SZ002673,no_valid_signals,0.26999999999999996
|
||||
SH601128,no_valid_signals,0.26999999999999996
|
||||
SH600177,no_valid_signals,0.26999999999999996
|
||||
SH600739,no_valid_signals,0.26999999999999996
|
||||
SH688208,no_valid_signals,0.26999999999999996
|
||||
SH688002,no_valid_signals,0.26999999999999996
|
||||
SH601997,no_valid_signals,0.26999999999999996
|
||||
SZ000636,no_valid_signals,0.26999999999999996
|
||||
SZ002936,no_valid_signals,0.26999999999999996
|
||||
SH600867,no_valid_signals,0.26999999999999996
|
||||
SH600008,no_valid_signals,0.26999999999999996
|
||||
SZ000999,no_valid_signals,0.26999999999999996
|
||||
SZ002002,empty_data,0.26999999999999996
|
||||
SZ002500,no_valid_signals,0.26999999999999996
|
||||
SZ000401,no_valid_signals,0.26999999999999996
|
||||
SZ002511,no_valid_signals,0.26999999999999996
|
||||
SH601992,no_valid_signals,0.26999999999999996
|
||||
SZ002966,no_valid_signals,0.26999999999999996
|
||||
SZ300463,no_valid_signals,0.26999999999999996
|
||||
SZ002382,no_valid_signals,0.26999999999999996
|
||||
SZ000540,empty_data,0.26999999999999996
|
||||
SZ002958,no_valid_signals,0.26999999999999996
|
||||
SH600567,no_valid_signals,0.26999999999999996
|
||||
SH603638,no_valid_signals,0.26999999999999996
|
||||
SZ002075,no_valid_signals,0.26999999999999996
|
||||
SH601880,no_valid_signals,0.26999999999999996
|
||||
SH600598,no_valid_signals,0.26999999999999996
|
||||
SH600022,no_valid_signals,0.26999999999999996
|
||||
SH600546,no_valid_signals,0.26999999999999996
|
||||
SH600597,no_valid_signals,0.26999999999999996
|
||||
SZ000898,no_valid_signals,0.26999999999999996
|
||||
SH601118,no_valid_signals,0.26999999999999996
|
||||
SZ000488,no_valid_signals,0.26999999999999996
|
||||
SH688029,no_valid_signals,0.26999999999999996
|
||||
SH600064,no_valid_signals,0.26999999999999996
|
||||
SH601333,no_valid_signals,0.26999999999999996
|
||||
SZ000089,no_valid_signals,0.26999999999999996
|
||||
SZ002244,no_valid_signals,0.26999999999999996
|
||||
SZ000685,no_valid_signals,0.26999999999999996
|
||||
SZ000671,empty_data,0.26999999999999996
|
||||
SH601098,no_valid_signals,0.26999999999999996
|
||||
SH601975,no_valid_signals,0.26999999999999996
|
||||
SZ000718,no_valid_signals,0.26999999999999996
|
||||
SH600062,no_valid_signals,0.26999999999999996
|
||||
SH600901,no_valid_signals,0.26999999999999996
|
||||
SH600717,no_valid_signals,0.26999999999999996
|
||||
SZ002468,no_valid_signals,0.26999999999999996
|
||||
SZ000717,no_valid_signals,0.26999999999999996
|
||||
SZ000869,no_valid_signals,0.26999999999999996
|
||||
SH601828,no_valid_signals,0.26999999999999996
|
||||
SH601969,no_valid_signals,0.26999999999999996
|
||||
SZ000046,empty_data,0.26999999999999996
|
||||
SH601156,insufficient_history_217days,0.26999999999999996
|
||||
SZ001203,insufficient_history_239days,0.26999999999999996
|
||||
SH601568,no_valid_signals,0.26999999999999996
|
||||
SH600466,empty_data,0.26999999999999996
|
||||
SH601665,insufficient_history_211days,0.26999999999999996
|
||||
SH603868,no_valid_signals,0.26999999999999996
|
|
|
@ -0,0 +1,162 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SZ002340,no_valid_signals,0.27999999999999997
|
||||
SH600157,no_valid_signals,0.27999999999999997
|
||||
SZ000723,no_valid_signals,0.27999999999999997
|
||||
SZ000009,no_valid_signals,0.27999999999999997
|
||||
SH601555,no_valid_signals,0.27999999999999997
|
||||
SH600884,no_valid_signals,0.27999999999999997
|
||||
SH600298,no_valid_signals,0.27999999999999997
|
||||
SZ002028,no_valid_signals,0.27999999999999997
|
||||
SZ300363,no_valid_signals,0.27999999999999997
|
||||
SH601077,no_valid_signals,0.27999999999999997
|
||||
SZ002013,empty_data,0.27999999999999997
|
||||
SH603267,no_valid_signals,0.27999999999999997
|
||||
SZ000728,no_valid_signals,0.27999999999999997
|
||||
SH600486,no_valid_signals,0.27999999999999997
|
||||
SZ002797,no_valid_signals,0.27999999999999997
|
||||
SH603077,no_valid_signals,0.27999999999999997
|
||||
SZ002673,no_valid_signals,0.27999999999999997
|
||||
SH601128,no_valid_signals,0.27999999999999997
|
||||
SH600482,no_valid_signals,0.27999999999999997
|
||||
SH600733,no_valid_signals,0.27999999999999997
|
||||
SH600177,no_valid_signals,0.27999999999999997
|
||||
SH600739,no_valid_signals,0.27999999999999997
|
||||
SZ002191,no_valid_signals,0.27999999999999997
|
||||
SZ002603,no_valid_signals,0.27999999999999997
|
||||
SH688002,no_valid_signals,0.27999999999999997
|
||||
SH600497,no_valid_signals,0.27999999999999997
|
||||
SH601997,no_valid_signals,0.27999999999999997
|
||||
SH600038,no_valid_signals,0.27999999999999997
|
||||
SH600369,no_valid_signals,0.27999999999999997
|
||||
SZ002936,no_valid_signals,0.27999999999999997
|
||||
SH601016,no_valid_signals,0.27999999999999997
|
||||
SZ000825,no_valid_signals,0.27999999999999997
|
||||
SH600879,no_valid_signals,0.27999999999999997
|
||||
SH600039,no_valid_signals,0.27999999999999997
|
||||
SZ300618,no_valid_signals,0.27999999999999997
|
||||
SZ000750,no_valid_signals,0.27999999999999997
|
||||
SH600170,no_valid_signals,0.27999999999999997
|
||||
SH600867,no_valid_signals,0.27999999999999997
|
||||
SZ000656,no_valid_signals,0.27999999999999997
|
||||
SZ002926,no_valid_signals,0.27999999999999997
|
||||
SH600909,no_valid_signals,0.27999999999999997
|
||||
SH600008,no_valid_signals,0.27999999999999997
|
||||
SH600580,no_valid_signals,0.27999999999999997
|
||||
SZ000999,no_valid_signals,0.27999999999999997
|
||||
SH600536,no_valid_signals,0.27999999999999997
|
||||
SH601005,no_valid_signals,0.27999999999999997
|
||||
SH600316,no_valid_signals,0.27999999999999997
|
||||
SH603707,no_valid_signals,0.27999999999999997
|
||||
SZ000027,no_valid_signals,0.27999999999999997
|
||||
SZ002002,empty_data,0.27999999999999997
|
||||
SZ002266,no_valid_signals,0.27999999999999997
|
||||
SZ002500,no_valid_signals,0.27999999999999997
|
||||
SH600801,no_valid_signals,0.27999999999999997
|
||||
SH600208,no_valid_signals,0.27999999999999997
|
||||
SZ002249,no_valid_signals,0.27999999999999997
|
||||
SH600415,no_valid_signals,0.27999999999999997
|
||||
SZ000012,no_valid_signals,0.27999999999999997
|
||||
SH601866,no_valid_signals,0.27999999999999997
|
||||
SZ002511,no_valid_signals,0.27999999999999997
|
||||
SZ000060,no_valid_signals,0.27999999999999997
|
||||
SH601992,no_valid_signals,0.27999999999999997
|
||||
SH600839,no_valid_signals,0.27999999999999997
|
||||
SZ002966,no_valid_signals,0.27999999999999997
|
||||
SH600155,no_valid_signals,0.27999999999999997
|
||||
SZ002128,no_valid_signals,0.27999999999999997
|
||||
SH600517,no_valid_signals,0.27999999999999997
|
||||
SH600985,no_valid_signals,0.27999999999999997
|
||||
SZ000778,no_valid_signals,0.27999999999999997
|
||||
SH600782,no_valid_signals,0.27999999999999997
|
||||
SZ002939,no_valid_signals,0.27999999999999997
|
||||
SZ002294,no_valid_signals,0.27999999999999997
|
||||
SZ000540,empty_data,0.27999999999999997
|
||||
SH600863,no_valid_signals,0.27999999999999997
|
||||
SZ002958,no_valid_signals,0.27999999999999997
|
||||
SH601179,no_valid_signals,0.27999999999999997
|
||||
SH600755,no_valid_signals,0.27999999999999997
|
||||
SZ000598,no_valid_signals,0.27999999999999997
|
||||
SH600297,no_valid_signals,0.27999999999999997
|
||||
SZ002701,no_valid_signals,0.27999999999999997
|
||||
SH600820,no_valid_signals,0.27999999999999997
|
||||
SH600567,no_valid_signals,0.27999999999999997
|
||||
SZ000709,no_valid_signals,0.27999999999999997
|
||||
SZ002595,empty_data,0.27999999999999997
|
||||
SZ002075,no_valid_signals,0.27999999999999997
|
||||
SZ002146,no_valid_signals,0.27999999999999997
|
||||
SH600409,no_valid_signals,0.27999999999999997
|
||||
SH600021,no_valid_signals,0.27999999999999997
|
||||
SH600827,no_valid_signals,0.27999999999999997
|
||||
SH601880,no_valid_signals,0.27999999999999997
|
||||
SH600598,no_valid_signals,0.27999999999999997
|
||||
SH600808,no_valid_signals,0.27999999999999997
|
||||
SH600022,no_valid_signals,0.27999999999999997
|
||||
SZ000987,no_valid_signals,0.27999999999999997
|
||||
SH600737,no_valid_signals,0.27999999999999997
|
||||
SZ000883,no_valid_signals,0.27999999999999997
|
||||
SH600811,no_valid_signals,0.27999999999999997
|
||||
SH601106,no_valid_signals,0.27999999999999997
|
||||
SZ002233,no_valid_signals,0.27999999999999997
|
||||
SZ002110,no_valid_signals,0.27999999999999997
|
||||
SH600967,no_valid_signals,0.27999999999999997
|
||||
SZ000898,no_valid_signals,0.27999999999999997
|
||||
SH601118,no_valid_signals,0.27999999999999997
|
||||
SZ000488,no_valid_signals,0.27999999999999997
|
||||
SZ000877,no_valid_signals,0.27999999999999997
|
||||
SH600064,no_valid_signals,0.27999999999999997
|
||||
SH601333,no_valid_signals,0.27999999999999997
|
||||
SH601200,no_valid_signals,0.27999999999999997
|
||||
SZ002081,no_valid_signals,0.27999999999999997
|
||||
SZ000089,no_valid_signals,0.27999999999999997
|
||||
SZ000559,no_valid_signals,0.27999999999999997
|
||||
SZ000959,no_valid_signals,0.27999999999999997
|
||||
SZ000528,no_valid_signals,0.27999999999999997
|
||||
SH600195,no_valid_signals,0.27999999999999997
|
||||
SZ002434,no_valid_signals,0.27999999999999997
|
||||
SZ000685,no_valid_signals,0.27999999999999997
|
||||
SZ000671,empty_data,0.27999999999999997
|
||||
SH600120,no_valid_signals,0.27999999999999997
|
||||
SZ001965,no_valid_signals,0.27999999999999997
|
||||
SH601608,no_valid_signals,0.27999999999999997
|
||||
SH600126,no_valid_signals,0.27999999999999997
|
||||
SH601611,no_valid_signals,0.27999999999999997
|
||||
SZ000758,no_valid_signals,0.27999999999999997
|
||||
SH601098,no_valid_signals,0.27999999999999997
|
||||
SH600307,no_valid_signals,0.27999999999999997
|
||||
SH601598,no_valid_signals,0.27999999999999997
|
||||
SH600643,no_valid_signals,0.27999999999999997
|
||||
SZ000563,no_valid_signals,0.27999999999999997
|
||||
SZ000718,no_valid_signals,0.27999999999999997
|
||||
SH601958,no_valid_signals,0.27999999999999997
|
||||
SH600901,no_valid_signals,0.27999999999999997
|
||||
SH600717,no_valid_signals,0.27999999999999997
|
||||
SZ000967,no_valid_signals,0.27999999999999997
|
||||
SZ002458,no_valid_signals,0.27999999999999997
|
||||
SH601860,no_valid_signals,0.27999999999999997
|
||||
SZ002563,no_valid_signals,0.27999999999999997
|
||||
SH600928,no_valid_signals,0.27999999999999997
|
||||
SH600968,no_valid_signals,0.27999999999999997
|
||||
SZ000937,no_valid_signals,0.27999999999999997
|
||||
SZ000717,no_valid_signals,0.27999999999999997
|
||||
SH600649,no_valid_signals,0.27999999999999997
|
||||
SH600648,no_valid_signals,0.27999999999999997
|
||||
SH600623,no_valid_signals,0.27999999999999997
|
||||
SH600377,no_valid_signals,0.27999999999999997
|
||||
SH601139,no_valid_signals,0.27999999999999997
|
||||
SZ000869,no_valid_signals,0.27999999999999997
|
||||
SH600871,no_valid_signals,0.27999999999999997
|
||||
SH600639,no_valid_signals,0.27999999999999997
|
||||
SH601298,no_valid_signals,0.27999999999999997
|
||||
SZ000046,empty_data,0.27999999999999997
|
||||
SZ001872,no_valid_signals,0.27999999999999997
|
||||
SH601156,no_valid_signals,0.27999999999999997
|
||||
SH603708,no_valid_signals,0.27999999999999997
|
||||
SH600350,no_valid_signals,0.27999999999999997
|
||||
SH601568,no_valid_signals,0.27999999999999997
|
||||
SH600466,empty_data,0.27999999999999997
|
||||
SH603515,no_valid_signals,0.27999999999999997
|
||||
SH601665,no_valid_signals,0.27999999999999997
|
||||
SH600917,no_valid_signals,0.27999999999999997
|
||||
SH600956,no_valid_signals,0.27999999999999997
|
||||
SH601187,no_valid_signals,0.27999999999999997
|
||||
SH603983,no_valid_signals,0.27999999999999997
|
|
|
@ -0,0 +1,161 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SZ002340,no_valid_signals,0.29
|
||||
SH600157,no_valid_signals,0.29
|
||||
SZ000723,no_valid_signals,0.29
|
||||
SZ000009,no_valid_signals,0.29
|
||||
SH601555,no_valid_signals,0.29
|
||||
SH600884,no_valid_signals,0.29
|
||||
SH600298,no_valid_signals,0.29
|
||||
SZ002028,no_valid_signals,0.29
|
||||
SZ300363,no_valid_signals,0.29
|
||||
SH601077,no_valid_signals,0.29
|
||||
SZ002013,empty_data,0.29
|
||||
SH603267,no_valid_signals,0.29
|
||||
SZ000728,no_valid_signals,0.29
|
||||
SH600486,no_valid_signals,0.29
|
||||
SZ002797,no_valid_signals,0.29
|
||||
SH603077,no_valid_signals,0.29
|
||||
SZ002673,no_valid_signals,0.29
|
||||
SH601128,no_valid_signals,0.29
|
||||
SH600482,no_valid_signals,0.29
|
||||
SH600733,no_valid_signals,0.29
|
||||
SH600177,no_valid_signals,0.29
|
||||
SH600739,no_valid_signals,0.29
|
||||
SZ002191,no_valid_signals,0.29
|
||||
SZ002603,no_valid_signals,0.29
|
||||
SH688002,no_valid_signals,0.29
|
||||
SH600497,no_valid_signals,0.29
|
||||
SH601997,no_valid_signals,0.29
|
||||
SH600038,no_valid_signals,0.29
|
||||
SH600369,no_valid_signals,0.29
|
||||
SZ002936,no_valid_signals,0.29
|
||||
SH601016,no_valid_signals,0.29
|
||||
SZ000825,no_valid_signals,0.29
|
||||
SH600879,no_valid_signals,0.29
|
||||
SH600039,no_valid_signals,0.29
|
||||
SZ300618,no_valid_signals,0.29
|
||||
SZ000750,no_valid_signals,0.29
|
||||
SH600170,no_valid_signals,0.29
|
||||
SH600867,no_valid_signals,0.29
|
||||
SZ000656,no_valid_signals,0.29
|
||||
SZ002926,no_valid_signals,0.29
|
||||
SH600909,no_valid_signals,0.29
|
||||
SH600008,no_valid_signals,0.29
|
||||
SH600580,no_valid_signals,0.29
|
||||
SZ000999,no_valid_signals,0.29
|
||||
SH600536,no_valid_signals,0.29
|
||||
SH601005,no_valid_signals,0.29
|
||||
SH600316,no_valid_signals,0.29
|
||||
SH603707,no_valid_signals,0.29
|
||||
SZ000027,no_valid_signals,0.29
|
||||
SZ002002,empty_data,0.29
|
||||
SZ002266,no_valid_signals,0.29
|
||||
SZ002500,no_valid_signals,0.29
|
||||
SH600801,no_valid_signals,0.29
|
||||
SH600208,no_valid_signals,0.29
|
||||
SZ002249,no_valid_signals,0.29
|
||||
SH600415,no_valid_signals,0.29
|
||||
SZ000012,no_valid_signals,0.29
|
||||
SH601866,no_valid_signals,0.29
|
||||
SZ002511,no_valid_signals,0.29
|
||||
SZ000060,no_valid_signals,0.29
|
||||
SH601992,no_valid_signals,0.29
|
||||
SH600839,no_valid_signals,0.29
|
||||
SZ002966,no_valid_signals,0.29
|
||||
SH600155,no_valid_signals,0.29
|
||||
SZ002128,no_valid_signals,0.29
|
||||
SH600517,no_valid_signals,0.29
|
||||
SH600985,no_valid_signals,0.29
|
||||
SZ000778,no_valid_signals,0.29
|
||||
SH600782,no_valid_signals,0.29
|
||||
SZ002939,no_valid_signals,0.29
|
||||
SZ002294,no_valid_signals,0.29
|
||||
SZ000540,empty_data,0.29
|
||||
SH600863,no_valid_signals,0.29
|
||||
SZ002958,no_valid_signals,0.29
|
||||
SH601179,no_valid_signals,0.29
|
||||
SH600755,no_valid_signals,0.29
|
||||
SZ000598,no_valid_signals,0.29
|
||||
SH600297,no_valid_signals,0.29
|
||||
SZ002701,no_valid_signals,0.29
|
||||
SH600820,no_valid_signals,0.29
|
||||
SH600567,no_valid_signals,0.29
|
||||
SZ000709,no_valid_signals,0.29
|
||||
SZ002075,no_valid_signals,0.29
|
||||
SZ002146,no_valid_signals,0.29
|
||||
SH600409,no_valid_signals,0.29
|
||||
SH600021,no_valid_signals,0.29
|
||||
SH600827,no_valid_signals,0.29
|
||||
SH601880,no_valid_signals,0.29
|
||||
SH600598,no_valid_signals,0.29
|
||||
SH600808,no_valid_signals,0.29
|
||||
SH600022,no_valid_signals,0.29
|
||||
SZ000987,no_valid_signals,0.29
|
||||
SH600737,no_valid_signals,0.29
|
||||
SZ000883,no_valid_signals,0.29
|
||||
SH600811,no_valid_signals,0.29
|
||||
SH601106,no_valid_signals,0.29
|
||||
SZ002233,no_valid_signals,0.29
|
||||
SZ002110,no_valid_signals,0.29
|
||||
SH600967,no_valid_signals,0.29
|
||||
SZ000898,no_valid_signals,0.29
|
||||
SH601118,no_valid_signals,0.29
|
||||
SZ000488,no_valid_signals,0.29
|
||||
SZ000877,no_valid_signals,0.29
|
||||
SH600064,no_valid_signals,0.29
|
||||
SH601333,no_valid_signals,0.29
|
||||
SH601200,no_valid_signals,0.29
|
||||
SZ002081,no_valid_signals,0.29
|
||||
SZ000089,no_valid_signals,0.29
|
||||
SZ000559,no_valid_signals,0.29
|
||||
SZ000959,no_valid_signals,0.29
|
||||
SZ000528,no_valid_signals,0.29
|
||||
SH600195,no_valid_signals,0.29
|
||||
SZ002434,no_valid_signals,0.29
|
||||
SZ000685,no_valid_signals,0.29
|
||||
SZ000671,empty_data,0.29
|
||||
SH600120,no_valid_signals,0.29
|
||||
SZ001965,no_valid_signals,0.29
|
||||
SH601608,no_valid_signals,0.29
|
||||
SH600126,no_valid_signals,0.29
|
||||
SH601611,no_valid_signals,0.29
|
||||
SZ000758,no_valid_signals,0.29
|
||||
SH601098,no_valid_signals,0.29
|
||||
SH600307,no_valid_signals,0.29
|
||||
SH601598,no_valid_signals,0.29
|
||||
SH600643,no_valid_signals,0.29
|
||||
SZ000563,no_valid_signals,0.29
|
||||
SZ000718,no_valid_signals,0.29
|
||||
SH601958,no_valid_signals,0.29
|
||||
SH600901,no_valid_signals,0.29
|
||||
SH600717,no_valid_signals,0.29
|
||||
SZ000967,no_valid_signals,0.29
|
||||
SZ002458,no_valid_signals,0.29
|
||||
SH601860,no_valid_signals,0.29
|
||||
SZ002563,no_valid_signals,0.29
|
||||
SH600928,no_valid_signals,0.29
|
||||
SH600968,no_valid_signals,0.29
|
||||
SZ000937,no_valid_signals,0.29
|
||||
SZ000717,no_valid_signals,0.29
|
||||
SH600649,no_valid_signals,0.29
|
||||
SH600648,no_valid_signals,0.29
|
||||
SH600623,no_valid_signals,0.29
|
||||
SH600377,no_valid_signals,0.29
|
||||
SH601139,no_valid_signals,0.29
|
||||
SZ000869,no_valid_signals,0.29
|
||||
SH600871,no_valid_signals,0.29
|
||||
SH600639,no_valid_signals,0.29
|
||||
SH601298,no_valid_signals,0.29
|
||||
SZ000046,empty_data,0.29
|
||||
SZ001872,no_valid_signals,0.29
|
||||
SH601156,no_valid_signals,0.29
|
||||
SH603708,no_valid_signals,0.29
|
||||
SH600350,no_valid_signals,0.29
|
||||
SH601568,no_valid_signals,0.29
|
||||
SH600466,empty_data,0.29
|
||||
SH603515,no_valid_signals,0.29
|
||||
SH601665,no_valid_signals,0.29
|
||||
SH600917,no_valid_signals,0.29
|
||||
SH600956,no_valid_signals,0.29
|
||||
SH601187,no_valid_signals,0.29
|
||||
SH603983,no_valid_signals,0.29
|
|
|
@ -0,0 +1,161 @@
|
|||
symbol,reason,take_profit_pct
|
||||
SZ002340,no_valid_signals,0.3
|
||||
SH600157,no_valid_signals,0.3
|
||||
SZ000723,no_valid_signals,0.3
|
||||
SZ000009,no_valid_signals,0.3
|
||||
SH601555,no_valid_signals,0.3
|
||||
SH600884,no_valid_signals,0.3
|
||||
SH600298,no_valid_signals,0.3
|
||||
SZ002028,no_valid_signals,0.3
|
||||
SZ300363,no_valid_signals,0.3
|
||||
SH601077,no_valid_signals,0.3
|
||||
SZ002013,empty_data,0.3
|
||||
SH603267,no_valid_signals,0.3
|
||||
SZ000728,no_valid_signals,0.3
|
||||
SH600486,no_valid_signals,0.3
|
||||
SZ002797,no_valid_signals,0.3
|
||||
SH603077,no_valid_signals,0.3
|
||||
SZ002673,no_valid_signals,0.3
|
||||
SH601128,no_valid_signals,0.3
|
||||
SH600482,no_valid_signals,0.3
|
||||
SH600733,no_valid_signals,0.3
|
||||
SH600177,no_valid_signals,0.3
|
||||
SH600739,no_valid_signals,0.3
|
||||
SZ002191,no_valid_signals,0.3
|
||||
SZ002603,no_valid_signals,0.3
|
||||
SH688002,no_valid_signals,0.3
|
||||
SH600497,no_valid_signals,0.3
|
||||
SH601997,no_valid_signals,0.3
|
||||
SH600038,no_valid_signals,0.3
|
||||
SH600369,no_valid_signals,0.3
|
||||
SZ002936,no_valid_signals,0.3
|
||||
SH601016,no_valid_signals,0.3
|
||||
SZ000825,no_valid_signals,0.3
|
||||
SH600879,no_valid_signals,0.3
|
||||
SH600039,no_valid_signals,0.3
|
||||
SZ300618,no_valid_signals,0.3
|
||||
SZ000750,no_valid_signals,0.3
|
||||
SH600170,no_valid_signals,0.3
|
||||
SH600867,no_valid_signals,0.3
|
||||
SZ000656,no_valid_signals,0.3
|
||||
SZ002926,no_valid_signals,0.3
|
||||
SH600909,no_valid_signals,0.3
|
||||
SH600008,no_valid_signals,0.3
|
||||
SH600580,no_valid_signals,0.3
|
||||
SZ000999,no_valid_signals,0.3
|
||||
SH600536,no_valid_signals,0.3
|
||||
SH601005,no_valid_signals,0.3
|
||||
SH600316,no_valid_signals,0.3
|
||||
SH603707,no_valid_signals,0.3
|
||||
SZ000027,no_valid_signals,0.3
|
||||
SZ002002,empty_data,0.3
|
||||
SZ002266,no_valid_signals,0.3
|
||||
SZ002500,no_valid_signals,0.3
|
||||
SH600801,no_valid_signals,0.3
|
||||
SH600208,no_valid_signals,0.3
|
||||
SZ002249,no_valid_signals,0.3
|
||||
SH600415,no_valid_signals,0.3
|
||||
SZ000012,no_valid_signals,0.3
|
||||
SH601866,no_valid_signals,0.3
|
||||
SZ002511,no_valid_signals,0.3
|
||||
SZ000060,no_valid_signals,0.3
|
||||
SH601992,no_valid_signals,0.3
|
||||
SH600839,no_valid_signals,0.3
|
||||
SZ002966,no_valid_signals,0.3
|
||||
SH600155,no_valid_signals,0.3
|
||||
SZ002128,no_valid_signals,0.3
|
||||
SH600517,no_valid_signals,0.3
|
||||
SH600985,no_valid_signals,0.3
|
||||
SZ000778,no_valid_signals,0.3
|
||||
SH600782,no_valid_signals,0.3
|
||||
SZ002939,no_valid_signals,0.3
|
||||
SZ002294,no_valid_signals,0.3
|
||||
SZ000540,empty_data,0.3
|
||||
SH600863,no_valid_signals,0.3
|
||||
SZ002958,no_valid_signals,0.3
|
||||
SH601179,no_valid_signals,0.3
|
||||
SH600755,no_valid_signals,0.3
|
||||
SZ000598,no_valid_signals,0.3
|
||||
SH600297,no_valid_signals,0.3
|
||||
SZ002701,no_valid_signals,0.3
|
||||
SH600820,no_valid_signals,0.3
|
||||
SH600567,no_valid_signals,0.3
|
||||
SZ000709,no_valid_signals,0.3
|
||||
SZ002075,no_valid_signals,0.3
|
||||
SZ002146,no_valid_signals,0.3
|
||||
SH600409,no_valid_signals,0.3
|
||||
SH600021,no_valid_signals,0.3
|
||||
SH600827,no_valid_signals,0.3
|
||||
SH601880,no_valid_signals,0.3
|
||||
SH600598,no_valid_signals,0.3
|
||||
SH600808,no_valid_signals,0.3
|
||||
SH600022,no_valid_signals,0.3
|
||||
SZ000987,no_valid_signals,0.3
|
||||
SH600737,no_valid_signals,0.3
|
||||
SZ000883,no_valid_signals,0.3
|
||||
SH600811,no_valid_signals,0.3
|
||||
SH601106,no_valid_signals,0.3
|
||||
SZ002233,no_valid_signals,0.3
|
||||
SZ002110,no_valid_signals,0.3
|
||||
SH600967,no_valid_signals,0.3
|
||||
SZ000898,no_valid_signals,0.3
|
||||
SH601118,no_valid_signals,0.3
|
||||
SZ000488,no_valid_signals,0.3
|
||||
SZ000877,no_valid_signals,0.3
|
||||
SH600064,no_valid_signals,0.3
|
||||
SH601333,no_valid_signals,0.3
|
||||
SH601200,no_valid_signals,0.3
|
||||
SZ002081,no_valid_signals,0.3
|
||||
SZ000089,no_valid_signals,0.3
|
||||
SZ000559,no_valid_signals,0.3
|
||||
SZ000959,no_valid_signals,0.3
|
||||
SZ000528,no_valid_signals,0.3
|
||||
SH600195,no_valid_signals,0.3
|
||||
SZ002434,no_valid_signals,0.3
|
||||
SZ000685,no_valid_signals,0.3
|
||||
SZ000671,empty_data,0.3
|
||||
SH600120,no_valid_signals,0.3
|
||||
SZ001965,no_valid_signals,0.3
|
||||
SH601608,no_valid_signals,0.3
|
||||
SH600126,no_valid_signals,0.3
|
||||
SH601611,no_valid_signals,0.3
|
||||
SZ000758,no_valid_signals,0.3
|
||||
SH601098,no_valid_signals,0.3
|
||||
SH600307,no_valid_signals,0.3
|
||||
SH601598,no_valid_signals,0.3
|
||||
SH600643,no_valid_signals,0.3
|
||||
SZ000563,no_valid_signals,0.3
|
||||
SZ000718,no_valid_signals,0.3
|
||||
SH601958,no_valid_signals,0.3
|
||||
SH600901,no_valid_signals,0.3
|
||||
SH600717,no_valid_signals,0.3
|
||||
SZ000967,no_valid_signals,0.3
|
||||
SZ002458,no_valid_signals,0.3
|
||||
SH601860,no_valid_signals,0.3
|
||||
SZ002563,no_valid_signals,0.3
|
||||
SH600928,no_valid_signals,0.3
|
||||
SH600968,no_valid_signals,0.3
|
||||
SZ000937,no_valid_signals,0.3
|
||||
SZ000717,no_valid_signals,0.3
|
||||
SH600649,no_valid_signals,0.3
|
||||
SH600648,no_valid_signals,0.3
|
||||
SH600623,no_valid_signals,0.3
|
||||
SH600377,no_valid_signals,0.3
|
||||
SH601139,no_valid_signals,0.3
|
||||
SZ000869,no_valid_signals,0.3
|
||||
SH600871,no_valid_signals,0.3
|
||||
SH600639,no_valid_signals,0.3
|
||||
SH601298,no_valid_signals,0.3
|
||||
SZ000046,empty_data,0.3
|
||||
SZ001872,no_valid_signals,0.3
|
||||
SH601156,no_valid_signals,0.3
|
||||
SH603708,no_valid_signals,0.3
|
||||
SH600350,no_valid_signals,0.3
|
||||
SH601568,no_valid_signals,0.3
|
||||
SH600466,empty_data,0.3
|
||||
SH603515,no_valid_signals,0.3
|
||||
SH601665,no_valid_signals,0.3
|
||||
SH600917,no_valid_signals,0.3
|
||||
SH600956,no_valid_signals,0.3
|
||||
SH601187,no_valid_signals,0.3
|
||||
SH603983,no_valid_signals,0.3
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
23.999999999999993,-51449903.2556674,-20176.432649281334,0,116.57411764705883,40.94117647058824,39.863325740318906,2550,439
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
24.999999999999993,-51842058.294730715,-20394.200745370068,0,118.2285601888277,40.440597954366645,39.40774487471526,2542,439
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
25.999999999999996,-52586377.81024381,-20851.06178042974,0,119.98215701823949,39.809674861221254,39.17995444191344,2522,439
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
26.999999999999996,-54650589.844712615,-21825.31543319194,0,121.754392971246,39.05750798722045,38.496583143507976,2504,439
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
27.999999999999996,-13478086.243568404,-13711.176239642324,0,78.75483214649033,37.945066124109864,39.823008849557525,983,339
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
28.999999999999996,-12628925.952513697,-12860.413393598468,0,79.27698574338086,37.67820773930753,40.294117647058826,982,340
|
|
|
@ -0,0 +1,2 @@
|
|||
take_profit_pct,total_profit,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count
|
||||
30.0,-14121418.834878381,-14453.857558729153,0,80.489252814739,36.8474923234391,39.705882352941174,977,340
|
|
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
API服务启动脚本
|
||||
用于启动Flask API服务,确保所有必要的模块能被正确导入
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import importlib.util
|
||||
|
||||
# 设置日志
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 获取项目根目录的绝对路径
|
||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
PROJECT_ROOT = os.path.dirname(ROOT_DIR)
|
||||
|
||||
# 添加项目根目录到 Python 路径
|
||||
sys.path.append(PROJECT_ROOT)
|
||||
sys.path.append(ROOT_DIR)
|
||||
|
||||
# 确保所有必要的包存在
|
||||
def ensure_package(package_name):
|
||||
"""确保包可以被导入"""
|
||||
logger.info(f"检查包 {package_name} 是否存在...")
|
||||
|
||||
# 检查包目录是否存在
|
||||
package_path = os.path.join(ROOT_DIR, package_name)
|
||||
if not os.path.isdir(package_path):
|
||||
logger.error(f"包目录 {package_path} 不存在!")
|
||||
return False
|
||||
|
||||
# 确保__init__.py文件存在
|
||||
init_file = os.path.join(package_path, "__init__.py")
|
||||
if not os.path.exists(init_file):
|
||||
logger.warning(f"创建缺失的 {init_file} 文件")
|
||||
with open(init_file, "w") as f:
|
||||
f.write('"""' + package_name + ' package"""')
|
||||
|
||||
return True
|
||||
|
||||
# 检查关键模块
|
||||
def check_modules():
|
||||
"""检查关键模块是否可以导入"""
|
||||
modules_to_check = [
|
||||
'fundamentals_llm.chat_bot',
|
||||
'fundamentals_llm.chat_bot_with_offline',
|
||||
'fundamentals_llm.fundamental_analysis',
|
||||
'fundamentals_llm.enterprise_screener'
|
||||
]
|
||||
|
||||
all_ok = True
|
||||
for module_name in modules_to_check:
|
||||
try:
|
||||
module = importlib.import_module(module_name)
|
||||
logger.info(f"成功导入模块 {module_name}")
|
||||
except ImportError as e:
|
||||
logger.error(f"导入模块 {module_name} 失败: {str(e)}")
|
||||
# 尝试从src导入
|
||||
try:
|
||||
module = importlib.import_module(f'src.{module_name}')
|
||||
logger.info(f"成功从src导入模块 {module_name}")
|
||||
except ImportError as e2:
|
||||
logger.error(f"导入模块 src.{module_name} 失败: {str(e2)}")
|
||||
all_ok = False
|
||||
|
||||
return all_ok
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
logger.info("启动API服务...")
|
||||
|
||||
# 确保必要的包存在
|
||||
if not ensure_package('fundamentals_llm'):
|
||||
logger.error("缺少必要的包,无法启动API服务")
|
||||
return False
|
||||
|
||||
if not ensure_package('scripts'):
|
||||
logger.warning("scripts包不存在或不完整,API服务可能无法正常工作")
|
||||
|
||||
# 检查关键模块
|
||||
if not check_modules():
|
||||
logger.warning("部分模块导入失败,API服务可能无法正常工作")
|
||||
|
||||
try:
|
||||
# 尝试导入app
|
||||
from app import app
|
||||
|
||||
# 启动Flask应用
|
||||
app.run(host='0.0.0.0', port=5000, debug=True)
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"启动API服务失败: {str(e)}")
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(0 if main() else 1)
|
|
@ -0,0 +1,7 @@
|
|||
"""
|
||||
Scripts package initialization
|
||||
用于存放各种脚本和工具的包
|
||||
"""
|
||||
|
||||
# 版本号
|
||||
__version__ = '1.0.0'
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,118 @@
|
|||
# coding:utf-8
|
||||
|
||||
"""
|
||||
通用配置文件,存储共享的配置项
|
||||
"""
|
||||
|
||||
import random
|
||||
|
||||
XUEQIU_HEADERS = {
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
||||
'Client-Version': 'v2.44.75',
|
||||
'Cookie': 'bid=d298883c846926e46f61128493d71969_ltocon4a; device_id=99947aa416bde5e7418bd51327850c56; HMACCOUNT=2D95237D28EF1309; s=be11f4j7l4; cookiesu=651724318004914; Hm_lvt_1db88642e346389874251b5a1eded6e3=1739155871; xq_a_token=2b33ad6ac971d226d2d8e9e2487621e834ad3550; xqat=2b33ad6ac971d226d2d8e9e2487621e834ad3550; xq_r_token=f17217fe00776426e761885c67f799dac6d960f4; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOjg0OTM0MTE2MzQsImlzcyI6InVjIiwiZXhwIjoxNzQzNjQ1MjY2LCJjdG0iOjE3NDEwNTMyNjY3MjYsImNpZCI6ImQ5ZDBuNEFadXAifQ.UCe60fXpKIKGEHjA8fwHQ4m0WBCdpCllnuQrLQ_EbpSf9joPboNq4xanvs15SFl8EzEvWRFqgyaDb-TLUkb-YuSXb2vnDVQKeHW1CmQMwihpAS8bz9FKnspw3PeQZLJTfgwUFl7uTKRkjNu3x1lk1OJ3SmyjlGDAEEQgsvZlK-OZLcXvoTdOlM3B9ppERN0vicURiZkxVT68B_j4wEmegOWdsaEhTEXeBfhzMu1ObmztdcTolhBPB59vDFpMmVJz7YjWkkrESgq0Kjx6xpx_afwtMY2NDciuslSA3ji5zDG2objiX8tGzLFFqHdslZRg0ulK-MJeUvH6hpCbSQ7cEw; xq_is_login=1; u=8493411634; is_overseas=0; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1741144661; ssxmod_itna=YqIxnD0DyGehDkDhx+xmqAKQAQDOD2GSAD0x0dGM9/DILq7=GFKDCEKLumb2G+R0DeYrAG2mq1DBLAoDSxD67DK4GTI+OGe41i7G2vppqW7h+tK3FKoZUPo20do4gdOeIbed5=xB3DExGkeQ0re4iiWx0rD0eDPxDYDG4aD7PDoxDrF8YDjl7pOUgwoUxDKx0kDY5Dw62wDYPDWxDFNIGFNUAeDD5Dn1SUw4DWDWpmYDDzYjQ4wcY4DmRw7SHfkj8XeGENN4G1jD0H7Dt4NUkBwwGv7f6NivW+vz3DvxDkU8oGLbwmGfEhiueq0DoOGI7dqBe77oeAeFYxeD4KiGe04YDqK7iYODWGD7GeqOxk2QwlGIi7IDqSOdkowe3znMzN3sMuev7DdCDpEGox4mB=5rxq7Y70vmrGvE5VYYiAAMYpF04bWA7GiYiDD; ssxmod_itna2=YqIxnD0DyGehDkDhx+xmqAKQAQDOD2GSAD0x0dGM9/DILq7=GFKDCEKLumb2G+R0DeYrAG2mqTDGRW0wqQD7P4mGKeDsYGtidoeFEjpbF4WjtDqn+ao7pCSAt8ko=xEKjfG+96eKGNSNbhha7W5a2xKenxPKzaRC2BqW4hv+rf5eyoKauABacPT1TOpp+FIm2A7ssEHQA1Gai3fwGtMHG/fHC4vHiRvHctgGuDSCN7aAA=wWzgf4i=Fu3YduYqK8S1Cm=lFc20GFzq2FrS=xN5=RZWpyKlj6hKaSkvIWvFXNjoghz=iFf1j4mIygYfeADbPxzQq7QTOPyEPacND=IRWU2i4m=GgQN4Dozhjux=X1Irf6xAvHO2xAA1iRqp6I1DKxR77GSDhygvO7QwcQVEPwO25Wpj6RgD2574e7+IRnv8+xAqzBqGYeQDh1jn64aeYD',
|
||||
'Referer': 'https://weibo.com/u/7735765253',
|
||||
'Sec-Ch-Ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
|
||||
'Sec-Ch-Ua-Mobile': '?0',
|
||||
'Sec-Ch-Ua-Platform': '"Windows"',
|
||||
'Sec-Fetch-Dest': 'empty',
|
||||
'Sec-Fetch-Mode': 'cors',
|
||||
'Sec-Fetch-Site': 'same-origin',
|
||||
'Server-Version': 'v2024.03.19.2',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'X-Xsrf-Token': 'spbnXpnWWKiHZFvOqW4rIejO'
|
||||
}
|
||||
|
||||
# 火山引擎API密钥列表
|
||||
VOLC_API_KEYS = [
|
||||
"28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93", # 测试密钥1
|
||||
"28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93", # 可添加更多密钥
|
||||
]
|
||||
|
||||
# 获取随机API密钥
|
||||
def get_random_api_key():
|
||||
return random.choice(VOLC_API_KEYS)
|
||||
|
||||
# 火山引擎模型配置
|
||||
VOLC_MODELS = {
|
||||
# 在线智能体模型
|
||||
"online_bot": "bot-20250325102825-h9kpq", # 联网智能体ID
|
||||
|
||||
# 离线模型
|
||||
"offline_model": "ep-20250326090920-v7wns", # 免费推理50W
|
||||
|
||||
"deepseek-private": "mlx-community/DeepSeek-R1-4bit",
|
||||
|
||||
# 其他可用模型
|
||||
"doubao": "doubao-1-5-pro-32k-250115", # 豆包模型
|
||||
"deepseek": "deepseek-r1-250120", # Deepseek模型
|
||||
}
|
||||
|
||||
# 获取指定类型的模型
|
||||
def get_model(model_type):
|
||||
return VOLC_MODELS.get(model_type, VOLC_MODELS["offline_model"])
|
||||
|
||||
# 模型配置字典
|
||||
MODEL_CONFIGS = {
|
||||
# 火山引擎配置
|
||||
"volc": {
|
||||
"base_url": "https://ark.cn-beijing.volces.com/api/v3/",
|
||||
"api_key": "28cfe71a-c6fa-4c5d-9b4e-d8474f0d3b93",
|
||||
"models": {
|
||||
"offline_model": "ep-20250326090920-v7wns",
|
||||
"online_bot": "bot-20250325102825-h9kpq",
|
||||
"doubao": "doubao-1-5-pro-32k-250115"
|
||||
}
|
||||
},
|
||||
# 天链苹果
|
||||
"tl_private": {
|
||||
"base_url": "http://192.168.32.118:1234/v1/",
|
||||
"api_key": "none",
|
||||
"models": {
|
||||
"ds-v1": "mlx-community/DeepSeek-R1-4bit"
|
||||
}
|
||||
},
|
||||
# 天链-千问
|
||||
"tl_qw_private": {
|
||||
"base_url": "http://192.168.16.178:11434/v1",
|
||||
"api_key": "sk-WaVRJKkyhrFlH4ZV35B9Aa61759b400c9cA002D00f3f1019",
|
||||
"models": {
|
||||
"qwq": "qwq:32b"
|
||||
}
|
||||
},
|
||||
# Deepseek配置
|
||||
"deepseek": {
|
||||
"base_url": "https://api.deepseek.com/v1/",
|
||||
"api_key": "your_deepseek_api_key",
|
||||
"models": {
|
||||
"deepseek": "deepseek-r1-250120",
|
||||
"deepseek-private": "mlx-community/DeepSeek-R1-4bit"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 获取指定平台和模型的配置
|
||||
def get_model_config(platform: str, model_type: str) -> dict:
|
||||
"""获取指定平台和模型的配置
|
||||
|
||||
Args:
|
||||
platform: 平台名称(volc/doubao/deepseek)
|
||||
model_type: 模型类型
|
||||
|
||||
Returns:
|
||||
dict: 包含base_url、api_key和model的配置字典
|
||||
"""
|
||||
if platform not in MODEL_CONFIGS:
|
||||
raise ValueError(f"不支持的平台: {platform}")
|
||||
|
||||
platform_config = MODEL_CONFIGS[platform]
|
||||
if model_type not in platform_config["models"]:
|
||||
raise ValueError(f"平台 {platform} 不支持模型类型: {model_type}")
|
||||
|
||||
return {
|
||||
"base_url": platform_config["base_url"],
|
||||
"api_key": platform_config["api_key"],
|
||||
"model": platform_config["models"][model_type]
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def ensure_convertible_bonds_table_exists(engine):
|
||||
"""确保可转债表存在"""
|
||||
try:
|
||||
create_table_query = text("""
|
||||
CREATE TABLE IF NOT EXISTS convertible_bonds (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
symbol VARCHAR(20),
|
||||
name VARCHAR(100),
|
||||
current FLOAT,
|
||||
percent FLOAT,
|
||||
chg FLOAT,
|
||||
underlying_symbol VARCHAR(20),
|
||||
underlying_name VARCHAR(100),
|
||||
underlying_current FLOAT,
|
||||
underlying_percent FLOAT,
|
||||
underlying_pb FLOAT,
|
||||
underlying_navps FLOAT,
|
||||
conversion_price FLOAT,
|
||||
conversion_value FLOAT,
|
||||
premium_rate FLOAT,
|
||||
convert_bond_ratio FLOAT,
|
||||
remain_year FLOAT,
|
||||
total_issue_scale FLOAT,
|
||||
benefit_before_tax FLOAT,
|
||||
benefit_after_tax FLOAT,
|
||||
putback_price FLOAT,
|
||||
maturity_time BIGINT,
|
||||
interest_memo TEXT,
|
||||
add_time DATETIME
|
||||
)
|
||||
""")
|
||||
with engine.connect() as conn:
|
||||
conn.execute(create_table_query)
|
||||
conn.commit()
|
||||
except Exception as e:
|
||||
print("创建可转债表时发生错误: {}".format(str(e)))
|
||||
|
||||
def fetch_convertible_bonds(db_url):
|
||||
"""获取可转债数据并保存到数据库"""
|
||||
base_url = 'https://stock.xueqiu.com/v5/stock/screener/quote/list.json'
|
||||
headers = XUEQIU_HEADERS
|
||||
all_data = []
|
||||
page = 1
|
||||
|
||||
try:
|
||||
while True:
|
||||
params = {
|
||||
'page': page,
|
||||
'size': 90,
|
||||
'order': 'desc',
|
||||
'order_by': 'underlying_percent',
|
||||
'market': 'CN',
|
||||
'type': 'convert'
|
||||
}
|
||||
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
|
||||
if response.status_code != 200:
|
||||
print(f"响应内容: {response.text}")
|
||||
break
|
||||
|
||||
data = response.json()
|
||||
if data.get('error_code') != 0:
|
||||
break
|
||||
|
||||
bonds = data['data']['list']
|
||||
if not bonds: # 如果没有更多数据了
|
||||
print("没有更多数据了")
|
||||
break
|
||||
|
||||
all_data.extend(bonds)
|
||||
total_count = data['data'].get('count', 0)
|
||||
|
||||
# 如果已经获取了所有数据,就退出循环
|
||||
if len(all_data) >= total_count:
|
||||
break
|
||||
page += 1
|
||||
|
||||
if all_data:
|
||||
# 转换为DataFrame
|
||||
df = pd.DataFrame(all_data)
|
||||
|
||||
# 选择需要的列
|
||||
selected_columns = [
|
||||
'symbol', 'name', 'current', 'percent', 'chg',
|
||||
'underlying_symbol', 'underlying_name', 'underlying_current',
|
||||
'underlying_percent', 'underlying_pb', 'underlying_navps',
|
||||
'conversion_price', 'conversion_value', 'premium_rate',
|
||||
'convert_bond_ratio', 'remain_year', 'total_issue_scale',
|
||||
'benefit_before_tax', 'benefit_after_tax', 'putback_price',
|
||||
'maturity_time', 'interest_memo'
|
||||
]
|
||||
|
||||
df = df[selected_columns]
|
||||
|
||||
# 添加时间戳
|
||||
df['add_time'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 确保表存在
|
||||
ensure_convertible_bonds_table_exists(engine)
|
||||
|
||||
# 将数据写入数据库(使用replace模式)
|
||||
df.to_sql('convertible_bonds', con=engine, if_exists='replace', index=False)
|
||||
|
||||
else:
|
||||
print("未获取到可转债数据")
|
||||
|
||||
except Exception as e:
|
||||
print("获取可转债数据时发生错误:")
|
||||
print(f"错误类型: {type(e).__name__}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
fetch_convertible_bonds(db_url)
|
|
@ -0,0 +1,45 @@
|
|||
# coding:utf-8
|
||||
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
def import_concept_sectors(file_path, db_url, table_name):
|
||||
"""
|
||||
从CSV文件导入概念板块数据到数据库。
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
file_path : str
|
||||
CSV文件的路径
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
table_name : str, optional
|
||||
要导入的数据库表名,默认为'gp_gnbk'
|
||||
|
||||
Returns:
|
||||
--------
|
||||
bool
|
||||
导入成功返回True,失败返回False
|
||||
"""
|
||||
try:
|
||||
# 读取 CSV 文件
|
||||
df = pd.read_csv(file_path, dtype={'gp_code': str}, encoding='gbk')
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 将数据写入数据库表
|
||||
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
|
||||
|
||||
print(f"数据已成功导入数据库表 '{table_name}'")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"导入数据时发生错误: {str(e)}")
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
file_path = "C:/Users/xy/Desktop/temp/概念板块.csv"
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
import_concept_sectors(file_path, db_url, "gp_gnbk")
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 测试用
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80031
|
||||
Source Host : 192.168.1.82:3306
|
||||
Source Schema : db_gp_cj
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80031
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 05/03/2025 13:40:26
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gp_code_all
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gp_code_all`;
|
||||
CREATE TABLE `gp_code_all` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`gp_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`gp_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`gp_code_two` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`gp_code_three` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
|
||||
`market_cap` decimal(20, 2) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 6475 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for gp_day_data
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `gp_day_data`;
|
||||
CREATE TABLE `gp_day_data` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`symbol` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '个股代码',
|
||||
`timestamp` timestamp(0) NULL DEFAULT NULL COMMENT '时间戳',
|
||||
`volume` bigint NULL DEFAULT NULL COMMENT '数量',
|
||||
`open` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '开始价',
|
||||
`high` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最高价',
|
||||
`low` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '最低价',
|
||||
`close` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '结束价',
|
||||
`chg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '变化数值',
|
||||
`percent` decimal(10, 2) NULL DEFAULT NULL COMMENT '变化百分比',
|
||||
`turnoverrate` decimal(10, 2) NULL DEFAULT NULL COMMENT '换手率',
|
||||
`amount` bigint NULL DEFAULT NULL COMMENT '成交金额',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_symbol`(`symbol`) USING BTREE,
|
||||
INDEX `idx_timestamp`(`timestamp`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 58520387 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
@ -0,0 +1,113 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def ensure_hk_stocks_table_exists(engine):
|
||||
"""确保港股热门股票表存在"""
|
||||
try:
|
||||
create_table_query = text("""
|
||||
CREATE TABLE IF NOT EXISTS hk_hot_stocks (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
symbol VARCHAR(10),
|
||||
name VARCHAR(100),
|
||||
value INT,
|
||||
increment INT,
|
||||
rank_change INT,
|
||||
percent FLOAT,
|
||||
current FLOAT,
|
||||
chg FLOAT,
|
||||
exchange VARCHAR(10),
|
||||
stock_type INT,
|
||||
add_time DATETIME
|
||||
)
|
||||
""")
|
||||
with engine.connect() as conn:
|
||||
conn.execute(create_table_query)
|
||||
conn.commit()
|
||||
print("港股热门股票表检查/创建完成")
|
||||
except Exception as e:
|
||||
print("创建港股热门股票表时发生错误: {}".format(str(e)))
|
||||
|
||||
def fetch_hk_hot_stocks(db_url):
|
||||
"""获取港股热门股票数据并保存到数据库"""
|
||||
url = 'https://stock.xueqiu.com/v5/stock/hot_stock/list.json'
|
||||
params = {
|
||||
'page': 1,
|
||||
'size': 20,
|
||||
'_type': 13,
|
||||
'type': 13
|
||||
}
|
||||
headers = XUEQIU_HEADERS
|
||||
|
||||
try:
|
||||
# 发送请求获取数据
|
||||
response = requests.get(url, headers=headers, params=params)
|
||||
if response.status_code != 200:
|
||||
print(f"请求失败,状态码:{response.status_code}")
|
||||
return
|
||||
|
||||
data = response.json()
|
||||
if data.get('error_code') != 0:
|
||||
print(f"获取数据失败:{data.get('error_description')}")
|
||||
return
|
||||
|
||||
# 提取股票列表数据
|
||||
stocks = data['data']['items']
|
||||
|
||||
# 转换为DataFrame
|
||||
df = pd.DataFrame(stocks)
|
||||
|
||||
# 选择需要的列
|
||||
selected_columns = [
|
||||
'symbol', 'name', 'value', 'increment', 'rank_change',
|
||||
'percent', 'current', 'chg', 'exchange', 'stock_type'
|
||||
]
|
||||
df = df[selected_columns]
|
||||
|
||||
# 添加时间戳
|
||||
df['add_time'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 确保表存在
|
||||
ensure_hk_stocks_table_exists(engine)
|
||||
|
||||
# 将数据写入数据库
|
||||
df.to_sql('hk_hot_stocks', con=engine, if_exists='append', index=False)
|
||||
|
||||
print(f"成功保存{len(df)}条港股热门股票数据")
|
||||
|
||||
# 清理历史数据(只保留当天的数据)
|
||||
clean_historical_data(engine)
|
||||
|
||||
except Exception as e:
|
||||
print("获取港股热门股票数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def clean_historical_data(engine):
|
||||
"""清理当天0点之前的历史数据"""
|
||||
try:
|
||||
today = datetime.now().strftime('%Y-%m-%d 00:00:00')
|
||||
|
||||
clean_query = text("""
|
||||
DELETE FROM hk_hot_stocks
|
||||
WHERE add_time < :today
|
||||
""")
|
||||
|
||||
with engine.connect() as conn:
|
||||
result = conn.execute(clean_query, {'today': today})
|
||||
conn.commit()
|
||||
|
||||
print("清理历史数据完成: 删除了{}条记录".format(result.rowcount))
|
||||
|
||||
except Exception as e:
|
||||
print("清理历史数据时发生错误: {}".format(str(e)))
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
fetch_hk_hot_stocks(db_url)
|
|
@ -0,0 +1,189 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine
|
||||
from datetime import datetime
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def fetch_and_store_stock_data(db_url, table_name='limitup_analysis_stock_changes', page_size=100):
|
||||
"""获取雪球数据并保存到数据库,只获取前3页数据"""
|
||||
base_url = 'https://stock.xueqiu.com/v5/stock/screener/quote/list.json'
|
||||
params = {
|
||||
'page': 1,
|
||||
'size': page_size,
|
||||
'order': 'desc',
|
||||
'order_by': 'percent',
|
||||
'market': 'CN',
|
||||
'type': 'sh_sz'
|
||||
}
|
||||
|
||||
all_data = []
|
||||
# 只获取前3页数据
|
||||
for page in range(1, 4):
|
||||
params['page'] = page
|
||||
try:
|
||||
response = requests.get(base_url, headers=XUEQIU_HEADERS, params=params)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
all_data.extend(data['data']['list'])
|
||||
else:
|
||||
print("请求第 {} 页失败,状态码:{}".format(page, response.status_code))
|
||||
except Exception as e:
|
||||
print("请求第 {} 页时发生错误: {}".format(page, str(e)))
|
||||
|
||||
if all_data:
|
||||
df = pd.DataFrame(all_data)
|
||||
df['id'] = range(1, len(df) + 1)
|
||||
engine = create_engine(db_url)
|
||||
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
|
||||
return True
|
||||
return False
|
||||
|
||||
def analyze_limitup_stocks(db_url, sort_category):
|
||||
"""分析涨停股票的封单情况和概念重叠度"""
|
||||
engine = create_engine(db_url)
|
||||
|
||||
try:
|
||||
# 读取数据
|
||||
stock_changes_df = pd.read_sql_table('limitup_analysis_stock_changes', con=engine)
|
||||
gp_gnbk_df = pd.read_sql_table('gp_gnbk', con=engine)
|
||||
|
||||
# 筛选涨停股票
|
||||
limitup_stocks = stock_changes_df[stock_changes_df['limitup_days'] > 0]
|
||||
|
||||
results = []
|
||||
for _, row in limitup_stocks.iterrows():
|
||||
symbol = row['symbol']
|
||||
market_capital = row['float_market_capital']
|
||||
|
||||
# 获取封单数据
|
||||
pankou_url = 'https://stock.xueqiu.com/v5/stock/realtime/pankou.json?symbol={}'.format(symbol)
|
||||
response = requests.get(pankou_url, headers=XUEQIU_HEADERS)
|
||||
if response.status_code == 200:
|
||||
data = response.json().get('data', {})
|
||||
bp1 = data.get('bp1', 0)
|
||||
bc1 = data.get('bc1', 0)
|
||||
|
||||
if bp1 > 0 and bc1 > 0:
|
||||
sealing_amount = bp1 * bc1
|
||||
sealing_ratio = sealing_amount / market_capital
|
||||
results.append((symbol, row['name'], sealing_amount, sealing_ratio))
|
||||
else:
|
||||
print("请求 {} 封单数据失败,状态码:{}".format(symbol, response.status_code))
|
||||
|
||||
# 按指定方式排序并取前五
|
||||
results.sort(key=lambda x: x[2] if sort_category == 'sealed_amount' else x[3], reverse=True)
|
||||
top_stocks = results[:5]
|
||||
|
||||
final_results = []
|
||||
for index, (symbol, name, sealing_amount, sealing_ratio) in enumerate(top_stocks):
|
||||
# 获取相关概念
|
||||
symbol_trimmed = symbol[2:]
|
||||
concepts = gp_gnbk_df[gp_gnbk_df['gp_code'] == symbol_trimmed]['bk_name'].tolist()
|
||||
|
||||
# 找到概念重叠度最高的股票
|
||||
overlapping_stocks = gp_gnbk_df[
|
||||
gp_gnbk_df['bk_name'].isin(concepts) &
|
||||
(gp_gnbk_df['gp_code'] != symbol_trimmed)
|
||||
]
|
||||
overlap_counts = overlapping_stocks['gp_code'].value_counts()
|
||||
|
||||
if not overlap_counts.empty:
|
||||
top_related_stock = overlap_counts.idxmax()
|
||||
top_related_count = overlap_counts.max()
|
||||
stock_changes_df['symbol_trimmed'] = stock_changes_df['symbol'].str[2:]
|
||||
top_related_name = stock_changes_df[
|
||||
stock_changes_df['symbol_trimmed'] == top_related_stock
|
||||
]['name'].values[0] if top_related_stock in stock_changes_df['symbol_trimmed'].values else None
|
||||
else:
|
||||
top_related_stock = None
|
||||
top_related_count = 0
|
||||
top_related_name = None
|
||||
|
||||
final_results.append({
|
||||
'symbol': symbol_trimmed,
|
||||
'name': name,
|
||||
'sealing_amount': sealing_amount,
|
||||
'sealing_ratio': sealing_ratio,
|
||||
'top_related_stock': top_related_stock,
|
||||
'top_related_name': top_related_name,
|
||||
'overlap_count': top_related_count,
|
||||
'sequence': index + 1,
|
||||
'sort_categray': sort_category,
|
||||
})
|
||||
|
||||
return final_results
|
||||
except Exception as e:
|
||||
print("分析过程中发生错误: {}".format(str(e)))
|
||||
return []
|
||||
|
||||
def save_results_to_db(db_url, results):
|
||||
"""将分析结果保存到数据库"""
|
||||
if not results:
|
||||
print("没有数据需要保存")
|
||||
return
|
||||
|
||||
df = pd.DataFrame(results)
|
||||
df['add_date'] = datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
engine = create_engine(db_url)
|
||||
|
||||
try:
|
||||
# 检查当天是否已有数据
|
||||
today = datetime.now().strftime('%Y-%m-%d')
|
||||
existing_data = pd.read_sql_query(
|
||||
"SELECT * FROM top_limitup_analysis WHERE add_date = '{}'".format(today),
|
||||
con=engine
|
||||
)
|
||||
|
||||
# 处理重复数据
|
||||
if not existing_data.empty:
|
||||
existing_pairs = set(zip(existing_data['symbol'], existing_data['add_date']))
|
||||
duplicate_flags = [
|
||||
(row['symbol'], row['add_date']) in existing_pairs
|
||||
for idx, row in df.iterrows()
|
||||
]
|
||||
df['is_duplicate'] = duplicate_flags
|
||||
new_records = df[df['is_duplicate'] == False].drop(columns=['is_duplicate'])
|
||||
else:
|
||||
new_records = df
|
||||
|
||||
# 保存新记录
|
||||
if not new_records.empty:
|
||||
new_records.to_sql('top_limitup_analysis', con=engine, if_exists='append', index=False)
|
||||
|
||||
# 打印结果
|
||||
for _, result in new_records.iterrows():
|
||||
print("股票代码: {}, 股票名称: {}, 封单金额: {:.2f}, 封单比例: {:.2%}".format(
|
||||
result['symbol'], result['name'], result['sealing_amount'], result['sealing_ratio']
|
||||
))
|
||||
print("概念重叠度最高的个股: {} ({}), 重叠度: {}, 涨停序列: {}".format(
|
||||
result['top_related_stock'], result['top_related_name'],
|
||||
result['overlap_count'], result['sequence']
|
||||
))
|
||||
|
||||
except Exception as e:
|
||||
print("保存数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def analyze_limitup_stocks_main(db_url):
|
||||
"""主函数:分析涨停股票并保存结果"""
|
||||
print("\n开始分析 - {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
|
||||
|
||||
# 更新股票数据
|
||||
if not fetch_and_store_stock_data(db_url):
|
||||
print("更新股票数据失败")
|
||||
return
|
||||
|
||||
print("\n按封单比例分析...")
|
||||
results_ratio = analyze_limitup_stocks(db_url, 'sealing_ratio')
|
||||
save_results_to_db(db_url, results_ratio)
|
||||
|
||||
print("\n按封单金额分析...")
|
||||
results_amount = analyze_limitup_stocks(db_url, 'sealed_amount')
|
||||
save_results_to_db(db_url, results_amount)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
analyze_limitup_stocks_main(db_url)
|
|
@ -0,0 +1,145 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime
|
||||
from tqdm import tqdm
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
class StockDailyDataCollector:
|
||||
"""股票日线数据采集器类"""
|
||||
|
||||
def __init__(self, db_url):
|
||||
"""
|
||||
初始化采集器
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
"""
|
||||
self.engine = create_engine(db_url)
|
||||
self.headers = XUEQIU_HEADERS
|
||||
|
||||
def fetch_all_stock_codes(self):
|
||||
"""从数据库获取所有股票代码"""
|
||||
query = "SELECT gp_code FROM gp_code_all_copy"
|
||||
df = pd.read_sql(query, self.engine)
|
||||
return df['gp_code'].tolist()
|
||||
|
||||
def fetch_daily_stock_data(self, symbol, begin):
|
||||
"""
|
||||
获取股票日线数据
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
symbol : str
|
||||
股票代码
|
||||
begin : int
|
||||
开始时间戳(毫秒)
|
||||
"""
|
||||
url = f"https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol={symbol}&begin={begin}&period=day&type=before&count=-1500&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
|
||||
response = requests.get(url, headers=self.headers)
|
||||
return response.json()
|
||||
|
||||
def save_daily_data_to_database(self, data, symbol):
|
||||
"""
|
||||
保存日线数据到数据库
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
data : dict
|
||||
API返回的数据
|
||||
symbol : str
|
||||
股票代码
|
||||
"""
|
||||
try:
|
||||
items = data['data']['item']
|
||||
columns = data['data']['column']
|
||||
except KeyError as e:
|
||||
print(f"KeyError for {symbol}: {e}")
|
||||
return
|
||||
|
||||
df = pd.DataFrame(items, columns=columns)
|
||||
df['symbol'] = symbol
|
||||
|
||||
# 数据库中有的字段
|
||||
required_columns = ['timestamp', 'volume', 'open', 'high', 'low', 'close',
|
||||
'chg', 'percent', 'turnoverrate', 'amount', 'symbol']
|
||||
|
||||
# 检查并保留实际存在的字段
|
||||
existing_columns = [col for col in required_columns if col in df.columns]
|
||||
df = df[existing_columns]
|
||||
|
||||
# 数据类型转换
|
||||
if 'timestamp' in df.columns:
|
||||
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms', utc=True).dt.tz_convert('Asia/Shanghai')
|
||||
|
||||
df.to_sql('gp_day_data', self.engine, if_exists='append', index=False)
|
||||
|
||||
def fetch_data_for_date(self, date=None):
|
||||
"""
|
||||
获取指定日期或当天的日线数据并保存到数据库
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
date : str, optional
|
||||
日期字符串,格式为'YYYY-MM-DD',如果为None则获取当天数据
|
||||
"""
|
||||
if date is None:
|
||||
# 如果没有指定日期,使用当天日期
|
||||
start_date = datetime.now()
|
||||
date_str = start_date.strftime('%Y-%m-%d')
|
||||
else:
|
||||
start_date = datetime.strptime(date, '%Y-%m-%d')
|
||||
date_str = date
|
||||
|
||||
# 在插入数据之前执行删除操作
|
||||
delete_query = text(f"DELETE FROM gp_day_data WHERE `timestamp` LIKE :date_str")
|
||||
with self.engine.connect() as conn:
|
||||
conn.execute(delete_query, {"date_str": f"{date_str}%"})
|
||||
|
||||
# 获取所有股票代码
|
||||
stock_codes = self.fetch_all_stock_codes()
|
||||
|
||||
# 循环请求每只股票的数据并保存,使用进度条显示进度
|
||||
for symbol in tqdm(stock_codes, desc=f"Fetching and saving daily stock data for {date_str}"):
|
||||
begin = int(start_date.replace(hour=0, minute=0, second=0, microsecond=0).timestamp() * 1000)
|
||||
|
||||
data = self.fetch_daily_stock_data(symbol, begin)
|
||||
if data['error_code'] == 0:
|
||||
self.save_daily_data_to_database(data, symbol)
|
||||
else:
|
||||
print(f"Error fetching data for {symbol} on {date_str}: {data['error_description']}")
|
||||
|
||||
print(f"Daily data fetching and saving completed for {date_str}.")
|
||||
|
||||
def collect_stock_daily_data(db_url, date=None):
|
||||
"""
|
||||
快捷方法:收集股票日线数据
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
date : str, optional
|
||||
日期字符串,格式为'YYYY-MM-DD',如果为None则获取当天数据
|
||||
"""
|
||||
collector = StockDailyDataCollector(db_url)
|
||||
collector.fetch_data_for_date(date)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
|
||||
# 方法1:使用快捷函数获取当天数据
|
||||
collect_stock_daily_data(db_url)
|
||||
|
||||
# 方法2:使用快捷函数获取指定日期数据
|
||||
# collect_stock_daily_data(db_url, '2020-01-01')
|
||||
|
||||
# 方法3:使用完整的类
|
||||
# collector = StockDailyDataCollector(db_url)
|
||||
# collector.fetch_data_for_date() # 获取当天数据
|
||||
# collector.fetch_data_for_date('2024-09-11') # 获取指定日期数据
|
|
@ -0,0 +1,18 @@
|
|||
2025-03-24 11:14:46,306 - stock_data_import - ERROR - 创建表失败: Not an executable object: "\n CREATE TABLE IF NOT EXISTS stock_semi_annual_report (\n id INT AUTO_INCREMENT PRIMARY KEY,\n stock_code VARCHAR(20) NOT NULL COMMENT '股票代码',\n stock_name VARCHAR(50) NOT NULL COMMENT '股票名称',\n report_date DATE NOT NULL COMMENT '报告日期',\n \n product_1_name VARCHAR(100) COMMENT '产品1名称',\n product_1_revenue DECIMAL(20,4) COMMENT '产品1营业收入',\n product_1_cost DECIMAL(20,4) COMMENT '产品1成本',\n product_1_gross_profit DECIMAL(20,4) COMMENT '产品1毛利',\n product_1_gross_margin DECIMAL(10,4) COMMENT '产品1毛利率',\n \n product_2_name VARCHAR(100) COMMENT '产品2名称',\n product_2_revenue DECIMAL(20,4) COMMENT '产品2营业收入',\n product_2_cost DECIMAL(20,4) COMMENT '产品2成本',\n product_2_gross_profit DECIMAL(20,4) COMMENT '产品2毛利',\n product_2_gross_margin DECIMAL(10,4) COMMENT '产品2毛利率',\n \n product_3_name VARCHAR(100) COMMENT '产品3名称',\n product_3_revenue DECIMAL(20,4) COMMENT '产品3营业收入',\n product_3_cost DECIMAL(20,4) COMMENT '产品3成本',\n product_3_gross_profit DECIMAL(20,4) COMMENT '产品3毛利',\n product_3_gross_margin DECIMAL(10,4) COMMENT '产品3毛利率',\n \n product_4_name VARCHAR(100) COMMENT '产品4名称',\n product_4_revenue DECIMAL(20,4) COMMENT '产品4营业收入',\n product_4_cost DECIMAL(20,4) COMMENT '产品4成本',\n product_4_gross_profit DECIMAL(20,4) COMMENT '产品4毛利',\n product_4_gross_margin DECIMAL(10,4) COMMENT '产品4毛利率',\n \n product_5_name VARCHAR(100) COMMENT '产品5名称',\n product_5_revenue DECIMAL(20,4) COMMENT '产品5营业收入',\n product_5_cost DECIMAL(20,4) COMMENT '产品5成本',\n product_5_gross_profit DECIMAL(20,4) COMMENT '产品5毛利',\n product_5_gross_margin DECIMAL(10,4) COMMENT '产品5毛利率',\n \n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n \n UNIQUE KEY idx_stock_report (stock_code, report_date)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='股票半年报主营业务数据';\n "
|
||||
2025-03-24 11:14:46,308 - stock_data_import - ERROR - 表创建失败,程序退出
|
||||
2025-03-24 11:16:57,259 - stock_data_import - ERROR - 创建表失败: Not an executable object: "\n CREATE TABLE IF NOT EXISTS stock_semi_annual_report (\n id INT AUTO_INCREMENT PRIMARY KEY,\n stock_code VARCHAR(20) NOT NULL COMMENT '股票代码',\n stock_name VARCHAR(50) NOT NULL COMMENT '股票名称',\n report_date DATE NOT NULL COMMENT '报告日期',\n \n product_1_name VARCHAR(100) COMMENT '产品1名称',\n product_1_revenue DECIMAL(20,4) COMMENT '产品1营业收入',\n product_1_cost DECIMAL(20,4) COMMENT '产品1成本',\n product_1_gross_profit DECIMAL(20,4) COMMENT '产品1毛利',\n product_1_gross_margin DECIMAL(10,4) COMMENT '产品1毛利率',\n \n product_2_name VARCHAR(100) COMMENT '产品2名称',\n product_2_revenue DECIMAL(20,4) COMMENT '产品2营业收入',\n product_2_cost DECIMAL(20,4) COMMENT '产品2成本',\n product_2_gross_profit DECIMAL(20,4) COMMENT '产品2毛利',\n product_2_gross_margin DECIMAL(10,4) COMMENT '产品2毛利率',\n \n product_3_name VARCHAR(100) COMMENT '产品3名称',\n product_3_revenue DECIMAL(20,4) COMMENT '产品3营业收入',\n product_3_cost DECIMAL(20,4) COMMENT '产品3成本',\n product_3_gross_profit DECIMAL(20,4) COMMENT '产品3毛利',\n product_3_gross_margin DECIMAL(10,4) COMMENT '产品3毛利率',\n \n product_4_name VARCHAR(100) COMMENT '产品4名称',\n product_4_revenue DECIMAL(20,4) COMMENT '产品4营业收入',\n product_4_cost DECIMAL(20,4) COMMENT '产品4成本',\n product_4_gross_profit DECIMAL(20,4) COMMENT '产品4毛利',\n product_4_gross_margin DECIMAL(10,4) COMMENT '产品4毛利率',\n \n product_5_name VARCHAR(100) COMMENT '产品5名称',\n product_5_revenue DECIMAL(20,4) COMMENT '产品5营业收入',\n product_5_cost DECIMAL(20,4) COMMENT '产品5成本',\n product_5_gross_profit DECIMAL(20,4) COMMENT '产品5毛利',\n product_5_gross_margin DECIMAL(10,4) COMMENT '产品5毛利率',\n \n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n \n UNIQUE KEY idx_stock_report (stock_code, report_date)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='股票半年报主营业务数据';\n "
|
||||
2025-03-24 11:16:57,259 - stock_data_import - ERROR - 表创建失败,程序退出
|
||||
2025-03-24 11:18:55,299 - stock_data_import - INFO - 表创建成功或已存在
|
||||
2025-03-24 11:18:55,301 - stock_data_import - INFO - 使用 utf-8 编码成功读取CSV
|
||||
2025-03-24 11:18:55,432 - stock_data_import - ERROR - 导入数据失败: Not an executable object: "\n SELECT COUNT(*) FROM stock_semi_annual_report \n WHERE stock_code = '688981.SH' AND report_date = '2024-06-30'\n "
|
||||
2025-03-24 11:18:55,432 - stock_data_import - ERROR - 数据导入失败
|
||||
2025-03-24 11:21:49,621 - stock_data_import - INFO - 表创建成功或已存在
|
||||
2025-03-24 11:21:49,623 - stock_data_import - INFO - 使用 utf-8 编码成功读取CSV
|
||||
2025-03-24 11:21:49,759 - stock_data_import - INFO - 插入股票 688981.SH 的数据
|
||||
2025-03-24 11:21:49,768 - stock_data_import - INFO - 成功导入 1 条记录到数据库
|
||||
2025-03-24 11:21:49,769 - stock_data_import - INFO - 数据导入成功
|
||||
2025-03-24 11:22:10,329 - stock_data_import - INFO - 表创建成功或已存在
|
||||
2025-03-24 11:22:10,330 - stock_data_import - INFO - 使用 utf-8 编码成功读取CSV
|
||||
2025-03-24 11:22:10,467 - stock_data_import - INFO - 插入股票 688981.SH 的数据
|
||||
2025-03-24 11:22:10,476 - stock_data_import - INFO - 成功导入 1 条记录到数据库
|
||||
2025-03-24 11:22:10,476 - stock_data_import - INFO - 数据导入成功
|
|
@ -0,0 +1,142 @@
|
|||
# coding:utf-8
|
||||
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine
|
||||
from datetime import datetime
|
||||
|
||||
class StockFilter:
|
||||
"""股票筛选器类,用于根据特定条件筛选股票"""
|
||||
|
||||
def __init__(self, db_url):
|
||||
"""
|
||||
初始化股票筛选器
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
"""
|
||||
self.engine = create_engine(db_url)
|
||||
|
||||
def get_high_amplitude_stocks(self, date, amplitude_threshold=0.07):
|
||||
"""
|
||||
获取指定日期振幅超过阈值且收盘价低于开盘价的股票
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
date : str
|
||||
日期字符串,格式为'YYYY-MM-DD'
|
||||
amplitude_threshold : float
|
||||
振幅阈值,默认为0.07(7%)
|
||||
|
||||
Returns:
|
||||
--------
|
||||
pandas.DataFrame
|
||||
符合条件的股票数据,包含以下列:
|
||||
- symbol: 股票代码
|
||||
- high: 最高价
|
||||
- low: 最低价
|
||||
- open: 开盘价
|
||||
- close: 收盘价
|
||||
"""
|
||||
query = f"""
|
||||
WITH ranked_data AS (
|
||||
SELECT symbol, timestamp, high, low, open, close,
|
||||
ROW_NUMBER() OVER (PARTITION BY symbol ORDER BY timestamp) AS row_num,
|
||||
ROW_NUMBER() OVER (PARTITION BY symbol ORDER BY timestamp DESC) AS rev_row_num
|
||||
FROM gp_min_data
|
||||
WHERE DATE(timestamp) = '{date}'
|
||||
),
|
||||
daily_data AS (
|
||||
SELECT symbol,
|
||||
MAX(high) AS high,
|
||||
MIN(low) AS low,
|
||||
MAX(CASE WHEN row_num = 1 THEN open ELSE NULL END) AS open,
|
||||
MAX(CASE WHEN rev_row_num = 1 THEN close ELSE NULL END) AS close
|
||||
FROM ranked_data
|
||||
GROUP BY symbol
|
||||
)
|
||||
SELECT symbol, high, low, open, close
|
||||
FROM daily_data
|
||||
WHERE (high - low) / open > {amplitude_threshold}
|
||||
AND close < open
|
||||
"""
|
||||
try:
|
||||
df = pd.read_sql(query, self.engine)
|
||||
return df
|
||||
except Exception as e:
|
||||
print(f"查询数据时发生错误: {str(e)}")
|
||||
return pd.DataFrame()
|
||||
|
||||
# def save_filtered_stocks(self, date, table_name='filtered_stocks'):
|
||||
# """
|
||||
# 将筛选结果保存到数据库
|
||||
|
||||
# Parameters:
|
||||
# -----------
|
||||
# date : str
|
||||
# 日期字符串,格式为'YYYY-MM-DD'
|
||||
# table_name : str
|
||||
# 保存结果的表名,默认为'filtered_stocks'
|
||||
|
||||
# Returns:
|
||||
# --------
|
||||
# bool
|
||||
# 保存成功返回True,失败返回False
|
||||
# """
|
||||
# try:
|
||||
# # 获取筛选结果
|
||||
# df = self.get_high_amplitude_stocks(date)
|
||||
|
||||
# # 添加筛选日期列
|
||||
# df['filter_date'] = date
|
||||
|
||||
# # 保存到数据库
|
||||
# df.to_sql(table_name, self.engine, if_exists='append', index=False)
|
||||
|
||||
# print(f"数据已成功保存到表 '{table_name}'")
|
||||
# return True
|
||||
# except Exception as e:
|
||||
# print(f"保存数据时发生错误: {str(e)}")
|
||||
# return False
|
||||
|
||||
def get_todays_filtered_stocks(db_url):
|
||||
"""
|
||||
获取今日符合条件的股票的快捷方法
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
|
||||
Returns:
|
||||
--------
|
||||
pandas.DataFrame
|
||||
今日符合条件的股票数据
|
||||
"""
|
||||
# 获取今日日期
|
||||
today = datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
# 创建筛选器实例
|
||||
filter = StockFilter(db_url)
|
||||
|
||||
# 获取并返回结果
|
||||
return filter.get_high_amplitude_stocks(today)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
|
||||
# 方法1:使用快捷函数获取今日数据
|
||||
# today_stocks = get_todays_filtered_stocks(db_url)
|
||||
# print("今日符合条件的股票:")
|
||||
# print(today_stocks)
|
||||
|
||||
# 方法2:使用完整的类,指定日期
|
||||
filter = StockFilter(db_url)
|
||||
stocks = filter.get_high_amplitude_stocks('2024-06-19')
|
||||
print("\n指定日期符合条件的股票:")
|
||||
print(stocks)
|
||||
|
||||
# 保存结果到数据库 这个是AI自动加的,暂时不需要保存数据库
|
||||
# filter.save_filtered_stocks('2024-06-19')
|
|
@ -0,0 +1,138 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime, timedelta
|
||||
from tqdm import tqdm
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
class StockMinuteDataCollector:
|
||||
"""股票分时数据采集器类"""
|
||||
|
||||
def __init__(self, db_url):
|
||||
"""
|
||||
初始化采集器
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
"""
|
||||
self.engine = create_engine(db_url)
|
||||
self.headers = XUEQIU_HEADERS
|
||||
|
||||
def fetch_all_stock_codes(self):
|
||||
"""从数据库获取所有股票代码"""
|
||||
query = "SELECT gp_code FROM gp_code_all_copy"
|
||||
df = pd.read_sql(query, self.engine)
|
||||
return df['gp_code'].tolist()
|
||||
|
||||
def update_market_cap(self, symbol, market_cap):
|
||||
"""更新数据库中的市值信息"""
|
||||
query = text("UPDATE gp_code_all_copy SET market_cap = :market_cap WHERE gp_code = :symbol")
|
||||
with self.engine.connect() as conn:
|
||||
conn.execute(query, {'market_cap': market_cap, 'symbol': symbol})
|
||||
|
||||
def fetch_market_cap(self, symbol):
|
||||
"""获取股票市值信息"""
|
||||
url = f"https://stock.xueqiu.com/v5/stock/realtime/quotec.json?symbol={symbol}"
|
||||
response = requests.get(url, headers=self.headers)
|
||||
data = response.json()
|
||||
if data['error_code'] == 0:
|
||||
return data['data'][0]['market_capital']
|
||||
else:
|
||||
print(f"Error fetching market cap for {symbol}: {data['error_description']}")
|
||||
return None
|
||||
|
||||
def fetch_stock_data(self, symbol, begin, end):
|
||||
"""获取股票分时数据"""
|
||||
url = f"https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol={symbol}&begin={begin}&end={end}&period=1m&type=before&count=-284&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
|
||||
response = requests.get(url, headers=self.headers)
|
||||
return response.json()
|
||||
|
||||
def save_to_database(self, data, symbol):
|
||||
"""保存数据到数据库"""
|
||||
try:
|
||||
items = data['data']['item']
|
||||
columns = data['data']['column']
|
||||
except KeyError as e:
|
||||
print(f"KeyError for {symbol}: {e}")
|
||||
return
|
||||
|
||||
df = pd.DataFrame(items, columns=columns)
|
||||
df['symbol'] = symbol
|
||||
|
||||
# 数据库中有的字段
|
||||
required_columns = ['timestamp', 'volume', 'open', 'high', 'low', 'close', 'chg', 'percent', 'turnoverrate', 'amount', 'symbol']
|
||||
|
||||
# 检查并保留实际存在的字段
|
||||
existing_columns = [col for col in required_columns if col in df.columns]
|
||||
df = df[existing_columns]
|
||||
|
||||
# 数据类型转换
|
||||
if 'timestamp' in df.columns:
|
||||
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms', utc=True).dt.tz_convert('Asia/Shanghai')
|
||||
|
||||
df.to_sql('gp_min_data', self.engine, if_exists='append', index=False)
|
||||
|
||||
def fetch_data_for_date(self, date=None):
|
||||
"""
|
||||
获取指定日期或当天的数据
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
date : str, optional
|
||||
日期字符串,格式为'YYYY-MM-DD',如果为None则获取当天数据
|
||||
"""
|
||||
if date is None:
|
||||
# 如果没有指定日期,使用当天日期
|
||||
date = datetime.now().strftime('%Y-%m-%d')
|
||||
|
||||
start_date = datetime.strptime(date, '%Y-%m-%d')
|
||||
end_date = start_date + timedelta(days=1)
|
||||
|
||||
# 获取所有股票代码
|
||||
stock_codes = self.fetch_all_stock_codes()
|
||||
|
||||
# 循环请求每只股票的数据并保存,使用进度条显示进度
|
||||
for symbol in tqdm(stock_codes, desc=f"Fetching and saving stock data for {date}"):
|
||||
begin = int(start_date.replace(hour=0, minute=0, second=0, microsecond=0).timestamp() * 1000)
|
||||
end = int(end_date.replace(hour=0, minute=0, second=0, microsecond=0).timestamp() * 1000)
|
||||
|
||||
data = self.fetch_stock_data(symbol, begin, end)
|
||||
if data['error_code'] == 0:
|
||||
self.save_to_database(data, symbol)
|
||||
else:
|
||||
print(f"Error fetching data for {symbol} on {date}: {data['error_description']}")
|
||||
|
||||
print(f"Data fetching and saving completed for {date}.")
|
||||
|
||||
def collect_stock_minute_data(db_url, date=None):
|
||||
"""
|
||||
快捷方法:收集股票分时数据
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
date : str, optional
|
||||
日期字符串,格式为'YYYY-MM-DD',如果为None则获取当天数据
|
||||
"""
|
||||
collector = StockMinuteDataCollector(db_url)
|
||||
collector.fetch_data_for_date(date)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
|
||||
# 方法1:使用快捷函数获取当天数据
|
||||
collect_stock_minute_data(db_url)
|
||||
|
||||
# 方法2:使用快捷函数获取指定日期数据
|
||||
# collect_stock_minute_data(db_url, '2024-07-29')
|
||||
|
||||
# 方法3:使用完整的类
|
||||
# collector = StockMinuteDataCollector(db_url)
|
||||
# collector.fetch_data_for_date() # 获取当天数据
|
||||
# collector.fetch_data_for_date('2024-07-29') # 获取指定日期数据
|
|
@ -0,0 +1,280 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime
|
||||
import time
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def ensure_stock_price_changes_table_exists(engine):
|
||||
"""确保股价变化表存在"""
|
||||
try:
|
||||
create_table_query = text("""
|
||||
CREATE TABLE IF NOT EXISTS stock_price_changes (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
symbol VARCHAR(10),
|
||||
name VARCHAR(100),
|
||||
current FLOAT,
|
||||
percent FLOAT,
|
||||
time_mark VARCHAR(20), -- '9:24:40' 或 '9:25:00'
|
||||
add_time DATETIME,
|
||||
UNIQUE KEY unique_stock_time (symbol, time_mark, add_time)
|
||||
)
|
||||
""")
|
||||
|
||||
create_analysis_table_query = text("""
|
||||
CREATE TABLE IF NOT EXISTS rapid_price_changes (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
symbol VARCHAR(10),
|
||||
name VARCHAR(100),
|
||||
price_change_ratio FLOAT, -- 两个时间点之间的涨幅
|
||||
sector_count INT, -- 所属板块数量
|
||||
sectors TEXT, -- 所属板块名称(逗号分隔)
|
||||
add_time DATETIME
|
||||
)
|
||||
""")
|
||||
|
||||
with engine.connect() as conn:
|
||||
conn.execute(create_table_query)
|
||||
conn.execute(create_analysis_table_query)
|
||||
conn.commit()
|
||||
print("股价变化表检查/创建完成")
|
||||
except Exception as e:
|
||||
print("创建股价变化表时发生错误: {}".format(str(e)))
|
||||
|
||||
def fetch_stock_data(db_url, time_mark):
|
||||
"""获取雪球数据并保存到数据库"""
|
||||
base_url = 'https://stock.xueqiu.com/v5/stock/screener/quote/list.json'
|
||||
types = ['sha', 'sza', 'kcb']
|
||||
headers = XUEQIU_HEADERS
|
||||
|
||||
all_data = []
|
||||
|
||||
for stock_type in types:
|
||||
# 先获取总数据量
|
||||
params = {
|
||||
'page': 1,
|
||||
'size': 100,
|
||||
'order': 'desc',
|
||||
'order_by': 'percent',
|
||||
'market': 'CN',
|
||||
'type': stock_type
|
||||
}
|
||||
|
||||
# 初次请求以获取总页数
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code != 200:
|
||||
print(f"请求 {stock_type} 数据失败,状态码:{response.status_code}")
|
||||
continue
|
||||
|
||||
data = response.json()
|
||||
total_count = data['data']['count']
|
||||
total_pages = (total_count // params['size']) + 1
|
||||
|
||||
# 获取所有页面的数据
|
||||
for page in range(1, total_pages + 1):
|
||||
params['page'] = page
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
all_data.extend(data['data']['list'])
|
||||
else:
|
||||
print(f"请求 {stock_type} 数据第 {page} 页失败,状态码:{response.status_code}")
|
||||
|
||||
if all_data:
|
||||
df = pd.DataFrame(all_data)
|
||||
selected_columns = ['symbol', 'name', 'current', 'percent']
|
||||
df = df[selected_columns]
|
||||
df['symbol'] = df['symbol'].str[2:] # 去掉前缀
|
||||
df['time_mark'] = time_mark
|
||||
df['add_time'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
engine = create_engine(db_url)
|
||||
ensure_stock_price_changes_table_exists(engine)
|
||||
|
||||
# 先删除同一时间标记的旧数据
|
||||
with engine.connect() as conn:
|
||||
delete_query = text("""
|
||||
DELETE FROM stock_price_changes
|
||||
WHERE time_mark = :time_mark
|
||||
AND DATE(add_time) = CURDATE()
|
||||
""")
|
||||
conn.execute(delete_query, {'time_mark': time_mark})
|
||||
conn.commit()
|
||||
|
||||
# 保存新数据
|
||||
df.to_sql('stock_price_changes', con=engine, if_exists='append', index=False)
|
||||
print(f"成功保存{len(df)}条{time_mark}的股价数据")
|
||||
return True
|
||||
return False
|
||||
|
||||
def analyze_price_changes(db_url):
|
||||
"""分析两个时间点之间的板块涨跌情况"""
|
||||
engine = create_engine(db_url)
|
||||
|
||||
try:
|
||||
# 获取所有股票的涨跌幅数据
|
||||
query = text("""
|
||||
SELECT
|
||||
t1.symbol,
|
||||
t1.name,
|
||||
((t2.current - t1.current) / t1.current * 100) as price_change_ratio
|
||||
FROM
|
||||
stock_price_changes t1
|
||||
JOIN stock_price_changes t2 ON t1.symbol = t2.symbol
|
||||
WHERE
|
||||
t1.time_mark = '9:24:00'
|
||||
AND t2.time_mark = '9:25:10'
|
||||
AND DATE(t1.add_time) = CURDATE()
|
||||
AND DATE(t2.add_time) = CURDATE()
|
||||
""")
|
||||
|
||||
price_changes_df = pd.read_sql_query(query, engine)
|
||||
|
||||
if not price_changes_df.empty:
|
||||
# 获取板块信息
|
||||
gp_gnbk_df = pd.read_sql_table('gp_gnbk', con=engine)
|
||||
|
||||
# 合并获取板块信息
|
||||
merged_df = price_changes_df.merge(gp_gnbk_df, left_on='symbol', right_on='gp_code')
|
||||
|
||||
# 按板块统计涨幅超过1%的股票数量和总数
|
||||
sector_stats = []
|
||||
for bk_name in merged_df['bk_name'].unique():
|
||||
sector_stocks = merged_df[merged_df['bk_name'] == bk_name]
|
||||
total_count = len(sector_stocks)
|
||||
up_count = len(sector_stocks[sector_stocks['price_change_ratio'] > 0.7])
|
||||
ratio = up_count / total_count if total_count > 0 else 0
|
||||
|
||||
sector_stats.append({
|
||||
'sector_name': bk_name,
|
||||
'up_count': up_count,
|
||||
'total_count': total_count,
|
||||
'ratio': ratio,
|
||||
'add_time': datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
})
|
||||
|
||||
# 转换为DataFrame并按比例排序
|
||||
result_df = pd.DataFrame(sector_stats)
|
||||
result_df = result_df.sort_values('ratio', ascending=False)
|
||||
|
||||
# 打印分析结果
|
||||
print("\n=== 板块涨幅分析结果 ===")
|
||||
print(f"分析时间: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
print("\n{:<15} {:<8} {:<8} {:<10}".format(
|
||||
"板块名称", "上涨家数", "总家数", "占比"
|
||||
))
|
||||
print("-" * 45)
|
||||
|
||||
# 打印所有板块数据
|
||||
for _, row in result_df.iterrows():
|
||||
print("{:<15} {:<8d} {:<8d} {:<10.2f}%".format(
|
||||
row['sector_name'],
|
||||
row['up_count'],
|
||||
row['total_count'],
|
||||
row['ratio'] * 100
|
||||
))
|
||||
|
||||
print("\n总计分析板块数量:", len(result_df))
|
||||
|
||||
else:
|
||||
print("未获取到股价变化数据")
|
||||
|
||||
except Exception as e:
|
||||
print("分析数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def get_previous_sector_ranks(engine):
|
||||
"""获取上一次的板块排名"""
|
||||
try:
|
||||
query = text("""
|
||||
SELECT sector_name, rank_num
|
||||
FROM sector_performance
|
||||
WHERE DATE(add_time) = CURDATE()
|
||||
ORDER BY add_time DESC
|
||||
LIMIT 1
|
||||
""")
|
||||
|
||||
result = pd.read_sql_query(query, engine)
|
||||
if result.empty:
|
||||
return {}
|
||||
|
||||
return dict(zip(result['sector_name'], result['rank_num']))
|
||||
except Exception as e:
|
||||
print("获取上一次排名数据时发生错误: {}".format(str(e)))
|
||||
return {}
|
||||
|
||||
def calculate_rank_change(row, previous_ranks):
|
||||
"""计算排名变化"""
|
||||
previous_rank = previous_ranks.get(row['sector_name'])
|
||||
if previous_rank is None:
|
||||
return 0
|
||||
return previous_rank - row['rank_num']
|
||||
|
||||
def get_cache_mark():
|
||||
"""获取当前时间对应的缓存标记"""
|
||||
current_minute = datetime.now().minute
|
||||
mark = (current_minute % 10) // 2 * 2
|
||||
return "{}m".format(mark)
|
||||
|
||||
def save_sector_cache(engine, df_result, cache_mark):
|
||||
"""保存板块数据到缓存表"""
|
||||
try:
|
||||
df_cache = df_result.copy()
|
||||
df_cache['cache_mark'] = cache_mark
|
||||
|
||||
with engine.connect() as conn:
|
||||
delete_query = text("DELETE FROM sector_performance_cache WHERE cache_mark = :cache_mark")
|
||||
conn.execute(delete_query, {'cache_mark': cache_mark})
|
||||
conn.commit()
|
||||
|
||||
df_cache.to_sql('sector_performance_cache', con=engine, if_exists='append', index=False)
|
||||
print(f"缓存数据已保存,标记: {cache_mark}")
|
||||
except Exception as e:
|
||||
print("保存缓存数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def main(db_url):
|
||||
"""主函数"""
|
||||
engine = create_engine(db_url)
|
||||
|
||||
target_time_1 = datetime.now().replace(hour=9, minute=24, second=0, microsecond=0)
|
||||
target_time_2 = datetime.now().replace(hour=9, minute=25, second=10, microsecond=0)
|
||||
current_time = datetime.now()
|
||||
|
||||
# 如果当前时间已经超过了第二个时间点,直接进行分析
|
||||
if current_time > target_time_2:
|
||||
print("当前时间已超过9:24:00,直接进行数据分析...")
|
||||
analyze_price_changes(db_url)
|
||||
return
|
||||
|
||||
# 如果还没到第一个时间点,等待
|
||||
if current_time < target_time_1:
|
||||
wait_seconds = (target_time_1 - current_time).total_seconds()
|
||||
print(f"等待{wait_seconds}9:24:00...")
|
||||
time.sleep(wait_seconds)
|
||||
|
||||
# 获取第一次数据
|
||||
success_1 = fetch_stock_data(db_url, '9:24:00')
|
||||
|
||||
if success_1:
|
||||
# 如果还没到第二个时间点,等待
|
||||
current_time = datetime.now()
|
||||
if current_time < target_time_2:
|
||||
wait_seconds = (target_time_2 - current_time).total_seconds()
|
||||
print(f"等待{wait_seconds}9:25:10...")
|
||||
time.sleep(wait_seconds)
|
||||
|
||||
# 获取第二次数据
|
||||
success_2 = fetch_stock_data(db_url, '9:25:10')
|
||||
|
||||
if success_2:
|
||||
# 分析数据
|
||||
analyze_price_changes(db_url)
|
||||
else:
|
||||
print("9:25:10数据失败")
|
||||
else:
|
||||
print("9:24:00数据失败")
|
||||
|
||||
if __name__ == "__main__":
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
main(db_url)
|
|
@ -0,0 +1,336 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from datetime import datetime
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def fetch_and_store_stock_data(db_url, table_name='stock_changes', page_size=90):
|
||||
"""获取雪球数据并保存到数据库"""
|
||||
base_url = 'https://stock.xueqiu.com/v5/stock/screener/quote/list.json'
|
||||
types = ['sha', 'sza', 'kcb'] # 数据类型
|
||||
headers = XUEQIU_HEADERS
|
||||
|
||||
all_data = []
|
||||
|
||||
for stock_type in types:
|
||||
params = {
|
||||
'page': 1,
|
||||
'size': page_size,
|
||||
'order': 'desc',
|
||||
'order_by': 'percent',
|
||||
'market': 'CN',
|
||||
'type': stock_type
|
||||
}
|
||||
|
||||
# 初次请求以获取总页数
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code != 200:
|
||||
print(f"请求 {stock_type} 数据失败,状态码:{response.status_code}")
|
||||
continue
|
||||
|
||||
data = response.json()
|
||||
total_count = data['data']['count']
|
||||
total_pages = (total_count // page_size) + 1
|
||||
|
||||
for page in range(1, total_pages + 1):
|
||||
params['page'] = page
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
all_data.extend(data['data']['list'])
|
||||
else:
|
||||
print(f"请求 {stock_type} 数据第 {page} 页失败,状态码:{response.status_code}")
|
||||
# 转换为 DataFrame
|
||||
df = pd.DataFrame(all_data)
|
||||
|
||||
if not df.empty:
|
||||
# 添加 id 列
|
||||
df['id'] = range(1, len(df) + 1)
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 将数据写入数据库表
|
||||
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
|
||||
print(f"成功将数据写入数据库表 {table_name}。")
|
||||
else:
|
||||
print("未获取到任何数据。")
|
||||
|
||||
def get_cache_mark():
|
||||
"""获取当前时间对应的缓存标记(0m, 2m, 4m, 6m, 8m)"""
|
||||
current_minute = datetime.now().minute
|
||||
mark = (current_minute % 10) // 2 * 2 # 将分钟数转换为0,2,4,6,8
|
||||
return "{}m".format(mark)
|
||||
|
||||
def save_sector_cache(engine, df_result, cache_mark):
|
||||
"""保存板块数据到缓存表"""
|
||||
try:
|
||||
# 复制数据并添加缓存标记
|
||||
df_cache = df_result.copy()
|
||||
df_cache['cache_mark'] = cache_mark
|
||||
|
||||
# 删除旧的缓存数据
|
||||
delete_query = text("DELETE FROM sector_performance_cache WHERE cache_mark = :cache_mark")
|
||||
with engine.connect() as conn: # 使用 connect() 创建连接
|
||||
conn.execute(delete_query, {'cache_mark': cache_mark})
|
||||
conn.commit() # 提交事务
|
||||
|
||||
# 保存新的缓存数据
|
||||
df_cache.to_sql('sector_performance_cache', con=engine, if_exists='append', index=False)
|
||||
print("缓存数据已保存,标记: {}".format(cache_mark))
|
||||
except Exception as e:
|
||||
print("保存缓存数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def ensure_cache_table_exists(engine):
|
||||
"""确保缓存表存在"""
|
||||
try:
|
||||
create_table_query = text("""
|
||||
CREATE TABLE IF NOT EXISTS sector_performance_cache (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
sector_name VARCHAR(100),
|
||||
up_count INT,
|
||||
total_count INT,
|
||||
ratio FLOAT,
|
||||
rank_num INT,
|
||||
rank_change INT,
|
||||
add_time DATETIME,
|
||||
cache_mark VARCHAR(10)
|
||||
)
|
||||
""")
|
||||
with engine.connect() as conn: # 使用 connect() 创建连接
|
||||
conn.execute(create_table_query)
|
||||
conn.commit() # 提交事务
|
||||
print("缓存表检查/创建完成")
|
||||
except Exception as e:
|
||||
print("创建缓存表时发生错误: {}".format(str(e)))
|
||||
|
||||
def get_previous_cache_marks():
|
||||
"""获取缓存标记的对应关系"""
|
||||
return {
|
||||
0: 4, # 0m 对比 4m的数据
|
||||
2: 6, # 2m 对比 6m的数据
|
||||
4: 8, # 4m 对比 8m的数据
|
||||
6: 0, # 6m 对比 0m的数据
|
||||
8: 2 # 8m 对比 2m的数据
|
||||
}
|
||||
|
||||
def get_previous_cache_ranks(engine):
|
||||
"""获取上一个时间点的缓存数据"""
|
||||
try:
|
||||
# 获取当前缓存标记
|
||||
current_mark = int(get_cache_mark().replace('m', ''))
|
||||
|
||||
# 获取应该对比的缓存标记
|
||||
cache_marks = get_previous_cache_marks()
|
||||
previous_mark = cache_marks.get(current_mark)
|
||||
|
||||
if previous_mark is None:
|
||||
print("无法确定对比的缓存标记")
|
||||
return {}
|
||||
|
||||
previous_cache_mark = "{}m".format(previous_mark)
|
||||
print("当前时间标记: {}m, 对比的缓存标记: {}".format(current_mark, previous_cache_mark))
|
||||
|
||||
query = text("""
|
||||
SELECT sector_name, rank_num
|
||||
FROM sector_performance_cache
|
||||
WHERE cache_mark = :cache_mark
|
||||
""")
|
||||
|
||||
result = pd.read_sql_query(query, engine, params={'cache_mark': previous_cache_mark})
|
||||
if result.empty:
|
||||
print("未找到缓存标记 {} 的数据".format(previous_cache_mark))
|
||||
return {}
|
||||
|
||||
return dict(zip(result['sector_name'], result['rank_num']))
|
||||
except Exception as e:
|
||||
print("获取缓存数据时发生错误: {}".format(str(e)))
|
||||
return {}
|
||||
|
||||
def calculate_rank_change(row, previous_ranks):
|
||||
"""计算排名变化"""
|
||||
previous_rank = previous_ranks.get(row['sector_name'])
|
||||
if previous_rank is None:
|
||||
return 0
|
||||
return previous_rank - row['rank_num']
|
||||
|
||||
def get_high_performance_stocks(db_url):
|
||||
"""获取涨幅超过1.5%的股票及其板块分布情况"""
|
||||
engine = create_engine(db_url)
|
||||
|
||||
try:
|
||||
# 确保缓存表存在
|
||||
ensure_cache_table_exists(engine)
|
||||
|
||||
# 先获取最新数据
|
||||
fetch_and_store_stock_data(db_url)
|
||||
|
||||
# 读取数据
|
||||
stock_changes_df = pd.read_sql_table('stock_changes', con=engine)
|
||||
gp_gnbk_df = pd.read_sql_table('gp_gnbk', con=engine)
|
||||
|
||||
# 去掉 symbol 字段的前两个字符
|
||||
stock_changes_df['symbol'] = stock_changes_df['symbol'].str[2:]
|
||||
|
||||
# 筛选涨幅超过 1.5% 的股票
|
||||
high_performance_stocks = stock_changes_df[stock_changes_df['percent'] > 1.5]
|
||||
|
||||
# 关联两个表,获取 bk_name
|
||||
merged_df = high_performance_stocks.merge(gp_gnbk_df, left_on='symbol', right_on='gp_code')
|
||||
|
||||
# 统计每个 bk_name 的数量
|
||||
total_counts = gp_gnbk_df['bk_name'].value_counts()
|
||||
high_performance_counts = merged_df['bk_name'].value_counts()
|
||||
|
||||
# 计算每个板块的上涨家数及占比
|
||||
result = []
|
||||
for bk_name, count in high_performance_counts.items():
|
||||
total_count = total_counts[bk_name]
|
||||
ratio = count / total_count
|
||||
result.append((bk_name, count, total_count, ratio))
|
||||
|
||||
# 按比重排序
|
||||
result.sort(key=lambda x: x[3], reverse=True)
|
||||
|
||||
# 创建DataFrame并添加排序字段
|
||||
df_result = pd.DataFrame(result, columns=['sector_name', 'up_count', 'total_count', 'ratio'])
|
||||
df_result['rank_num'] = range(1, len(df_result) + 1) # 添加排序字段,从1开始
|
||||
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
df_result['add_time'] = current_time # 添加时间字段
|
||||
|
||||
# 获取上一个时间点的缓存数据进行对比
|
||||
previous_ranks = get_previous_cache_ranks(engine)
|
||||
# 计算排名变化
|
||||
df_result['rank_change'] = df_result.apply(
|
||||
lambda row: calculate_rank_change(row, previous_ranks), axis=1
|
||||
)
|
||||
|
||||
# 保存到数据库(追加模式)
|
||||
df_result.to_sql('sector_performance', con=engine, if_exists='append', index=False)
|
||||
|
||||
# 保存到缓存表
|
||||
cache_mark = get_cache_mark()
|
||||
save_sector_cache(engine, df_result, cache_mark)
|
||||
|
||||
# 输出结果
|
||||
for _, row in df_result.iterrows():
|
||||
print("板块名称: {}, 上涨家数: {}, 总数: {}, 比重: {:.2%}, 排名: {}, 排名变化: {}".format(
|
||||
row['sector_name'], row['up_count'], row['total_count'],
|
||||
row['ratio'], row['rank_num'], row['rank_change']
|
||||
))
|
||||
|
||||
return result
|
||||
except Exception as e:
|
||||
print("分析数据时发生错误: {}".format(str(e)))
|
||||
return []
|
||||
|
||||
def get_top_industries_and_stocks(db_url, top_start=1, top_end=10):
|
||||
"""
|
||||
分析在多个热门板块中出现的股票
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
db_url : str
|
||||
数据库连接URL
|
||||
top_start : int
|
||||
起始排名
|
||||
top_end : int
|
||||
结束排名
|
||||
"""
|
||||
try:
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 获取高表现股票及其板块信息
|
||||
top_industries = get_high_performance_stocks(db_url)
|
||||
if not top_industries:
|
||||
print("无法获取行业数据")
|
||||
return
|
||||
|
||||
# 提取指定范围的行名称
|
||||
top_industry_names = [industry[0] for industry in top_industries[top_start-1:top_end]]
|
||||
|
||||
# 读取数据
|
||||
stock_changes_df = pd.read_sql_table('stock_changes', con=engine)
|
||||
gp_gnbk_df = pd.read_sql_table('gp_gnbk', con=engine)
|
||||
|
||||
# 去掉 symbol 字段的前两个字符
|
||||
stock_changes_df['symbol'] = stock_changes_df['symbol'].str[2:]
|
||||
|
||||
# 关联两个表,获取 bk_name 和 gp_name
|
||||
merged_df = stock_changes_df.merge(gp_gnbk_df, left_on='symbol', right_on='gp_code')
|
||||
|
||||
# 筛选指定范围的行业的股票
|
||||
filtered_df = merged_df[merged_df['bk_name'].isin(top_industry_names)]
|
||||
|
||||
# 统计每只股票命中行业的数量
|
||||
stock_industry_counts = filtered_df.groupby(['symbol', 'gp_name'])['bk_name'].nunique().sort_values(ascending=False).head(10)
|
||||
|
||||
# 获取每只股票的命中行业数量
|
||||
stock_industry_list = stock_industry_counts.reset_index()
|
||||
stock_industry_list.columns = ['symbol', 'stock_name', 'sector_count']
|
||||
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
stock_industry_list['add_time'] = current_time # 添加时间字段
|
||||
|
||||
# 保存结果到数据库(改为追加模式)
|
||||
stock_industry_list.to_sql('top_sector_stocks', con=engine, if_exists='append', index=False)
|
||||
|
||||
# 输出结果
|
||||
for index, row in stock_industry_list.iterrows():
|
||||
print("股票代码: {}, 股票名称: {}, 命中行业数量: {}".format(
|
||||
row['symbol'], row['stock_name'], row['sector_count']
|
||||
))
|
||||
|
||||
except Exception as e:
|
||||
print("分析行业数据时发生错误: {}".format(str(e)))
|
||||
|
||||
def clean_historical_data(engine):
|
||||
"""清理当天0点之前的历史数据"""
|
||||
try:
|
||||
today = datetime.now().strftime('%Y-%m-%d 00:00:00')
|
||||
|
||||
# 清理sector_performance表
|
||||
clean_performance_query = text("""
|
||||
DELETE FROM sector_performance
|
||||
WHERE add_time < :today
|
||||
""")
|
||||
|
||||
# 清理sector_performance_cache表
|
||||
clean_cache_query = text("""
|
||||
DELETE FROM sector_performance_cache
|
||||
WHERE add_time < :today
|
||||
""")
|
||||
|
||||
# 清理top_sector_stocks表
|
||||
clean_stocks_query = text("""
|
||||
DELETE FROM top_sector_stocks
|
||||
WHERE add_time < :today
|
||||
""")
|
||||
|
||||
with engine.connect() as conn: # 使用 connect() 创建连接
|
||||
result1 = conn.execute(clean_performance_query, {'today': today})
|
||||
result2 = conn.execute(clean_cache_query, {'today': today})
|
||||
result3 = conn.execute(clean_stocks_query, {'today': today})
|
||||
conn.commit() # 提交事务
|
||||
|
||||
print("清理历史数据完成:")
|
||||
print("- sector_performance表删除了{}条记录".format(result1.rowcount))
|
||||
print("- sector_performance_cache表删除了{}条记录".format(result2.rowcount))
|
||||
print("- top_sector_stocks表删除了{}条记录".format(result3.rowcount))
|
||||
|
||||
except Exception as e:
|
||||
print("清理历史数据时发生错误: {}".format(str(e)))
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 清理历史数据
|
||||
clean_historical_data(engine)
|
||||
|
||||
# 执行主要分析
|
||||
get_top_industries_and_stocks(db_url, 1, 10)
|
|
@ -0,0 +1,157 @@
|
|||
# coding:utf-8
|
||||
|
||||
from easy_spider_tool import cookie_to_dic, format_json
|
||||
from easy_twitter_crawler import set_proxy, set_cookie, search_crawler, TwitterFilter
|
||||
|
||||
class TwitterKeywordCrawler:
|
||||
"""Twitter关键词爬虫类,用于获取特定关键词的Twitter数据"""
|
||||
|
||||
def __init__(self, proxy_host="127.0.0.1", proxy_port="10808"):
|
||||
"""
|
||||
初始化Twitter爬虫
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
proxy_host : str
|
||||
代理服务器地址
|
||||
proxy_port : str
|
||||
代理服务器端口
|
||||
"""
|
||||
self.proxy = {
|
||||
'http': f'http://{proxy_host}:{proxy_port}',
|
||||
'https': f'http://{proxy_host}:{proxy_port}'
|
||||
}
|
||||
self.cookie = None
|
||||
self.twitter_filter = None
|
||||
|
||||
def set_authentication(self, cookie):
|
||||
"""
|
||||
设置Twitter认证信息
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
cookie : str
|
||||
Twitter的cookie字符串
|
||||
"""
|
||||
self.cookie = cookie
|
||||
set_proxy(self.proxy)
|
||||
set_cookie(cookie_to_dic(cookie))
|
||||
|
||||
def configure_filter(self, key_word, lang='zh', from_user='', to_user='', at_user='',
|
||||
only_replies=None, only_links=None, exclude_replies=None,
|
||||
exclude_links=None, min_replies='', min_faves='',
|
||||
min_retweets='', since='', until=''):
|
||||
"""
|
||||
配置Twitter搜索过滤器
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
key_word : str
|
||||
搜索关键词
|
||||
lang : str
|
||||
语言设置
|
||||
from_user : str
|
||||
来源用户
|
||||
to_user : str
|
||||
发送给指定用户
|
||||
at_user : str
|
||||
提及用户
|
||||
only_replies : bool
|
||||
是否只包含回复
|
||||
only_links : bool
|
||||
是否只包含链接
|
||||
exclude_replies : bool
|
||||
是否排除回复
|
||||
exclude_links : bool
|
||||
是否排除链接
|
||||
min_replies : str
|
||||
最小回复数
|
||||
min_faves : str
|
||||
最小点赞数
|
||||
min_retweets : str
|
||||
最小转发数
|
||||
since : str
|
||||
开始日期
|
||||
until : str
|
||||
结束日期
|
||||
"""
|
||||
self.twitter_filter = TwitterFilter(key_word)
|
||||
self.twitter_filter.word_category(lang=lang)
|
||||
self.twitter_filter.account_category(filter_from=from_user, to=to_user, at=at_user)
|
||||
self.twitter_filter.filter_category(
|
||||
only_replies=only_replies,
|
||||
only_links=only_links,
|
||||
exclude_replies=exclude_replies,
|
||||
exclude_links=exclude_links
|
||||
)
|
||||
self.twitter_filter.interact_category(
|
||||
min_replies=min_replies,
|
||||
min_faves=min_faves,
|
||||
min_retweets=min_retweets
|
||||
)
|
||||
self.twitter_filter.date_category(since=since, until=until)
|
||||
|
||||
def crawl(self, data_type='Latest', count=20):
|
||||
"""
|
||||
执行爬取操作
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
data_type : str
|
||||
数据类型,默认为'Latest'
|
||||
count : int
|
||||
爬取数量
|
||||
|
||||
Returns:
|
||||
--------
|
||||
list
|
||||
爬取到的数据列表
|
||||
"""
|
||||
if not self.twitter_filter or not self.cookie:
|
||||
raise ValueError("请先设置认证信息和过滤器")
|
||||
|
||||
key_word = self.twitter_filter.filter_join()
|
||||
results = []
|
||||
|
||||
for info in search_crawler(key_word, data_type=data_type, count=count):
|
||||
# 每次请求前重新设置代理和cookie
|
||||
set_proxy(self.proxy)
|
||||
set_cookie(cookie_to_dic(self.cookie))
|
||||
results.append(format_json(info))
|
||||
|
||||
return results
|
||||
|
||||
def get_bloomberg_news(count=20):
|
||||
"""
|
||||
获取彭博社新闻数据的快速方法
|
||||
|
||||
Parameters:
|
||||
-----------
|
||||
count : int
|
||||
获取的新闻数量
|
||||
|
||||
Returns:
|
||||
--------
|
||||
list
|
||||
彭博社新闻数据列表
|
||||
"""
|
||||
# Twitter认证信息
|
||||
cookie = 'auth_token=ca95aaf4a95bdc3514d9ba26d7941089e5368ab7; ct0=d5f1bb1b10435f8b5e700c679fae30b40945952649f92bd0bd201fee750e6ca0828aad6ef01094beb22c6cc5363284c993ed7c660bab327f12f483b1ecb3627ff1194f5f0bf3b01fe51548075ab986ae'
|
||||
|
||||
# 创建爬虫实例
|
||||
crawler = TwitterKeywordCrawler()
|
||||
|
||||
# 设置认证信息
|
||||
crawler.set_authentication(cookie)
|
||||
|
||||
# 配置过滤器
|
||||
crawler.configure_filter(key_word='彭博社', lang='zh')
|
||||
|
||||
# 执行爬取
|
||||
return crawler.crawl(count=count)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例:获取彭博社新闻
|
||||
news_list = get_bloomberg_news(20)
|
||||
for news in news_list:
|
||||
print(news)
|
|
@ -0,0 +1,73 @@
|
|||
# coding:utf-8
|
||||
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine
|
||||
from config import XUEQIU_HEADERS
|
||||
|
||||
def fetch_and_store_stock_data(db_url, table_name, page_size=100):
|
||||
"""
|
||||
Fetches stock data from the given API and stores it into a specified database table.
|
||||
Supports fetching data for multiple types: 'sha', 'sza', 'kcb'.
|
||||
"""
|
||||
import requests
|
||||
import pandas as pd
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
base_url = 'https://stock.xueqiu.com/v5/stock/screener/quote/list.json'
|
||||
types = ['sha', 'sza', 'kcb'] # 数据类型
|
||||
headers = XUEQIU_HEADERS
|
||||
|
||||
all_data = []
|
||||
|
||||
for stock_type in types:
|
||||
params = {
|
||||
'page': 1,
|
||||
'size': page_size,
|
||||
'order': 'desc',
|
||||
'order_by': 'percent',
|
||||
'market': 'CN',
|
||||
'type': stock_type
|
||||
}
|
||||
|
||||
# 初次请求以获取总页数
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code != 200:
|
||||
print(f"请求 {stock_type} 数据失败,状态码:{response.status_code}")
|
||||
continue
|
||||
|
||||
data = response.json()
|
||||
total_count = data['data']['count']
|
||||
total_pages = (total_count // page_size) + 1
|
||||
|
||||
for page in range(1, total_pages + 1):
|
||||
params['page'] = page
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
if response.status_code == 200:
|
||||
data = response.json()
|
||||
all_data.extend(data['data']['list'])
|
||||
else:
|
||||
print(f"请求 {stock_type} 数据第 {page} 页失败,状态码:{response.status_code}")
|
||||
|
||||
# 转换为 DataFrame
|
||||
df = pd.DataFrame(all_data)
|
||||
|
||||
if not df.empty:
|
||||
# 添加 id 列
|
||||
df['id'] = range(1, len(df) + 1)
|
||||
|
||||
# 创建数据库连接
|
||||
engine = create_engine(db_url)
|
||||
|
||||
# 将数据写入数据库表
|
||||
df.to_sql(table_name, con=engine, if_exists='replace', index=False)
|
||||
print(f"成功将数据写入数据库表 {table_name}。")
|
||||
else:
|
||||
print("未获取到任何数据。")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 示例调用
|
||||
db_url = 'mysql+pymysql://root:Chlry$%.8@192.168.1.82:3306/db_gp_cj'
|
||||
table_name = 'stock_changes'
|
||||
fetch_and_store_stock_data(db_url, table_name)
|
Binary file not shown.
|
@ -0,0 +1,25 @@
|
|||
2025-03-05 14:51:02,426 - INFO - === 股票分析程序开始运行 ===
|
||||
2025-03-05 14:51:02,427 - INFO - 初始化 StockAnalyzer...
|
||||
2025-03-05 14:51:02,453 - INFO - StockAnalyzer 初始化完成
|
||||
2025-03-05 14:51:02,453 - INFO - 分析参数: 开始日期=2024-01-01, 结束日期=2024-12-31
|
||||
2025-03-05 14:51:02,453 - INFO - 止盈=10.0%, 止损=-10.0%, 回调建仓=-5.0%
|
||||
2025-03-05 14:51:02,453 - INFO - 开始分析所有股票...
|
||||
2025-03-05 14:51:02,453 - INFO - 开始获取股票列表...
|
||||
2025-03-05 14:51:02,597 - INFO - 获取到 1 支股票
|
||||
2025-03-05 14:51:02,600 - INFO - 开始分析股票 SZ300750
|
||||
2025-03-05 14:51:02,685 - INFO - 股票 SZ300750 分析完成,总收益: -141823874.93
|
||||
2025-03-05 14:51:02,686 - INFO - 分析完成,共分析 1/1 支股票
|
||||
2025-03-05 14:51:02,686 - INFO - 开始保存 1 支股票的分析结果
|
||||
2025-03-05 14:51:02,687 - ERROR - 程序运行出错: [Errno 13] Permission denied: 'results/SZ300750_analysis.csv'
|
||||
Traceback (most recent call last):
|
||||
File "D:\python_project\gpfx\src\stock_analysis.py", line 254, in main
|
||||
result.to_csv(csv_path, index=False)
|
||||
File "C:\Users\xy\.conda\envs\feapder_project\lib\site-packages\pandas\core\generic.py", line 3902, in to_csv
|
||||
return DataFrameRenderer(formatter).to_csv(
|
||||
File "C:\Users\xy\.conda\envs\feapder_project\lib\site-packages\pandas\io\formats\format.py", line 1152, in to_csv
|
||||
csv_formatter.save()
|
||||
File "C:\Users\xy\.conda\envs\feapder_project\lib\site-packages\pandas\io\formats\csvs.py", line 247, in save
|
||||
with get_handle(
|
||||
File "C:\Users\xy\.conda\envs\feapder_project\lib\site-packages\pandas\io\common.py", line 863, in get_handle
|
||||
handle = open(
|
||||
PermissionError: [Errno 13] Permission denied: 'results/SZ300750_analysis.csv'
|
|
@ -0,0 +1,838 @@
|
|||
import pandas as pd
|
||||
import numpy as np
|
||||
from sqlalchemy import create_engine
|
||||
from datetime import datetime, timedelta
|
||||
from tqdm import tqdm
|
||||
import matplotlib.pyplot as plt
|
||||
import os
|
||||
|
||||
# 添加中文字体支持
|
||||
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
|
||||
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
|
||||
|
||||
class StockAnalyzer:
|
||||
def __init__(self, db_connection_string):
|
||||
"""
|
||||
Initialize the stock analyzer
|
||||
:param db_connection_string: Database connection string
|
||||
"""
|
||||
self.engine = create_engine(db_connection_string)
|
||||
self.initial_capital = 300000 # 30万本金
|
||||
self.total_position = 1000000 # 100万建仓规模
|
||||
self.borrowed_capital = 700000 # 70万借入资金
|
||||
self.annual_interest_rate = 0.05 # 年化5%利息
|
||||
self.daily_interest_rate = self.annual_interest_rate / 365
|
||||
self.commission_rate = 0.05 # 5%手续费
|
||||
self.min_holding_days = 7 # 最少持仓天数
|
||||
|
||||
def get_stock_list(self):
|
||||
"""获取所有股票列表"""
|
||||
query = "SELECT DISTINCT gp_code as symbol FROM gp_code_all where mark1 = '1'"
|
||||
return pd.read_sql(query, self.engine)['symbol'].tolist()
|
||||
|
||||
def get_stock_data(self, symbol, start_date, end_date, include_history=False):
|
||||
"""获取指定股票在时间范围内的数据"""
|
||||
if include_history:
|
||||
# 如果需要历史数据,获取start_date之前240天的数据
|
||||
query = f"""
|
||||
WITH history_data AS (
|
||||
SELECT
|
||||
symbol,
|
||||
timestamp,
|
||||
CAST(close as DECIMAL(10,2)) as close
|
||||
FROM gp_day_data
|
||||
WHERE symbol = '{symbol}'
|
||||
AND timestamp < '{start_date}'
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT 240
|
||||
)
|
||||
SELECT
|
||||
symbol,
|
||||
timestamp,
|
||||
CAST(open as DECIMAL(10,2)) as open,
|
||||
CAST(high as DECIMAL(10,2)) as high,
|
||||
CAST(low as DECIMAL(10,2)) as low,
|
||||
CAST(close as DECIMAL(10,2)) as close,
|
||||
CAST(volume as DECIMAL(20,0)) as volume
|
||||
FROM gp_day_data
|
||||
WHERE symbol = '{symbol}'
|
||||
AND timestamp BETWEEN '{start_date}' AND '{end_date}'
|
||||
UNION ALL
|
||||
SELECT
|
||||
symbol,
|
||||
timestamp,
|
||||
NULL as open,
|
||||
NULL as high,
|
||||
NULL as low,
|
||||
close,
|
||||
NULL as volume
|
||||
FROM history_data
|
||||
ORDER BY timestamp
|
||||
"""
|
||||
else:
|
||||
query = f"""
|
||||
SELECT
|
||||
symbol,
|
||||
timestamp,
|
||||
CAST(open as DECIMAL(10,2)) as open,
|
||||
CAST(high as DECIMAL(10,2)) as high,
|
||||
CAST(low as DECIMAL(10,2)) as low,
|
||||
CAST(close as DECIMAL(10,2)) as close,
|
||||
CAST(volume as DECIMAL(20,0)) as volume
|
||||
FROM gp_day_data
|
||||
WHERE symbol = '{symbol}'
|
||||
AND timestamp BETWEEN '{start_date}' AND '{end_date}'
|
||||
ORDER BY timestamp
|
||||
"""
|
||||
df = pd.read_sql(query, self.engine)
|
||||
|
||||
# 确保数值列的类型正确
|
||||
numeric_columns = ['open', 'high', 'low', 'close', 'volume']
|
||||
for col in numeric_columns:
|
||||
if col in df.columns: # 只处理存在的列
|
||||
df[col] = pd.to_numeric(df[col], errors='coerce')
|
||||
|
||||
# 删除任何包含 NaN 的行,但只考虑分析期间需要的列
|
||||
if include_history:
|
||||
# 历史数据只需要close列不为空
|
||||
historical_mask = (df['timestamp'] < start_date) & df['close'].notna()
|
||||
analysis_mask = (df['timestamp'] >= start_date) & df[['open', 'high', 'low', 'close', 'volume']].notna().all(axis=1)
|
||||
df = df[historical_mask | analysis_mask]
|
||||
else:
|
||||
df = df.dropna()
|
||||
|
||||
return df
|
||||
|
||||
def calculate_trade_signals(self, df, take_profit_pct, stop_loss_pct, pullback_entry_pct, start_date):
|
||||
"""计算交易信号和收益"""
|
||||
# 检查历史数据是否足够
|
||||
historical_data = df[df['timestamp'] < start_date]
|
||||
if len(historical_data) < 240:
|
||||
print(f"历史数据不足240天,跳过分析")
|
||||
return pd.DataFrame()
|
||||
|
||||
# 计算240日均线基准价格(使用历史数据)
|
||||
ma240_base_price = historical_data['close'].tail(240).mean()
|
||||
print(f"240日均线基准价格: {ma240_base_price:.2f}")
|
||||
|
||||
# 只使用分析期间的数据进行交易信号计算
|
||||
analysis_df = df[df['timestamp'] >= start_date].copy()
|
||||
if len(analysis_df) < 10: # 确保分析期间有足够的数据
|
||||
print(f"分析期间数据不足10天,跳过分析")
|
||||
return pd.DataFrame()
|
||||
|
||||
results = []
|
||||
positions = [] # 记录所有持仓,每个元素是一个字典,包含入场价格和日期
|
||||
max_positions = 5 # 最大建仓次数
|
||||
cumulative_profit = 0 # 总累计收益
|
||||
trades_count = 0
|
||||
max_holding_period = timedelta(days=180) # 最长持仓6个月
|
||||
max_loss_amount = -300000 # 最大亏损金额为30万
|
||||
|
||||
# 添加统计变量
|
||||
total_holding_days = 0 # 总持仓天数
|
||||
max_capital_usage = 0 # 最大资金占用
|
||||
total_trades = 0 # 总交易次数
|
||||
profitable_trades = 0 # 盈利交易次数
|
||||
loss_trades = 0 # 亏损交易次数
|
||||
|
||||
print(f"\n{'='*50}")
|
||||
print(f"开始分析股票: {df.iloc[0]['symbol']}")
|
||||
print(f"{'='*50}")
|
||||
|
||||
# 记录前一天的收盘价
|
||||
prev_close = None
|
||||
|
||||
for index, row in analysis_df.iterrows():
|
||||
current_price = (float(row['high']) + float(row['low'])) / 2
|
||||
day_result = {
|
||||
'timestamp': row['timestamp'],
|
||||
'profit': cumulative_profit, # 记录当前的累计收益
|
||||
'position': False,
|
||||
'action': 'hold'
|
||||
}
|
||||
|
||||
# 更新所有持仓的收益
|
||||
positions_to_remove = []
|
||||
|
||||
for pos in positions:
|
||||
pos_days_held = (row['timestamp'] - pos['entry_date']).days
|
||||
pos_size = self.total_position / pos['entry_price']
|
||||
|
||||
# 检查是否需要平仓
|
||||
should_close = False
|
||||
close_type = None
|
||||
close_price = current_price
|
||||
|
||||
if pos_days_held >= self.min_holding_days:
|
||||
# 检查止盈
|
||||
if float(row['high']) >= pos['entry_price'] * (1 + take_profit_pct):
|
||||
should_close = True
|
||||
close_type = 'sell_profit'
|
||||
close_price = pos['entry_price'] * (1 + take_profit_pct)
|
||||
# 检查最大亏损
|
||||
elif (close_price - pos['entry_price']) * pos_size <= max_loss_amount:
|
||||
should_close = True
|
||||
close_type = 'sell_loss'
|
||||
# 检查持仓时间
|
||||
elif (row['timestamp'] - pos['entry_date']) >= max_holding_period:
|
||||
should_close = True
|
||||
close_type = 'time_limit'
|
||||
|
||||
if should_close:
|
||||
profit = (close_price - pos['entry_price']) * pos_size
|
||||
commission = profit * self.commission_rate if profit > 0 else 0
|
||||
interest_cost = self.borrowed_capital * self.daily_interest_rate * pos_days_held
|
||||
net_profit = profit - commission - interest_cost
|
||||
|
||||
# 更新统计数据
|
||||
total_holding_days += pos_days_held
|
||||
total_trades += 1
|
||||
if net_profit > 0:
|
||||
profitable_trades += 1
|
||||
else:
|
||||
loss_trades += 1
|
||||
|
||||
cumulative_profit += net_profit
|
||||
positions_to_remove.append(pos)
|
||||
day_result['action'] = close_type
|
||||
day_result['profit'] = cumulative_profit
|
||||
|
||||
print(f"\n>>> {'止盈平仓' if close_type == 'sell_profit' else '止损平仓' if close_type == 'sell_loss' else '到期平仓'}")
|
||||
print(f"持仓天数: {pos_days_held}")
|
||||
print(f"持仓数量: {pos_size:.0f}股")
|
||||
print(f"平仓价格: {close_price:.2f}")
|
||||
print(f"{'盈利' if profit > 0 else '亏损'}: {profit:,.2f}")
|
||||
print(f"手续费: {commission:,.2f}")
|
||||
print(f"利息成本: {interest_cost:,.2f}")
|
||||
print(f"净{'盈利' if net_profit > 0 else '亏损'}: {net_profit:,.2f}")
|
||||
|
||||
# 移除已平仓的持仓
|
||||
for pos in positions_to_remove:
|
||||
positions.remove(pos)
|
||||
|
||||
# 检查是否可以建仓
|
||||
if len(positions) < max_positions and prev_close is not None:
|
||||
# 计算当日跌幅
|
||||
daily_drop = (prev_close - float(row['low'])) / prev_close
|
||||
|
||||
# 检查价格是否在均线区间内
|
||||
price_in_range = (
|
||||
current_price >= ma240_base_price * 0.7 and
|
||||
current_price <= ma240_base_price * 1.3
|
||||
)
|
||||
|
||||
# 如果跌幅超过5%且价格在均线区间内
|
||||
if daily_drop >= 0.05 and price_in_range:
|
||||
positions.append({
|
||||
'entry_price': current_price,
|
||||
'entry_date': row['timestamp']
|
||||
})
|
||||
trades_count += 1
|
||||
print(f"\n>>> 建仓信号 #{trades_count}")
|
||||
print(f"日期: {row['timestamp'].strftime('%Y-%m-%d')}")
|
||||
print(f"建仓价格: {current_price:.2f}")
|
||||
print(f"建仓数量: {self.total_position/current_price:.0f}股")
|
||||
print(f"当日跌幅: {daily_drop*100:.2f}%")
|
||||
print(f"距离均线: {((current_price/ma240_base_price)-1)*100:.2f}%")
|
||||
|
||||
# 更新前一天收盘价
|
||||
prev_close = float(row['close'])
|
||||
|
||||
# 更新日结果
|
||||
day_result['position'] = len(positions) > 0
|
||||
results.append(day_result)
|
||||
|
||||
# 计算当前资金占用
|
||||
current_capital_usage = sum(self.total_position for pos in positions)
|
||||
max_capital_usage = max(max_capital_usage, current_capital_usage)
|
||||
|
||||
# 在最后一天强制平仓所有持仓
|
||||
if positions:
|
||||
final_price = (float(analysis_df.iloc[-1]['high']) + float(analysis_df.iloc[-1]['low'])) / 2
|
||||
final_total_profit = 0
|
||||
|
||||
for pos in positions:
|
||||
position_size = self.total_position / pos['entry_price']
|
||||
days_held = (analysis_df.iloc[-1]['timestamp'] - pos['entry_date']).days
|
||||
final_profit = (final_price - pos['entry_price']) * position_size
|
||||
commission = final_profit * self.commission_rate if final_profit > 0 else 0
|
||||
interest_cost = self.borrowed_capital * self.daily_interest_rate * days_held
|
||||
net_profit = final_profit - commission - interest_cost
|
||||
|
||||
# 更新统计数据
|
||||
total_holding_days += days_held
|
||||
total_trades += 1
|
||||
if net_profit > 0:
|
||||
profitable_trades += 1
|
||||
else:
|
||||
loss_trades += 1
|
||||
|
||||
final_total_profit += net_profit
|
||||
|
||||
print(f"\n>>> 到期强制平仓")
|
||||
print(f"持仓天数: {days_held}")
|
||||
print(f"持仓数量: {position_size:.0f}股")
|
||||
print(f"平仓价格: {final_price:.2f}")
|
||||
print(f"毛利润: {final_profit:,.2f}")
|
||||
print(f"手续费: {commission:,.2f}")
|
||||
print(f"利息成本: {interest_cost:,.2f}")
|
||||
print(f"净利润: {net_profit:,.2f}")
|
||||
|
||||
results[-1]['action'] = 'final_sell'
|
||||
cumulative_profit += final_total_profit # 更新最终的累计收益
|
||||
results[-1]['profit'] = cumulative_profit # 更新最后一天的累计收益
|
||||
|
||||
# 计算统计数据
|
||||
avg_holding_days = total_holding_days / total_trades if total_trades > 0 else 0
|
||||
win_rate = profitable_trades / total_trades * 100 if total_trades > 0 else 0
|
||||
|
||||
print(f"\n{'='*50}")
|
||||
print(f"交易统计")
|
||||
print(f"总交易次数: {trades_count}")
|
||||
print(f"累计收益: {cumulative_profit:,.2f}")
|
||||
print(f"最大资金占用: {max_capital_usage:,.2f}")
|
||||
print(f"平均持仓天数: {avg_holding_days:.1f}")
|
||||
print(f"胜率: {win_rate:.1f}%")
|
||||
print(f"盈利交易: {profitable_trades}次")
|
||||
print(f"亏损交易: {loss_trades}次")
|
||||
print(f"{'='*50}\n")
|
||||
|
||||
# 将统计数据添加到结果中
|
||||
results[-1]['stats'] = {
|
||||
'total_trades': total_trades,
|
||||
'profitable_trades': profitable_trades,
|
||||
'loss_trades': loss_trades,
|
||||
'win_rate': win_rate,
|
||||
'avg_holding_days': avg_holding_days,
|
||||
'max_capital_usage': max_capital_usage,
|
||||
'final_profit': cumulative_profit
|
||||
}
|
||||
|
||||
return pd.DataFrame(results)
|
||||
|
||||
def analyze_stock(self, symbol, start_date, end_date, take_profit_pct, stop_loss_pct, pullback_entry_pct):
|
||||
"""分析单个股票"""
|
||||
df = self.get_stock_data(symbol, start_date, end_date, include_history=True)
|
||||
|
||||
if len(df) < 240: # 确保总数据量足够
|
||||
print(f"股票 {symbol} 总数据不足240天,跳过分析")
|
||||
return None
|
||||
|
||||
return self.calculate_trade_signals(
|
||||
df,
|
||||
take_profit_pct=take_profit_pct,
|
||||
stop_loss_pct=stop_loss_pct,
|
||||
pullback_entry_pct=pullback_entry_pct,
|
||||
start_date=start_date
|
||||
)
|
||||
|
||||
def analyze_all_stocks(self, start_date, end_date, take_profit_pct, stop_loss_pct, pullback_entry_pct):
|
||||
"""分析所有股票"""
|
||||
stocks = self.get_stock_list()
|
||||
all_results = {}
|
||||
|
||||
print(f"\n开始分析,共 {len(stocks)} 支股票")
|
||||
print(f"分析参数:")
|
||||
print(f"- 开始日期: {start_date}")
|
||||
print(f"- 结束日期: {end_date}")
|
||||
print(f"- 止盈: {take_profit_pct*100}%")
|
||||
print(f"- 止损: {stop_loss_pct*100}%")
|
||||
print(f"- 回调建仓: {pullback_entry_pct*100}%\n")
|
||||
|
||||
for symbol in tqdm(stocks, desc="Analyzing stocks"):
|
||||
result = self.analyze_stock(
|
||||
symbol,
|
||||
start_date,
|
||||
end_date,
|
||||
take_profit_pct,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
if result is not None:
|
||||
all_results[symbol] = result
|
||||
|
||||
return all_results
|
||||
|
||||
def plot_results(self, results, symbol):
|
||||
"""绘制单个股票的收益走势图"""
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(results['timestamp'], results['profit'].cumsum(), label='Cumulative Profit')
|
||||
plt.title(f'Stock {symbol} Trading Results')
|
||||
plt.xlabel('Date')
|
||||
plt.ylabel('Profit (CNY)')
|
||||
plt.legend()
|
||||
plt.grid(True)
|
||||
plt.xticks(rotation=45)
|
||||
plt.tight_layout()
|
||||
return plt
|
||||
|
||||
def plot_all_stocks(self, all_results):
|
||||
"""绘制所有股票的收益走势图"""
|
||||
plt.figure(figsize=(15, 8))
|
||||
|
||||
# 记录所有股票的累计收益
|
||||
total_profits = {}
|
||||
max_profit = float('-inf')
|
||||
min_profit = float('inf')
|
||||
|
||||
# 绘制每支股票的曲线
|
||||
for symbol, results in all_results.items():
|
||||
# 直接使用已经计算好的累计收益
|
||||
profits = results['profit']
|
||||
plt.plot(results['timestamp'], profits, label=symbol, alpha=0.5, linewidth=1)
|
||||
|
||||
# 更新最大最小收益
|
||||
max_profit = max(max_profit, profits.max())
|
||||
min_profit = min(min_profit, profits.min())
|
||||
|
||||
# 记录总收益(使用最后一个累计收益值)
|
||||
total_profits[symbol] = profits.iloc[-1]
|
||||
|
||||
# 计算所有股票的中位数收益曲线
|
||||
# 首先找到共同的日期范围
|
||||
all_dates = set()
|
||||
for results in all_results.values():
|
||||
all_dates.update(results['timestamp'])
|
||||
all_dates = sorted(list(all_dates))
|
||||
|
||||
# 创建一个包含所有日期的DataFrame
|
||||
profits_df = pd.DataFrame(index=all_dates)
|
||||
|
||||
# 对每支股票,填充所有日期的收益
|
||||
for symbol, results in all_results.items():
|
||||
daily_profits = pd.Series(index=all_dates, data=np.nan)
|
||||
# 直接使用已经计算好的累计收益
|
||||
for date, profit in zip(results['timestamp'], results['profit']):
|
||||
daily_profits[date] = profit
|
||||
# 对于没有交易的日期,使用最后一个累计收益填充
|
||||
daily_profits.fillna(method='ffill', inplace=True)
|
||||
daily_profits.fillna(0, inplace=True) # 对开始之前的日期填充0
|
||||
profits_df[symbol] = daily_profits
|
||||
|
||||
# 计算并绘制中位数收益曲线
|
||||
median_line = profits_df.median(axis=1)
|
||||
plt.plot(all_dates, median_line, 'r-', label='Median', linewidth=2)
|
||||
|
||||
plt.title('All Stocks Trading Results')
|
||||
plt.xlabel('Date')
|
||||
plt.ylabel('Profit (CNY)')
|
||||
plt.grid(True)
|
||||
plt.xticks(rotation=45)
|
||||
|
||||
# 添加利润区间标注
|
||||
plt.text(0.02, 0.98,
|
||||
f'Profit Range:\nMax: {max_profit:,.0f}\nMin: {min_profit:,.0f}\nMedian: {median_line.iloc[-1]:,.0f}',
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8))
|
||||
|
||||
# 计算所有股票的统计数据
|
||||
total_stats = {
|
||||
'total_trades': 0,
|
||||
'profitable_trades': 0,
|
||||
'loss_trades': 0,
|
||||
'total_holding_days': 0,
|
||||
'max_capital_usage': 0,
|
||||
'total_profit': 0,
|
||||
'profitable_stocks': 0,
|
||||
'loss_stocks': 0,
|
||||
'total_capital_usage': 0, # 添加总资金占用
|
||||
'total_win_rate': 0, # 添加总胜率
|
||||
}
|
||||
|
||||
# 获取前5名和后5名股票
|
||||
top_5 = sorted(total_profits.items(), key=lambda x: x[1], reverse=True)[:5]
|
||||
bottom_5 = sorted(total_profits.items(), key=lambda x: x[1])[:5]
|
||||
|
||||
# 添加排名信息
|
||||
rank_text = "Top 5 Stocks:\n"
|
||||
for symbol, profit in top_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
rank_text += "\nBottom 5 Stocks:\n"
|
||||
for symbol, profit in bottom_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
|
||||
plt.text(1.02, 0.98, rank_text, transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8), verticalalignment='top')
|
||||
|
||||
# 记录每支股票的统计数据用于计算平均值
|
||||
stock_stats = []
|
||||
|
||||
for symbol, results in all_results.items():
|
||||
if 'stats' in results.iloc[-1]:
|
||||
stats = results.iloc[-1]['stats']
|
||||
stock_stats.append(stats) # 记录每支股票的统计数据
|
||||
|
||||
total_stats['total_trades'] += stats['total_trades']
|
||||
total_stats['profitable_trades'] += stats['profitable_trades']
|
||||
total_stats['loss_trades'] += stats['loss_trades']
|
||||
total_stats['total_holding_days'] += stats['avg_holding_days'] * stats['total_trades']
|
||||
total_stats['max_capital_usage'] = max(total_stats['max_capital_usage'], stats['max_capital_usage'])
|
||||
total_stats['total_capital_usage'] += stats['max_capital_usage']
|
||||
total_stats['total_profit'] += stats['final_profit']
|
||||
total_stats['total_win_rate'] += stats['win_rate']
|
||||
if stats['final_profit'] > 0:
|
||||
total_stats['profitable_stocks'] += 1
|
||||
else:
|
||||
total_stats['loss_stocks'] += 1
|
||||
|
||||
# 计算总体统计
|
||||
total_stocks = total_stats['profitable_stocks'] + total_stats['loss_stocks']
|
||||
avg_holding_days = total_stats['total_holding_days'] / total_stats['total_trades'] if total_stats['total_trades'] > 0 else 0
|
||||
win_rate = total_stats['profitable_trades'] / total_stats['total_trades'] * 100 if total_stats['total_trades'] > 0 else 0
|
||||
stock_win_rate = total_stats['profitable_stocks'] / total_stocks * 100 if total_stocks > 0 else 0
|
||||
|
||||
# 计算平均值统计
|
||||
avg_trades_per_stock = total_stats['total_trades'] / total_stocks if total_stocks > 0 else 0
|
||||
avg_profit_per_stock = total_stats['total_profit'] / total_stocks if total_stocks > 0 else 0
|
||||
avg_capital_usage = total_stats['total_capital_usage'] / total_stocks if total_stocks > 0 else 0
|
||||
avg_win_rate = total_stats['total_win_rate'] / total_stocks if total_stocks > 0 else 0
|
||||
|
||||
# 添加总体统计信息
|
||||
stats_text = (
|
||||
f"总体统计:\n"
|
||||
f"总交易次数: {total_stats['total_trades']}\n"
|
||||
f"总盈利: {total_stats['total_profit']:,.0f}\n"
|
||||
# f"最大资金占用: {total_stats['max_capital_usage']:,.0f}\n"
|
||||
f"平均持仓天数: {avg_holding_days:.1f}\n"
|
||||
f"交易胜率: {win_rate:.1f}%\n"
|
||||
f"股票胜率: {stock_win_rate:.1f}%\n"
|
||||
f"盈利股票数: {total_stats['profitable_stocks']}\n"
|
||||
f"亏损股票数: {total_stats['loss_stocks']}\n"
|
||||
f"\n平均值统计:\n"
|
||||
f"平均交易次数: {avg_trades_per_stock:.1f}\n"
|
||||
f"平均收益: {avg_profit_per_stock:,.0f}\n"
|
||||
f"平均资金占用: {avg_capital_usage:,.0f}\n"
|
||||
f"平均持仓天数: {avg_holding_days:.1f}\n"
|
||||
f"平均胜率: {avg_win_rate:.1f}%"
|
||||
)
|
||||
|
||||
plt.text(0.02, 0.6, stats_text,
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8, edgecolor='gray'),
|
||||
verticalalignment='top',
|
||||
fontsize=10)
|
||||
|
||||
# 获取前5名和后5名股票
|
||||
top_5 = sorted(total_profits.items(), key=lambda x: x[1], reverse=True)[:5]
|
||||
bottom_5 = sorted(total_profits.items(), key=lambda x: x[1])[:5]
|
||||
|
||||
# 添加排名信息
|
||||
rank_text = "Top 5 Stocks:\n"
|
||||
for symbol, profit in top_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
rank_text += "\nBottom 5 Stocks:\n"
|
||||
for symbol, profit in bottom_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
|
||||
plt.text(1.02, 0.98, rank_text, transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8), verticalalignment='top')
|
||||
|
||||
plt.tight_layout()
|
||||
return plt, total_profits
|
||||
|
||||
def plot_profit_distribution(self, total_profits):
|
||||
"""绘制所有股票的收益分布小提琴图"""
|
||||
plt.figure(figsize=(12, 8))
|
||||
|
||||
# 将收益数据转换为数组,确保使用最终累计收益
|
||||
profits = np.array([profit for profit in total_profits.values()])
|
||||
|
||||
# 计算统计数据
|
||||
mean_profit = np.mean(profits)
|
||||
median_profit = np.median(profits)
|
||||
max_profit = np.max(profits)
|
||||
min_profit = np.min(profits)
|
||||
std_profit = np.std(profits)
|
||||
|
||||
# 绘制小提琴图
|
||||
violin_parts = plt.violinplot(profits, positions=[0], showmeans=True, showmedians=True)
|
||||
|
||||
# 设置小提琴图的颜色
|
||||
violin_parts['bodies'][0].set_facecolor('lightblue')
|
||||
violin_parts['bodies'][0].set_alpha(0.7)
|
||||
violin_parts['cmeans'].set_color('red')
|
||||
violin_parts['cmedians'].set_color('blue')
|
||||
|
||||
# 添加统计信息
|
||||
stats_text = (
|
||||
f"统计信息:\n"
|
||||
f"平均收益: {mean_profit:,.0f}\n"
|
||||
f"中位数收益: {median_profit:,.0f}\n"
|
||||
f"最大收益: {max_profit:,.0f}\n"
|
||||
f"最小收益: {min_profit:,.0f}\n"
|
||||
f"标准差: {std_profit:,.0f}"
|
||||
)
|
||||
|
||||
plt.text(0.65, 0.95, stats_text,
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8, edgecolor='gray'),
|
||||
verticalalignment='top',
|
||||
fontsize=10)
|
||||
|
||||
# 设置图表样式
|
||||
plt.title('股票收益分布图', fontsize=14, pad=20)
|
||||
plt.ylabel('收益 (元)', fontsize=12)
|
||||
plt.xticks([0], ['所有股票'], fontsize=10)
|
||||
plt.grid(True, axis='y', alpha=0.3)
|
||||
|
||||
# 添加零线
|
||||
plt.axhline(y=0, color='r', linestyle='--', alpha=0.3)
|
||||
|
||||
# 计算盈利和亏损的股票数量
|
||||
profit_count = np.sum(profits > 0)
|
||||
loss_count = np.sum(profits < 0)
|
||||
total_count = len(profits)
|
||||
|
||||
# 添加盈亏比例信息
|
||||
ratio_text = (
|
||||
f"盈亏比例:\n"
|
||||
f"盈利: {profit_count}支 ({profit_count/total_count*100:.1f}%)\n"
|
||||
f"亏损: {loss_count}支 ({loss_count/total_count*100:.1f}%)\n"
|
||||
f"总计: {total_count}支"
|
||||
)
|
||||
|
||||
plt.text(0.65, 0.6, ratio_text,
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8, edgecolor='gray'),
|
||||
verticalalignment='top',
|
||||
fontsize=10)
|
||||
|
||||
plt.tight_layout()
|
||||
return plt
|
||||
|
||||
def plot_profit_matrix(self, df):
|
||||
"""绘制止盈比例分析矩阵的结果图"""
|
||||
plt.figure(figsize=(15, 10))
|
||||
|
||||
# 创建子图
|
||||
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 10))
|
||||
|
||||
# 1. 平均收益曲线
|
||||
ax1.plot(df.index, df['avg_profit'], 'b-', linewidth=2)
|
||||
ax1.set_title('平均收益 vs 止盈比例')
|
||||
ax1.set_xlabel('止盈比例 (%)')
|
||||
ax1.set_ylabel('平均收益 (元)')
|
||||
ax1.grid(True)
|
||||
|
||||
# 标记最优止盈比例点
|
||||
best_profit_pct = df['avg_profit'].idxmax()
|
||||
best_profit = df['avg_profit'].max()
|
||||
ax1.plot(best_profit_pct, best_profit, 'ro')
|
||||
ax1.annotate(f'最优: {best_profit_pct:.1f}%\n{best_profit:,.0f}元',
|
||||
(best_profit_pct, best_profit),
|
||||
xytext=(10, 10), textcoords='offset points')
|
||||
|
||||
# 2. 平均胜率曲线
|
||||
ax2.plot(df.index, df['avg_win_rate'], 'g-', linewidth=2)
|
||||
ax2.set_title('平均胜率 vs 止盈比例')
|
||||
ax2.set_xlabel('止盈比例 (%)')
|
||||
ax2.set_ylabel('胜率 (%)')
|
||||
ax2.grid(True)
|
||||
|
||||
# 3. 平均持仓天数曲线
|
||||
ax3.plot(df.index, df['avg_holding_days'], 'r-', linewidth=2)
|
||||
ax3.set_title('平均持仓天数 vs 止盈比例')
|
||||
ax3.set_xlabel('止盈比例 (%)')
|
||||
ax3.set_ylabel('持仓天数')
|
||||
ax3.grid(True)
|
||||
|
||||
# 4. 平均交易次数和资金占用
|
||||
ax4.plot(df.index, df['avg_trades'], 'c-', linewidth=2, label='平均交易次数')
|
||||
ax4_twin = ax4.twinx()
|
||||
ax4_twin.plot(df.index, df['avg_capital_usage'], 'm-', linewidth=2, label='平均资金占用')
|
||||
ax4.set_title('平均交易次数和资金占用 vs 止盈比例')
|
||||
ax4.set_xlabel('止盈比例 (%)')
|
||||
ax4.set_ylabel('交易次数')
|
||||
ax4_twin.set_ylabel('资金占用 (元)')
|
||||
|
||||
# 合并两个y轴的图例
|
||||
lines1, labels1 = ax4.get_legend_handles_labels()
|
||||
lines2, labels2 = ax4_twin.get_legend_handles_labels()
|
||||
ax4_twin.legend(lines1 + lines2, labels1 + labels2, loc='upper right')
|
||||
ax4.grid(True)
|
||||
|
||||
# 调整布局
|
||||
plt.tight_layout()
|
||||
return plt
|
||||
|
||||
def analyze_profit_matrix(self, start_date, end_date, stop_loss_pct, pullback_entry_pct):
|
||||
"""分析不同止盈比例的表现矩阵"""
|
||||
# 创建结果列表
|
||||
matrix_results = []
|
||||
|
||||
# 从30%到5%,每次减少1%
|
||||
for take_profit_pct in np.arange(0.30, 0.04, -0.01):
|
||||
print(f"\n分析止盈比例: {take_profit_pct*100:.1f}%")
|
||||
|
||||
# 运行分析
|
||||
results = self.analyze_all_stocks(
|
||||
start_date,
|
||||
end_date,
|
||||
take_profit_pct,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
|
||||
# 过滤掉空结果
|
||||
valid_results = {symbol: result for symbol, result in results.items() if result is not None and not result.empty}
|
||||
|
||||
if valid_results:
|
||||
# 计算统计数据
|
||||
total_stats = {
|
||||
'total_trades': 0,
|
||||
'profitable_trades': 0,
|
||||
'loss_trades': 0,
|
||||
'total_holding_days': 0,
|
||||
'total_profit': 0,
|
||||
'total_capital_usage': 0,
|
||||
'total_win_rate': 0,
|
||||
'stock_count': len(valid_results)
|
||||
}
|
||||
|
||||
# 收集每支股票的统计数据
|
||||
for symbol, result in valid_results.items():
|
||||
if 'stats' in result.iloc[-1]:
|
||||
stats = result.iloc[-1]['stats']
|
||||
total_stats['total_trades'] += stats['total_trades']
|
||||
total_stats['profitable_trades'] += stats['profitable_trades']
|
||||
total_stats['loss_trades'] += stats['loss_trades']
|
||||
total_stats['total_holding_days'] += stats['avg_holding_days'] * stats['total_trades']
|
||||
total_stats['total_profit'] += stats['final_profit']
|
||||
total_stats['total_capital_usage'] += stats['max_capital_usage']
|
||||
total_stats['total_win_rate'] += stats['win_rate']
|
||||
|
||||
# 计算平均值
|
||||
avg_trades = total_stats['total_trades'] / total_stats['stock_count']
|
||||
avg_holding_days = total_stats['total_holding_days'] / total_stats['total_trades'] if total_stats['total_trades'] > 0 else 0
|
||||
avg_profit = total_stats['total_profit'] / total_stats['stock_count']
|
||||
avg_capital_usage = total_stats['total_capital_usage'] / total_stats['stock_count']
|
||||
avg_win_rate = total_stats['total_win_rate'] / total_stats['stock_count']
|
||||
|
||||
# 添加到结果矩阵
|
||||
matrix_results.append({
|
||||
'take_profit_pct': take_profit_pct * 100,
|
||||
'avg_trades': avg_trades,
|
||||
'avg_holding_days': avg_holding_days,
|
||||
'avg_profit': avg_profit,
|
||||
'avg_capital_usage': avg_capital_usage,
|
||||
'avg_win_rate': avg_win_rate,
|
||||
'total_trades': total_stats['total_trades'],
|
||||
'stock_count': total_stats['stock_count']
|
||||
})
|
||||
|
||||
# 创建DataFrame并格式化
|
||||
df = pd.DataFrame(matrix_results)
|
||||
df = df.round({
|
||||
'take_profit_pct': 1,
|
||||
'avg_trades': 1,
|
||||
'avg_holding_days': 1,
|
||||
'avg_profit': 0,
|
||||
'avg_capital_usage': 0,
|
||||
'avg_win_rate': 1,
|
||||
'total_trades': 0,
|
||||
'stock_count': 0
|
||||
})
|
||||
|
||||
# 设置止盈比例为索引
|
||||
df.set_index('take_profit_pct', inplace=True)
|
||||
|
||||
# 保存到CSV文件
|
||||
df.to_csv('results/profit_matrix_analysis.csv')
|
||||
|
||||
# 打印结果
|
||||
print("\n止盈比例分析矩阵:")
|
||||
print("=" * 120)
|
||||
print(df.to_string())
|
||||
print("=" * 120)
|
||||
|
||||
# 绘制并保存矩阵分析图表
|
||||
plt = self.plot_profit_matrix(df)
|
||||
plt.savefig('results/profit_matrix_analysis.png', bbox_inches='tight', dpi=300)
|
||||
plt.close()
|
||||
|
||||
return df
|
||||
|
||||
def main():
|
||||
# 数据库连接配置
|
||||
db_config = {
|
||||
'host': '192.168.1.82',
|
||||
'port': 3306,
|
||||
'user': 'root',
|
||||
'password': 'Chlry$%.8',
|
||||
'database': 'db_gp_cj'
|
||||
}
|
||||
|
||||
try:
|
||||
connection_string = f"mysql+pymysql://{db_config['user']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database']}"
|
||||
|
||||
# 创建results目录
|
||||
if not os.path.exists('results'):
|
||||
os.makedirs('results')
|
||||
|
||||
# 创建分析器实例
|
||||
analyzer = StockAnalyzer(connection_string)
|
||||
|
||||
# 设置分析参数
|
||||
start_date = '2024-01-01'
|
||||
end_date = '2024-12-31'
|
||||
take_profit_pct = 0.25 # 30%止盈
|
||||
stop_loss_pct = -0.99 # -99%止损
|
||||
pullback_entry_pct = -0.05 # -5%回调建仓
|
||||
|
||||
# 控制是否运行止盈比例分析的标志
|
||||
run_profit_matrix = False # 设置为 True 时运行止盈比例分析
|
||||
|
||||
if run_profit_matrix:
|
||||
# 运行止盈比例分析
|
||||
profit_matrix = analyzer.analyze_profit_matrix(
|
||||
start_date,
|
||||
end_date,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
# 使用最优止盈比例
|
||||
take_profit_pct = profit_matrix['avg_profit'].idxmax() / 100
|
||||
print(f"\n使用最优止盈比例 {take_profit_pct*100:.1f}% 运行详细分析")
|
||||
|
||||
# 运行分析
|
||||
results = analyzer.analyze_all_stocks(
|
||||
start_date,
|
||||
end_date,
|
||||
take_profit_pct,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
|
||||
# 保存结果
|
||||
for symbol, result in results.items():
|
||||
if result is not None and not result.empty:
|
||||
result.to_csv(f'results/{symbol}_analysis.csv', index=False)
|
||||
plt = analyzer.plot_results(result, symbol)
|
||||
plt.savefig(f'results/{symbol}_chart.png')
|
||||
plt.close()
|
||||
else:
|
||||
print(f"跳过空结果: {symbol}")
|
||||
|
||||
# 过滤掉空结果
|
||||
valid_results = {symbol: result for symbol, result in results.items() if result is not None and not result.empty}
|
||||
|
||||
if valid_results:
|
||||
# 绘制所有股票的收益曲线
|
||||
plt, total_profits = analyzer.plot_all_stocks(valid_results)
|
||||
plt.savefig('results/all_stocks_analysis.png', bbox_inches='tight', dpi=300)
|
||||
plt.close()
|
||||
|
||||
# 绘制收益分布小提琴图
|
||||
plt = analyzer.plot_profit_distribution(total_profits)
|
||||
plt.savefig('results/profit_distribution.png', bbox_inches='tight', dpi=300)
|
||||
plt.close()
|
||||
else:
|
||||
print("没有有效的分析结果可供绘图")
|
||||
|
||||
except Exception as e:
|
||||
print(f"程序运行出错: {str(e)}")
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,444 @@
|
|||
import pandas as pd
|
||||
import numpy as np
|
||||
from sqlalchemy import create_engine
|
||||
from datetime import datetime, timedelta
|
||||
from tqdm import tqdm
|
||||
import matplotlib.pyplot as plt
|
||||
import os
|
||||
# 止盈10%,不止损,较上一次止盈或者止损价回调5%之后建仓
|
||||
# 添加中文字体支持
|
||||
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
|
||||
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
|
||||
|
||||
class StockAnalyzer:
|
||||
def __init__(self, db_connection_string):
|
||||
"""
|
||||
Initialize the stock analyzer
|
||||
:param db_connection_string: Database connection string
|
||||
"""
|
||||
self.engine = create_engine(db_connection_string)
|
||||
self.initial_capital = 300000 # 30万本金
|
||||
self.total_position = 1000000 # 100万建仓规模
|
||||
self.borrowed_capital = 700000 # 70万借入资金
|
||||
self.annual_interest_rate = 0.05 # 年化5%利息
|
||||
self.daily_interest_rate = self.annual_interest_rate / 365
|
||||
self.commission_rate = 0.05 # 5%手续费
|
||||
self.min_holding_days = 7 # 最少持仓天数
|
||||
|
||||
def get_stock_list(self):
|
||||
"""获取所有股票列表"""
|
||||
query = "SELECT DISTINCT gp_code as symbol FROM gp_code_all"
|
||||
return pd.read_sql(query, self.engine)['symbol'].tolist()
|
||||
|
||||
def get_stock_data(self, symbol, start_date, end_date):
|
||||
"""获取指定股票在时间范围内的数据"""
|
||||
query = f"""
|
||||
SELECT * FROM gp_day_data
|
||||
WHERE symbol = '{symbol}'
|
||||
AND timestamp BETWEEN '{start_date}' AND '{end_date}'
|
||||
ORDER BY timestamp
|
||||
"""
|
||||
return pd.read_sql(query, self.engine)
|
||||
|
||||
def calculate_trade_signals(self, df, take_profit_pct, stop_loss_pct, pullback_entry_pct):
|
||||
"""计算交易信号和收益"""
|
||||
results = []
|
||||
position = False
|
||||
entry_price = 0
|
||||
entry_date = None
|
||||
last_exit_price = None
|
||||
cumulative_profit = 0
|
||||
trades_count = 0
|
||||
max_holding_period = timedelta(days=180) # 最长持仓6个月
|
||||
max_loss_amount = -300000 # 最大亏损金额为30万
|
||||
|
||||
print(f"\n{'='*50}")
|
||||
print(f"开始分析股票: {df.iloc[0]['symbol']}")
|
||||
print(f"{'='*50}")
|
||||
|
||||
for index, row in df.iterrows():
|
||||
current_price = (float(row['high']) + float(row['low'])) / 2
|
||||
day_result = {
|
||||
'date': row['timestamp'],
|
||||
'profit': 0,
|
||||
'position': False,
|
||||
'action': 'hold'
|
||||
}
|
||||
|
||||
if not position:
|
||||
# 检查是否可以建仓
|
||||
if last_exit_price is None or (
|
||||
(current_price - last_exit_price) / last_exit_price <= pullback_entry_pct
|
||||
):
|
||||
position = True
|
||||
entry_price = current_price
|
||||
entry_date = row['timestamp']
|
||||
day_result['action'] = 'buy'
|
||||
day_result['position'] = True
|
||||
trades_count += 1
|
||||
print(f"\n>>> 建仓信号 #{trades_count}")
|
||||
print(f"日期: {entry_date.strftime('%Y-%m-%d')}")
|
||||
print(f"建仓价格: {entry_price:.2f}")
|
||||
print(f"建仓数量: {self.total_position/entry_price:.0f}股")
|
||||
if last_exit_price is not None:
|
||||
print(f"距离上次平仓价格变化: {((current_price - last_exit_price) / last_exit_price * 100):.2f}%")
|
||||
else:
|
||||
# 计算当前持仓收益
|
||||
current_profit = (current_price - entry_price) / entry_price
|
||||
days_held = (row['timestamp'] - entry_date).days
|
||||
holding_period = row['timestamp'] - entry_date
|
||||
|
||||
# 计算当天的未实现收益
|
||||
position_size = self.total_position / entry_price # 计算持仓数量
|
||||
day_profit = (current_price - entry_price) * position_size # 用持仓数量计算收益
|
||||
day_result['profit'] = day_profit
|
||||
day_result['position'] = True
|
||||
|
||||
# 计算当前亏损(包括利息成本)
|
||||
interest_cost = self.borrowed_capital * self.daily_interest_rate * days_held
|
||||
current_net_profit = day_profit - interest_cost
|
||||
|
||||
# 打印每日收益情况
|
||||
print(f"\n当日交易 - {row['timestamp'].strftime('%Y-%m-%d')}")
|
||||
print(f"当前价格: {current_price:.2f}")
|
||||
print(f"持仓天数: {days_held}")
|
||||
print(f"当日收益: {day_profit:,.2f} ({current_profit*100:.2f}%)")
|
||||
|
||||
# 检查是否满足平仓条件
|
||||
if days_held >= self.min_holding_days:
|
||||
should_close = False
|
||||
close_type = None
|
||||
close_price = current_price
|
||||
|
||||
# 检查止盈
|
||||
if float(row['high']) >= entry_price * (1 + take_profit_pct):
|
||||
should_close = True
|
||||
close_type = 'sell_profit'
|
||||
close_price = entry_price * (1 + take_profit_pct)
|
||||
# 检查最大亏损
|
||||
elif current_net_profit <= max_loss_amount:
|
||||
should_close = True
|
||||
close_type = 'sell_loss'
|
||||
close_price = current_price
|
||||
# 检查持仓时间
|
||||
elif holding_period >= max_holding_period:
|
||||
should_close = True
|
||||
close_type = 'time_limit'
|
||||
close_price = current_price
|
||||
|
||||
if should_close:
|
||||
position_size = self.total_position / entry_price
|
||||
profit = (close_price - entry_price) * position_size
|
||||
commission = profit * self.commission_rate if profit > 0 else 0
|
||||
interest_cost = self.borrowed_capital * self.daily_interest_rate * days_held
|
||||
net_profit = profit - commission - interest_cost
|
||||
|
||||
cumulative_profit += net_profit
|
||||
position = False
|
||||
last_exit_price = close_price
|
||||
day_result['action'] = close_type
|
||||
day_result['profit'] = net_profit
|
||||
|
||||
print(f"\n>>> {'止盈平仓' if close_type == 'sell_profit' else '止损平仓' if close_type == 'sell_loss' else '到期平仓'}")
|
||||
print(f"持仓天数: {days_held}")
|
||||
print(f"持仓数量: {position_size:.0f}股")
|
||||
print(f"平仓价格: {close_price:.2f}")
|
||||
print(f"{'盈利' if profit > 0 else '亏损'}: {profit:,.2f}")
|
||||
print(f"手续费: {commission:,.2f}")
|
||||
print(f"利息成本: {interest_cost:,.2f}")
|
||||
print(f"净{'盈利' if net_profit > 0 else '亏损'}: {net_profit:,.2f}")
|
||||
|
||||
results.append(day_result)
|
||||
|
||||
# 在最后一天强制平仓
|
||||
if position:
|
||||
final_price = (float(df.iloc[-1]['high']) + float(df.iloc[-1]['low'])) / 2
|
||||
position_size = self.total_position / entry_price
|
||||
final_profit = (final_price - entry_price) * position_size
|
||||
days_held = (df.iloc[-1]['timestamp'] - entry_date).days
|
||||
commission = final_profit * self.commission_rate if final_profit > 0 else 0
|
||||
interest_cost = self.borrowed_capital * self.daily_interest_rate * days_held
|
||||
net_profit = final_profit - commission - interest_cost
|
||||
|
||||
results[-1]['action'] = 'final_sell'
|
||||
results[-1]['profit'] = net_profit
|
||||
cumulative_profit += net_profit
|
||||
|
||||
print(f"\n>>> 到期强制平仓")
|
||||
print(f"持仓天数: {days_held}")
|
||||
print(f"持仓数量: {position_size:.0f}股")
|
||||
print(f"平仓价格: {final_price:.2f}")
|
||||
print(f"毛利润: {final_profit:,.2f}")
|
||||
print(f"手续费: {commission:,.2f}")
|
||||
print(f"利息成本: {interest_cost:,.2f}")
|
||||
print(f"净利润: {net_profit:,.2f}")
|
||||
|
||||
print(f"\n{'='*50}")
|
||||
print(f"交易统计")
|
||||
print(f"总交易次数: {trades_count}")
|
||||
print(f"累计收益: {cumulative_profit:,.2f}")
|
||||
print(f"{'='*50}\n")
|
||||
|
||||
return pd.DataFrame(results)
|
||||
|
||||
def analyze_stock(self, symbol, start_date, end_date, take_profit_pct, stop_loss_pct, pullback_entry_pct):
|
||||
"""分析单个股票"""
|
||||
df = self.get_stock_data(symbol, start_date, end_date)
|
||||
|
||||
if len(df) < 10: # 跳过数据少于10条的股票
|
||||
print(f"股票 {symbol} 数据不足10条,跳过分析")
|
||||
return None
|
||||
|
||||
return self.calculate_trade_signals(
|
||||
df,
|
||||
take_profit_pct=take_profit_pct,
|
||||
stop_loss_pct=stop_loss_pct,
|
||||
pullback_entry_pct=pullback_entry_pct
|
||||
)
|
||||
|
||||
def analyze_all_stocks(self, start_date, end_date, take_profit_pct, stop_loss_pct, pullback_entry_pct):
|
||||
"""分析所有股票"""
|
||||
stocks = self.get_stock_list()
|
||||
all_results = {}
|
||||
|
||||
print(f"\n开始分析,共 {len(stocks)} 支股票")
|
||||
print(f"分析参数:")
|
||||
print(f"- 开始日期: {start_date}")
|
||||
print(f"- 结束日期: {end_date}")
|
||||
print(f"- 止盈: {take_profit_pct*100}%")
|
||||
print(f"- 止损: {stop_loss_pct*100}%")
|
||||
print(f"- 回调建仓: {pullback_entry_pct*100}%\n")
|
||||
|
||||
for symbol in tqdm(stocks, desc="Analyzing stocks"):
|
||||
result = self.analyze_stock(
|
||||
symbol,
|
||||
start_date,
|
||||
end_date,
|
||||
take_profit_pct,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
if result is not None:
|
||||
all_results[symbol] = result
|
||||
|
||||
return all_results
|
||||
|
||||
def plot_results(self, results, symbol):
|
||||
"""绘制单个股票的收益走势图"""
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(results['date'], results['profit'].cumsum(), label='Cumulative Profit')
|
||||
plt.title(f'Stock {symbol} Trading Results')
|
||||
plt.xlabel('Date')
|
||||
plt.ylabel('Profit (CNY)')
|
||||
plt.legend()
|
||||
plt.grid(True)
|
||||
plt.xticks(rotation=45)
|
||||
plt.tight_layout()
|
||||
return plt
|
||||
|
||||
def plot_all_stocks(self, all_results):
|
||||
"""绘制所有股票的收益走势图"""
|
||||
plt.figure(figsize=(15, 8))
|
||||
|
||||
# 记录所有股票的累计收益
|
||||
total_profits = {}
|
||||
max_profit = float('-inf')
|
||||
min_profit = float('inf')
|
||||
|
||||
# 绘制每支股票的曲线
|
||||
for symbol, results in all_results.items():
|
||||
cumulative_profits = results['profit'].cumsum()
|
||||
plt.plot(results['date'], cumulative_profits, label=symbol, alpha=0.5, linewidth=1)
|
||||
|
||||
# 更新最大最小收益
|
||||
max_profit = max(max_profit, cumulative_profits.max())
|
||||
min_profit = min(min_profit, cumulative_profits.min())
|
||||
|
||||
# 记录最终收益
|
||||
total_profits[symbol] = cumulative_profits.iloc[-1]
|
||||
|
||||
# 计算所有股票的平均收益曲线
|
||||
# 首先找到共同的日期范围
|
||||
all_dates = set()
|
||||
for results in all_results.values():
|
||||
all_dates.update(results['date'])
|
||||
all_dates = sorted(list(all_dates))
|
||||
|
||||
# 创建一个包含所有日期的DataFrame
|
||||
avg_profits = pd.DataFrame(index=all_dates)
|
||||
|
||||
# 对每支股票,填充所有日期的收益
|
||||
for symbol, results in all_results.items():
|
||||
daily_profits = pd.Series(index=all_dates, data=0.0)
|
||||
cumulative = 0
|
||||
last_cumulative = 0
|
||||
for date, profit in zip(results['date'], results['profit']):
|
||||
cumulative += profit
|
||||
daily_profits[date] = cumulative
|
||||
last_cumulative = cumulative
|
||||
# 对于没有交易的日期,使用最后一个累计收益填充
|
||||
daily_profits.fillna(method='ffill', inplace=True)
|
||||
daily_profits.fillna(0, inplace=True) # 对开始之前的日期填充0
|
||||
avg_profits[symbol] = daily_profits
|
||||
|
||||
# 计算并绘制平均收益曲线
|
||||
avg_line = avg_profits.mean(axis=1)
|
||||
plt.plot(all_dates, avg_line, 'r-', label='Average', linewidth=2)
|
||||
|
||||
plt.title('All Stocks Trading Results')
|
||||
plt.xlabel('Date')
|
||||
plt.ylabel('Profit (CNY)')
|
||||
plt.grid(True)
|
||||
plt.xticks(rotation=45)
|
||||
|
||||
# 添加利润区间标注
|
||||
plt.text(0.02, 0.98, f'Profit Range:\nMax: {max_profit:,.0f}\nMin: {min_profit:,.0f}\nAvg: {avg_line.iloc[-1]:,.0f}',
|
||||
transform=plt.gca().transAxes, bbox=dict(facecolor='white', alpha=0.8))
|
||||
|
||||
# 获取前5名和后5名股票
|
||||
top_5 = sorted(total_profits.items(), key=lambda x: x[1], reverse=True)[:5]
|
||||
bottom_5 = sorted(total_profits.items(), key=lambda x: x[1])[:5]
|
||||
|
||||
# 添加排名信息
|
||||
rank_text = "Top 5 Stocks:\n"
|
||||
for symbol, profit in top_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
rank_text += "\nBottom 5 Stocks:\n"
|
||||
for symbol, profit in bottom_5:
|
||||
rank_text += f"{symbol}: {profit:,.0f}\n"
|
||||
|
||||
plt.text(1.02, 0.98, rank_text, transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8), verticalalignment='top')
|
||||
|
||||
plt.tight_layout()
|
||||
return plt, total_profits
|
||||
|
||||
def plot_profit_distribution(self, total_profits):
|
||||
"""绘制所有股票的收益分布小提琴图"""
|
||||
plt.figure(figsize=(12, 8))
|
||||
|
||||
# 将收益数据转换为数组
|
||||
profits = np.array(list(total_profits.values()))
|
||||
|
||||
# 计算统计数据
|
||||
mean_profit = np.mean(profits)
|
||||
median_profit = np.median(profits)
|
||||
max_profit = np.max(profits)
|
||||
min_profit = np.min(profits)
|
||||
std_profit = np.std(profits)
|
||||
|
||||
# 绘制小提琴图
|
||||
violin_parts = plt.violinplot(profits, positions=[0], showmeans=True, showmedians=True)
|
||||
|
||||
# 设置小提琴图的颜色
|
||||
violin_parts['bodies'][0].set_facecolor('lightblue')
|
||||
violin_parts['bodies'][0].set_alpha(0.7)
|
||||
violin_parts['cmeans'].set_color('red')
|
||||
violin_parts['cmedians'].set_color('blue')
|
||||
|
||||
# 添加统计信息
|
||||
stats_text = (
|
||||
f"统计信息:\n"
|
||||
f"平均值: {mean_profit:,.0f}\n"
|
||||
f"中位数: {median_profit:,.0f}\n"
|
||||
f"最大值: {max_profit:,.0f}\n"
|
||||
f"最小值: {min_profit:,.0f}\n"
|
||||
f"标准差: {std_profit:,.0f}"
|
||||
)
|
||||
|
||||
plt.text(0.65, 0.95, stats_text,
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8, edgecolor='gray'),
|
||||
verticalalignment='top',
|
||||
fontsize=10)
|
||||
|
||||
# 设置图表样式
|
||||
plt.title('股票收益分布图', fontsize=14, pad=20)
|
||||
plt.ylabel('收益 (元)', fontsize=12)
|
||||
plt.xticks([0], ['所有股票'], fontsize=10)
|
||||
plt.grid(True, axis='y', alpha=0.3)
|
||||
|
||||
# 添加零线
|
||||
plt.axhline(y=0, color='r', linestyle='--', alpha=0.3)
|
||||
|
||||
# 计算盈利和亏损的股票数量
|
||||
profit_count = np.sum(profits > 0)
|
||||
loss_count = np.sum(profits < 0)
|
||||
total_count = len(profits)
|
||||
|
||||
# 添加盈亏比例信息
|
||||
ratio_text = (
|
||||
f"盈亏比例:\n"
|
||||
f"盈利: {profit_count}支 ({profit_count/total_count*100:.1f}%)\n"
|
||||
f"亏损: {loss_count}支 ({loss_count/total_count*100:.1f}%)\n"
|
||||
f"总计: {total_count}支"
|
||||
)
|
||||
|
||||
plt.text(0.65, 0.6, ratio_text,
|
||||
transform=plt.gca().transAxes,
|
||||
bbox=dict(facecolor='white', alpha=0.8, edgecolor='gray'),
|
||||
verticalalignment='top',
|
||||
fontsize=10)
|
||||
|
||||
plt.tight_layout()
|
||||
return plt
|
||||
|
||||
def main():
|
||||
# 数据库连接配置
|
||||
db_config = {
|
||||
'host': '192.168.1.82',
|
||||
'port': 3306,
|
||||
'user': 'root',
|
||||
'password': 'Chlry$%.8',
|
||||
'database': 'db_gp_cj'
|
||||
}
|
||||
|
||||
try:
|
||||
connection_string = f"mysql+pymysql://{db_config['user']}:{db_config['password']}@{db_config['host']}:{db_config['port']}/{db_config['database']}"
|
||||
|
||||
# 创建results目录
|
||||
if not os.path.exists('results'):
|
||||
os.makedirs('results')
|
||||
|
||||
# 创建分析器实例
|
||||
analyzer = StockAnalyzer(connection_string)
|
||||
|
||||
# 设置分析参数
|
||||
start_date = '2024-01-01'
|
||||
end_date = '2024-12-31'
|
||||
take_profit_pct = 0.10 # 10%止盈
|
||||
stop_loss_pct = -0.99 # -10%止损
|
||||
pullback_entry_pct = -0.05 # -5%回调建仓
|
||||
|
||||
# 运行分析
|
||||
results = analyzer.analyze_all_stocks(
|
||||
start_date,
|
||||
end_date,
|
||||
take_profit_pct,
|
||||
stop_loss_pct,
|
||||
pullback_entry_pct
|
||||
)
|
||||
|
||||
# 保存结果
|
||||
for symbol, result in results.items():
|
||||
result.to_csv(f'results/{symbol}_analysis.csv', index=False)
|
||||
plt = analyzer.plot_results(result, symbol)
|
||||
plt.savefig(f'results/{symbol}_chart.png')
|
||||
plt.close()
|
||||
|
||||
# 绘制所有股票的收益曲线
|
||||
plt, total_profits = analyzer.plot_all_stocks(results)
|
||||
plt.savefig('results/all_stocks_analysis.png', bbox_inches='tight', dpi=300)
|
||||
plt.close()
|
||||
|
||||
# 绘制收益分布小提琴图
|
||||
plt = analyzer.plot_profit_distribution(total_profits)
|
||||
plt.savefig('results/profit_distribution.png', bbox_inches='tight', dpi=300)
|
||||
plt.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"程序运行出错: {str(e)}")
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,118 @@
|
|||
20230508_20240508下跌后快速反弹走势,,,,,,,,
|
||||
take_profit_pct,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count,
|
||||
30,-4712,0,100.8,49.8,53.1,1815,405,
|
||||
29,-5206,0,100,49.9,53.3,1818,405,
|
||||
28,-6335,0,99.2,50,53.6,1822,405,
|
||||
27,-6590,0,98,50.2,53.6,1827,405,
|
||||
26,-6865,0,96.7,50.5,54.1,1833,405,
|
||||
25,-6648,0,95.4,51,54.3,1836,405,
|
||||
24,-6931,0,93.9,51.4,54.1,1835,403,
|
||||
23,-5709,0,91.9,52.2,54.5,1837,404,
|
||||
22,-6556,0,90.7,52.4,54.6,1852,405,
|
||||
21,-5242,0,88.3,53.1,55.3,1858,405,
|
||||
20,-5913,0,86.6,53.7,55.3,1866,405,
|
||||
19,-5848,0,84.1,54.5,55.6,1876,405,
|
||||
18,-4698,0,81.5,55.6,56.3,1882,405,
|
||||
17,-5508,0,79.3,56.4,56.3,1888,405,
|
||||
16,-4942,0,76.6,57.5,57,1897,405,
|
||||
15,-5598,0,74.1,58.6,58.5,1903,405,
|
||||
14,-6530,0,71,59.6,58.5,1910,405,
|
||||
13,-6346,0,68.3,61,58.8,1919,405,
|
||||
12,-6840,0,65.3,62.6,58.8,1926,405,
|
||||
11,-7236,0,62.5,64.4,58.5,1931,405,
|
||||
10,-7611,0,59.3,66.1,58.8,1939,405,
|
||||
9,-9419,0,55.9,67.5,59,1949,405,
|
||||
8,-9855,0,52.7,69.4,59,1958,405,
|
||||
7,-10832,0,49.2,71.4,58.8,1969,405,
|
||||
6,-11762,0,45.3,73.7,59.8,1973,405,
|
||||
5,-13031,0,41.6,75.9,60.5,1978,405,
|
||||
,,,,,,,,
|
||||
,,,,,,,,
|
||||
20230508_20240205下跌走势,,,,,,,,
|
||||
take_profit_pct,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count,
|
||||
30,-120990,0,75.6,10.9,8.8,1465,396,
|
||||
29,-120762,0,75.4,10.9,8.6,1466,396,
|
||||
28,-120539,0,75.1,11.1,8.3,1468,396,
|
||||
27,-119956,0,74.8,11.4,9.1,1469,396,
|
||||
26,-118942,0,74.3,11.6,9.6,1471,396,
|
||||
25,-117868,0,73.8,11.9,9.3,1471,396,
|
||||
24,-117173,0,73.3,12.3,9.3,1471,396,
|
||||
23,-114536,0,72.2,13,9.6,1474,396,
|
||||
22,-113484,0,71.5,13.3,9.8,1479,396,
|
||||
21,-109829,0,69.9,14.4,10.9,1482,396,
|
||||
20,-108867,0,69,15,10.9,1486,396,
|
||||
19,-106925,0,67.9,15.8,11.4,1492,396,
|
||||
18,-104300,0,66.7,16.8,11.4,1496,396,
|
||||
17,-102194,0,65.5,17.7,12.6,1499,396,
|
||||
16,-99208,0,64,18.9,12.9,1506,396,
|
||||
15,-97766,0,62.6,19.8,13.1,1511,396,
|
||||
14,-96754,0,61.2,20.6,13.1,1515,396,
|
||||
13,-93449,0,59.5,22.3,13.9,1522,396,
|
||||
12,-91252,0,57.7,23.9,14.6,1526,396,
|
||||
11,-88804,0,56.1,25.3,15.2,1527,396,
|
||||
10,-84415,0,53.6,27.9,17.4,1535,396,
|
||||
9,-80819,0,50.9,30.7,19.7,1543,396,
|
||||
8,-77402,0,48.2,33.2,21.5,1547,396,
|
||||
7,-72609,0,45.1,36.2,23.5,1556,396,
|
||||
6,-67130,0,41.5,40.1,27,1559,396,
|
||||
5,-63089,0,38.3,43.3,27,1563,396,
|
||||
,,,,,,,,
|
||||
,,,,,,,,
|
||||
20221028_20230508上涨走势,,,,,,,,
|
||||
take_profit_pct,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count,
|
||||
30,-26094,0,84.9,35.4,39.4,1022,343,
|
||||
29,-24312,0,83.6,36.2,40.2,1027,343,
|
||||
28,-24443,0,82.7,36.7,40.5,1031,343,
|
||||
27,-23021,0,81.2,37.2,41.1,1034,343,
|
||||
26,-22763,0,80,37.7,41.4,1036,343,
|
||||
25,-21882,0,78,38.5,42,1040,343,
|
||||
24,-22570,0,77.1,38.9,41.4,1042,343,
|
||||
23,-22085,0,75.5,39.6,42,1048,343,
|
||||
22,-21214,0,74.1,40.4,43.4,1053,343,
|
||||
21,-20730,0,72.7,41.3,44,1059,343,
|
||||
20,-18191,0,70.6,42.5,44.6,1064,343,
|
||||
19,-17678,0,68.8,43.4,43.7,1068,343,
|
||||
18,-18481,0,67.2,44,43.1,1072,343,
|
||||
17,-16782,0,64.9,45.4,44.9,1076,343,
|
||||
16,-16490,0,62.9,46.4,45.8,1081,343,
|
||||
15,-15946,0,60.4,47.7,46.4,1089,343,
|
||||
14,-16037,0,58.4,48.9,47.2,1095,343,
|
||||
13,-16701,0,56.4,49.8,48.1,1100,343,
|
||||
12,-16062,0,54,51.3,49,1106,343,
|
||||
11,-16000,0,51.4,52.9,49.6,1110,343,
|
||||
10,-15453,0,49.1,54.4,49.6,1114,343,
|
||||
9,-14841,0,46.2,56.2,49.9,1121,343,
|
||||
8,-14211,0,43,58.3,51.3,1132,343,
|
||||
7,-14199,0,39.9,60.5,53.9,1138,343,
|
||||
6,-15366,0,37.3,62.4,52.8,1144,343,
|
||||
5,-15711,0,34.1,64.9,50.7,1152,343,
|
||||
,,,,,,,,
|
||||
,,,,,,,,
|
||||
20210106_20220224震荡走势,,,,,,,,
|
||||
take_profit_pct,avg_profit_per_trade,median_profit_per_trade,avg_holding_days,trade_win_rate,stock_win_rate,total_trades,stock_count,
|
||||
30,12047,0,115.6,44.5,48.8,2508,424,
|
||||
29,12857,0,113.5,45.1,48.5,2525,425,
|
||||
28,13349,0,112,45.7,48.9,2538,425,
|
||||
27,12644,0,110.5,46.3,49.4,2554,425,
|
||||
26,12878,0,108.4,47.1,48.7,2571,425,
|
||||
25,12319,0,106.9,47.7,48.5,2589,425,
|
||||
24,12744,0,104.5,48.6,50.4,2608,425,
|
||||
23,11949,0,102.3,49.4,51.3,2626,425,
|
||||
22,11246,0,100.6,50.3,51.3,2637,425,
|
||||
21,10399,0,98.7,51.1,51.1,2644,425,
|
||||
20,9908,0,96.3,52,51.1,2666,425,
|
||||
19,9327,0,93.8,53,52.5,2681,425,
|
||||
18,7509,0,92.1,53.6,52.6,2686,424,
|
||||
17,7333,0,89.4,55.1,53.9,2713,425,
|
||||
16,6404,0,86.6,56.2,54.8,2745,425,
|
||||
15,5296,0,83.7,57.3,55.3,2763,425,
|
||||
14,5382,0,80.5,59,54.6,2788,425,
|
||||
13,4527,0,77.7,60.4,56.6,2800,424,
|
||||
12,3650,0,74.3,62,57.2,2826,425,
|
||||
11,1583,0,71.1,63.3,57.2,2849,425,
|
||||
10,-741,0,68.1,64.7,56.9,2859,425,
|
||||
9,-2581,0,64.5,66.3,56.9,2879,425,
|
||||
8,-3833,0,60.7,68.3,56.7,2902,425,
|
||||
7,-4992,0,56.7,70.5,57.9,2924,425,
|
||||
6,-4815,0,52.1,73.6,60.5,2948,425,
|
||||
5,-7635,0,47.9,75.6,58.8,2965,425,
|
|
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
测试脚本: 验证导入路径是否正常工作
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
# 设置日志
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# 显示当前工作目录和Python路径
|
||||
logger.info(f"当前工作目录: {os.getcwd()}")
|
||||
logger.info(f"Python路径: {sys.path}")
|
||||
|
||||
def test_imports():
|
||||
"""测试导入各个模块"""
|
||||
success = True
|
||||
|
||||
# 测试导入 chat_bot
|
||||
try:
|
||||
logger.info("尝试导入 chat_bot 模块...")
|
||||
from fundamentals_llm.chat_bot import ChatBot
|
||||
logger.info("成功导入 chat_bot 模块")
|
||||
except ImportError as e:
|
||||
logger.error(f"导入 chat_bot 模块失败: {str(e)}")
|
||||
success = False
|
||||
|
||||
# 尝试替代路径
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot import ChatBot
|
||||
logger.info("成功从替代路径导入 chat_bot 模块")
|
||||
success = True
|
||||
except ImportError as e2:
|
||||
logger.error(f"从替代路径导入 chat_bot 模块失败: {str(e2)}")
|
||||
|
||||
# 测试导入 chat_bot_with_offline
|
||||
try:
|
||||
logger.info("尝试导入 chat_bot_with_offline 模块...")
|
||||
from fundamentals_llm.chat_bot_with_offline import ChatBot
|
||||
logger.info("成功导入 chat_bot_with_offline 模块")
|
||||
except ImportError as e:
|
||||
logger.error(f"导入 chat_bot_with_offline 模块失败: {str(e)}")
|
||||
success = False
|
||||
|
||||
# 尝试替代路径
|
||||
try:
|
||||
from src.fundamentals_llm.chat_bot_with_offline import ChatBot
|
||||
logger.info("成功从替代路径导入 chat_bot_with_offline 模块")
|
||||
success = True
|
||||
except ImportError as e2:
|
||||
logger.error(f"从替代路径导入 chat_bot_with_offline 模块失败: {str(e2)}")
|
||||
|
||||
# 测试导入 fundamental_analysis
|
||||
try:
|
||||
logger.info("尝试导入 fundamental_analysis 模块...")
|
||||
from fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功导入 fundamental_analysis 模块")
|
||||
except ImportError as e:
|
||||
logger.error(f"导入 fundamental_analysis 模块失败: {str(e)}")
|
||||
success = False
|
||||
|
||||
# 尝试替代路径
|
||||
try:
|
||||
from src.fundamentals_llm.fundamental_analysis import FundamentalAnalyzer
|
||||
logger.info("成功从替代路径导入 fundamental_analysis 模块")
|
||||
success = True
|
||||
except ImportError as e2:
|
||||
logger.error(f"从替代路径导入 fundamental_analysis 模块失败: {str(e2)}")
|
||||
|
||||
# 测试导入 pdf_generator
|
||||
try:
|
||||
logger.info("尝试导入 pdf_generator 模块...")
|
||||
from fundamentals_llm.pdf_generator import generate_investment_report
|
||||
logger.info("成功导入 pdf_generator 模块")
|
||||
except ImportError as e:
|
||||
logger.error(f"导入 pdf_generator 模块失败: {str(e)}")
|
||||
success = False
|
||||
|
||||
# 尝试替代路径
|
||||
try:
|
||||
from src.fundamentals_llm.pdf_generator import generate_investment_report
|
||||
logger.info("成功从替代路径导入 pdf_generator 模块")
|
||||
success = True
|
||||
except ImportError as e2:
|
||||
logger.error(f"从替代路径导入 pdf_generator 模块失败: {str(e2)}")
|
||||
|
||||
return success
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger.info("开始测试导入...")
|
||||
if test_imports():
|
||||
logger.info("所有导入测试通过")
|
||||
sys.exit(0)
|
||||
else:
|
||||
logger.error("导入测试失败")
|
||||
sys.exit(1)
|
|
@ -0,0 +1,124 @@
|
|||
import pandas as pd
|
||||
import numpy as np
|
||||
from sqlalchemy import create_engine, text
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class VolatilityCalculator:
|
||||
def __init__(self, db_connection_string):
|
||||
"""
|
||||
初始化波动率计算器
|
||||
:param db_connection_string: 数据库连接字符串,例如: 'mysql+pymysql://user:password@localhost:3306/db_gp_cj'
|
||||
"""
|
||||
self.engine = create_engine(db_connection_string)
|
||||
|
||||
def create_volatility_table(self):
|
||||
"""创建存储波动率的表"""
|
||||
create_table_sql = """
|
||||
CREATE TABLE IF NOT EXISTS gp_volatility (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
gp_code VARCHAR(255),
|
||||
calculation_date DATE,
|
||||
volatility_yearly DECIMAL(10, 4),
|
||||
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id),
|
||||
INDEX idx_gp_code (gp_code),
|
||||
INDEX idx_calc_date (calculation_date)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||
"""
|
||||
with self.engine.connect() as conn:
|
||||
conn.execute(text(create_table_sql))
|
||||
conn.commit()
|
||||
|
||||
def calculate_volatility(self, end_date=None):
|
||||
"""
|
||||
计算所有股票的年化波动率
|
||||
:param end_date: 计算截止日期,默认为最新日期
|
||||
"""
|
||||
if end_date is None:
|
||||
end_date = datetime.now().date()
|
||||
start_date = end_date - timedelta(days=365)
|
||||
|
||||
# 获取所有股票代码
|
||||
with self.engine.connect() as conn:
|
||||
stocks = pd.read_sql("SELECT DISTINCT gp_code FROM gp_code_all", conn)
|
||||
|
||||
results = []
|
||||
for stock_code in stocks['gp_code']:
|
||||
try:
|
||||
# 获取股票的日线数据
|
||||
query = f"""
|
||||
SELECT timestamp, close
|
||||
FROM gp_day_data
|
||||
WHERE symbol = '{stock_code}'
|
||||
AND timestamp BETWEEN '{start_date}' AND '{end_date}'
|
||||
ORDER BY timestamp
|
||||
"""
|
||||
|
||||
with self.engine.connect() as conn:
|
||||
df = pd.read_sql(query, conn)
|
||||
|
||||
if len(df) < 30: # 数据太少,跳过
|
||||
continue
|
||||
|
||||
# 计算日收益率
|
||||
df['close'] = df['close'].astype(float)
|
||||
df['daily_return'] = df['close'].pct_change()
|
||||
|
||||
# 计算年化波动率 (标准差 * sqrt(交易日数量))
|
||||
volatility = df['daily_return'].std() * np.sqrt(252) # 252为一年的交易日数
|
||||
|
||||
results.append({
|
||||
'gp_code': stock_code,
|
||||
'calculation_date': end_date,
|
||||
'volatility_yearly': float(volatility)
|
||||
})
|
||||
|
||||
logger.info(f"Calculated volatility for {stock_code}: {volatility:.4f}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error calculating volatility for {stock_code}: {str(e)}")
|
||||
continue
|
||||
|
||||
# 批量插入结果
|
||||
if results:
|
||||
insert_sql = """
|
||||
INSERT INTO gp_volatility (gp_code, calculation_date, volatility_yearly)
|
||||
VALUES (:gp_code, :calculation_date, :volatility_yearly)
|
||||
"""
|
||||
with self.engine.connect() as conn:
|
||||
conn.execute(text(insert_sql), results)
|
||||
conn.commit()
|
||||
|
||||
def get_top_volatile_stocks(self, top_n=10, calculation_date=None):
|
||||
"""
|
||||
获取波动率最高的股票
|
||||
:param top_n: 返回前N个股票
|
||||
:param calculation_date: 特定日期的数据,默认为最新日期
|
||||
:return: DataFrame包含股票代码和波动率
|
||||
"""
|
||||
query = """
|
||||
SELECT v.gp_code, c.gp_name, v.volatility_yearly, v.calculation_date
|
||||
FROM gp_volatility v
|
||||
LEFT JOIN gp_code_all c ON v.gp_code = c.gp_code
|
||||
WHERE v.calculation_date = (
|
||||
SELECT MAX(calculation_date) FROM gp_volatility
|
||||
WHERE calculation_date = COALESCE(:calc_date, calculation_date)
|
||||
)
|
||||
ORDER BY v.volatility_yearly DESC
|
||||
LIMIT :top_n
|
||||
"""
|
||||
with self.engine.connect() as conn:
|
||||
return pd.read_sql(text(query), conn, params={'calc_date': calculation_date, 'top_n': top_n})
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 使用示例
|
||||
# calculator = VolatilityCalculator('mysql+pymysql://user:password@localhost:3306/db_gp_cj')
|
||||
# calculator.create_volatility_table()
|
||||
# calculator.calculate_volatility()
|
||||
# top_volatile = calculator.get_top_volatile_stocks(10)
|
||||
# print(top_volatile)
|
||||
pass
|
Loading…
Reference in New Issue