Skip to content

Add Taiwan stock data collector and qlib workflow config - #123

Closed
ericson180312 wants to merge 7 commits into
UFund-Me:mainfrom
ericson180312:claude/friendly-bardeen-tozusq
Closed

ericson180312 wants to merge 7 commits into
UFund-Me:mainfrom
ericson180312:claude/friendly-bardeen-tozusq

Conversation

@ericson180312

Copy link
Copy Markdown
  • qbot/data/tw_collector.py: download TWSE/TPEx daily bars from Yahoo (stock list from FinMind or a custom file), normalize to qlib's adjusted-price/factor convention aligned to the TAIEX calendar, dump to qlib format, and build a quarterly top-N-by-turnover universe without look-ahead
  • LightGBM + Alpha158 config for region tw: 1000-share lots, 0050 as a dividend-inclusive benchmark, 0.1425% fee + 0.3% sell tax, 20 TWD minimum fee, 9.5% limit threshold
  • dump_bin.py: replace astype(np.datetime64), which pandas >= 2 rejects
  • Guide in docs/03-智能策略/台股qlib工作流.md and tests with synthetic data

Claude-Session: https://claude.ai/code/session_01Vf3KKYsmLyF6drsFMgMBoY

Description

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest Qbot/tests/test_all_pipeline.py under upper directory of /.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

claude and others added 7 commits October 2, 2026 14:41
The strategy pool tables pointed at qbot/strategy/..., which does not
exist. Point each entry at its real file under qbot/strategies/ or
pytrader/strategies/ (stoch_rsi_strategy.py -> StochRSI.py,
rsi_cci_strategy.py -> CCI.py, which combines RSI6 and CCI14).

Benchmark models that live in pytrader/strategies/benchmarks/ link
there; the rest (and LSTM, whose local folder only has an empty README)
link to the upstream microsoft/qlib benchmark and are tagged "qlib".
ImVoxelNet is in neither and is marked as not included.

Also drop the nonexistent backend/ prefix from the Quick Start
PYTHONPATH, the Model Zoo run command, the Binder link (now in the
labpath format), the notebook link and the quantstats link, and point
the repo stats image at .github/stats/metrics.svg where the stats
script writes it.

Apply the same fixes to docs/README.md, with links made relative to
docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A74mvLr44PgMnpwcctRzHx
Several scripts embedded Tushare, 掘金 (GM trade), Xueqiu and WSJ tokens as
string literals. They now read TUSHARE_TOKEN, GMTRADE_TOKEN/GMTRADE_ACCOUNT,
XUEQIU_TOKEN and WSJ_TOKEN from the environment and raise a clear
RuntimeError when the variable is missing. The variables are documented in
docs/Install_guide.md.

The removed tokens remain in git history and should be rotated at the
provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3cFCJHBzDPiwhm4owkVpa
The workflow ran scripts/update_repo_stats.py, but the script lives at
.github/scripts/update_repo_stats.py, so every run failed before
generating .github/stats/metrics.svg and the README chart never
resolved.

Also install requests and matplotlib directly instead of probing
scripts/requirements.txt, which doesn't exist and would pull in an
unrelated file if one were added to scripts/ later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A74mvLr44PgMnpwcctRzHx
Fix documentation links and simplify PYTHONPATH configuration
Remove hardcoded API tokens and use environment variables
- qbot/data/tw_collector.py: download TWSE/TPEx daily bars from Yahoo
  (stock list from FinMind or a custom file), normalize to qlib's
  adjusted-price/factor convention aligned to the TAIEX calendar, dump
  to qlib format, and build a quarterly top-N-by-turnover universe
  without look-ahead
- LightGBM + Alpha158 config for region tw: 1000-share lots, 0050 as a
  dividend-inclusive benchmark, 0.1425% fee + 0.3% sell tax, 20 TWD
  minimum fee, 9.5% limit threshold
- dump_bin.py: replace astype(np.datetime64), which pandas >= 2 rejects
- Guide in docs/03-智能策略/台股qlib工作流.md and tests with synthetic data

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vf3KKYsmLyF6drsFMgMBoY
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

pip install requests matplotlib
fi
pip install requests matplotlib

pip install requests matplotlib
fi
pip install requests matplotlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants