Prompt file imported from GoatWang/oysterun-ccstock-workenv-en (
.codex/prompts/screen_stocks.md). Copyright stays with the author.
Screen Stocks
Screen stocks based on financial criteria using natural language.
Usage
/screen_stocks <criteria>
Examples
/screen_stocks P/E < 15 且 ROE > 15%
/screen_stocks 台股ä¸Dividend Yield > 5% 的股票
/screen_stocks US stocks with market cap > 10B and D/E < 0.5
/screen_stocks find China A-shares near 3-year lows
Instructions
When this command is invoked:
-
Parse natural language criteria into structured filters:
- Identify market (US/TW/CN) from context
- Extract metric conditions (P/E, ROE, P/B, D/E, yield, market cap, etc.)
- Detect special patterns like "N-year low", "near 52-week low", etc.
-
Run the screener:
cd $(pwd)/tool_scripts/financial_calc && uv run python screener.py --market <market> --criteria '<json_criteria>'
Where json_criteria is a JSON string like:
{"market": "US", "filters": [{"metric": "pe_ratio", "op": "<", "value": 15}, {"metric": "roe", "op": ">", "value": 0.15}]}
- Format output in English:
🔍 Screening Criteria: <human-readable criteria>
Market: <market>
Matches: <count> 檔
| # | ticker | Name | Current Price | P/E | ROE | <relevant metrics> |
|---|------|------|------|-----|-----|--------------------|
| 1 | XXXX | XXX | XX.X | XX | XX% | ... |
...
📊 共 <count> 檔Matches
-
If results exceed 20, show top 20 and mention total count.
-
Report the formatted result to the user.