Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/scripts/right_side_selector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import akshare as ak
import pandas as pd

def select_right_side():

df = ak.stock_zh_a_spot_em()

# 去ST
df = df[~df['名称'].str.contains('ST')]

# 成交额过滤(活跃度)
df = df[df['成交额'] > 5e8]

# 涨幅过滤(右侧启动)
df = df[(df['涨跌幅'] > 2) & (df['涨跌幅'] < 8)]

# 换手率
df = df[df['换手率'] > 3]

# 排序
df = df.sort_values('涨跌幅', ascending=False)

top50 = df.head(50)['代码'].tolist()

return ",".join(top50)


if __name__ == "__main__":
print(select_right_side())
6 changes: 5 additions & 1 deletion .github/workflows/daily_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 每日股票分析
on:
# 定时触发 - 每天北京时间 18:00 (UTC 10:00)
schedule:
- cron: '0 10 * * 1-5' # 周一到周五,UTC 10:00 = 北京时间 18:00
- cron: '25 6 * * 1-5' # 周一到周五,UTC 10:00 = 北京时间 18:00

# 手动触发
workflow_dispatch:
Expand Down Expand Up @@ -55,6 +55,10 @@ jobs:
- name: 创建必要目录
run: |
mkdir -p data logs reports

- name: Export STOCK_LIST
run: |
echo "STOCK_LIST=$(cat stock_list.txt)" >> $GITHUB_ENV

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ensure generated STOCK_LIST is the value passed to analysis

This step exports a generated STOCK_LIST via $GITHUB_ENV, but the later 执行股票分析 step still defines STOCK_LIST explicitly from ${{ vars.STOCK_LIST || secrets.STOCK_LIST || '600519' }}, which shadows the generated value; as a result, the right-side pool computation has no effect and analysis continues using the static/default list. This causes silently incorrect stock selection rather than the intended dynamic list.

Useful? React with 👍 / 👎.


- name: 执行股票分析
env:
Expand Down