비기계적 매도전략(가치보존) + 위성종목 추천 엔진 추가
매크로·실적·펀더멘털·공매도수급·호가미시구조·대내외 변수 5개 독립 팩터군의 confluence(최소 3/5 합의) 없이는 매도 트리거를 금지하는 정성적 매도판단 엔진과, 보유종목 제외 위성후보 추천 로직을 추가한다. - 단일 팩터 임계값 돌파만으로는 매도 신호를 생성하지 않음 (mechanical_sell_prohibited=true) - 데이터 결측 시 항상 DATA_MISSING/INSUFFICIENT_DATA_NO_ACTION — 추정값으로 채우지 않음 - KIS 호가10단계·공매도거래비중 + Naver 시세/수급 스크래핑 입력 연동 - SQLite 시계열 저장 + 사후 적중률 자체평가 (evaluate_qualitative_sell_strategy_accuracy_v1) - Gitea 일일 스케줄(장마감 후) + 파이프라인 계약 검증 게이트
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
name: Qualitative Sell Strategy (Read-Only, SQLite Canonical)
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 10 * * 1-5" # KST 19:00-ish daily post-close batch window (UTC 10:00)
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
evaluate-qualitative-sell:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
run: |
|
||||
if [ -d .git ]; then
|
||||
git remote set-url origin http://x-access-token:${{ secrets.GITHUB_TOKEN }}@192.168.123.100:8418/KimJaeHyun/myfinance.git
|
||||
else
|
||||
git init
|
||||
git remote add origin http://x-access-token:${{ secrets.GITHUB_TOKEN }}@192.168.123.100:8418/KimJaeHyun/myfinance.git
|
||||
fi
|
||||
git fetch origin main --depth=1
|
||||
git reset --hard FETCH_HEAD
|
||||
|
||||
- name: Configure Runtime Paths
|
||||
run: |
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
echo "/usr/local/bin" >> $GITHUB_PATH
|
||||
/usr/bin/python3 --version
|
||||
|
||||
- name: Setup Python Environment
|
||||
run: |
|
||||
VENV_BASE=/volume1/gitea/python_venv
|
||||
REQ_HASH=$(md5sum tools/build_qualitative_sell_inputs_v1.py 2>/dev/null | cut -d' ' -f1 || echo "qual-default")
|
||||
VENV="$VENV_BASE/$REQ_HASH"
|
||||
if [ ! -f "$VENV/bin/python" ]; then
|
||||
mkdir -p "$VENV_BASE"
|
||||
/usr/bin/python3 -m venv "$VENV"
|
||||
"$VENV/bin/pip" install --upgrade pip --quiet
|
||||
"$VENV/bin/pip" install requests beautifulsoup4 pyyaml openpyxl --quiet
|
||||
fi
|
||||
echo "$VENV/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: "[CRITICAL] No Direct API Trading Gate"
|
||||
run: python3 tools/validate_no_direct_api_trading_v1.py
|
||||
|
||||
- name: "[CRITICAL] Validate KIS API Credentials (mock)"
|
||||
env:
|
||||
KIS_APP_Key_TEST: ${{ secrets.KIS_APP_KEY_TEST }}
|
||||
KIS_APP_Secret_TEST: ${{ secrets.KIS_APP_SECRET_TEST }}
|
||||
run: python3 tools/validate_kis_api_credentials_v1.py --account mock --ticker 005930
|
||||
|
||||
- name: Build Qualitative Sell Inputs (batch)
|
||||
env:
|
||||
KIS_APP_Key: ${{ secrets.KIS_APP_KEY }}
|
||||
KIS_APP_Secret: ${{ secrets.KIS_APP_SECRET }}
|
||||
run: |
|
||||
if [ -f GatherTradingData.xlsx ]; then
|
||||
python3 tools/build_qualitative_sell_inputs_v1.py \
|
||||
--batch \
|
||||
--workbook GatherTradingData.xlsx \
|
||||
--kis-account real \
|
||||
--apply
|
||||
else
|
||||
echo "GatherTradingData.xlsx missing -> skip batch build"
|
||||
fi
|
||||
|
||||
- name: Build Satellite Recommendations
|
||||
run: |
|
||||
if [ -f GatherTradingData.xlsx ]; then
|
||||
python3 tools/build_satellite_candidate_recommendations_v1.py \
|
||||
--workbook GatherTradingData.xlsx \
|
||||
--apply
|
||||
else
|
||||
echo "GatherTradingData.xlsx missing -> skip satellite build"
|
||||
fi
|
||||
|
||||
- name: Evaluate Qualitative Sell Accuracy
|
||||
run: |
|
||||
if [ -f outputs/qualitative_sell_strategy/qualitative_sell_strategy.db ]; then
|
||||
python3 tools/evaluate_qualitative_sell_strategy_accuracy_v1.py \
|
||||
--sqlite-db outputs/qualitative_sell_strategy/qualitative_sell_strategy.db
|
||||
else
|
||||
echo "qualitative_sell_strategy.db missing -> skip accuracy evaluation"
|
||||
fi
|
||||
Reference in New Issue
Block a user