Taiwan Precision Stock Screener Agent Onboarding
This note is written for an agent that needs to install and operate Marcus's Taiwan stock-analysis skill in a new environment.
The skill is tw-precision-stock-screener: a conservative Taiwan equity screening workflow derived from himself65/finance-skills, then tightened for repeatability, cutoff safety, and high precision. It is built to find a short list of high-confidence Taiwan stock candidates, not to maximize the number of winners it can mention.
Use this note to set up the skill, understand the original workflow, and add the new interactive mode: Progressively Reverse Training.
This is research and education, not investment advice. Never describe any output as certain, guaranteed, or a personalized instruction to buy.
What This Skill Does
The skill screens Taiwan TWSE/TPEX stocks as of a specified date.
It merges:
- A default Taiwan AI/upstream supply-chain universe.
- A persistent user watchlist.
- Optional one-run tickers supplied by the user.
- Optional TradingView watchlists, if the user's environment supports authenticated TradingView sync.
Then it applies a frozen high-precision policy:
- Liquidity.
- SEPA trend quality.
- Revenue and earnings momentum.
- Growth-adjusted valuation.
- Extension risk.
- Veto layer for crowded, overextended, cyclical, or low-quality false positives.
- Optional information overlay using dated MOPS/IR/news/social evidence.
The preferred failure mode is "too few names." The skill should miss some winners rather than flood the user with false positives.
Source Package
Download the complete package:
tw-precision-stock-screener-v2.tar.gz
SHA-256:
d5d01af24f5a11a612a031d45b0eac56f878e29dc6b4436444f87357ac32303a
The package contains the full skill source:
tw-precision-stock-screener/
âââ SKILL.md
âââ agents/openai.yaml
âââ references/data-sources.md
âââ references/filter-policy.md
âââ references/finance-skills-map.md
âââ references/information-overlay.md
âââ references/output-contract.md
âââ references/progressive-reverse-training.md
âââ references/tradingview-watchlist.md
âââ references/universe.md
âââ scripts/screen.py
âââ scripts/tradingview-watchlist-sync.mjs
âââ scripts/watchlist.py
The package intentionally excludes __pycache__ and local runtime state.
Agent Installation
If the target environment is Codex, install into ~/.codex/skills. If the target is Claude Code or another skill runner, adapt the skill root but keep the internal directory name unchanged.
mkdir -p ~/.codex/skills ~/.codex/state/tw-precision-stock-screener
curl -L "https://vault-pub.pages.dev/tw-precision-stock-screener-agent-onboarding/tw-precision-stock-screener-v2.tar.gz" \
-o /tmp/tw-precision-stock-screener-v2.tar.gz
shasum -a 256 /tmp/tw-precision-stock-screener-v2.tar.gz
tar -xzf /tmp/tw-precision-stock-screener-v2.tar.gz -C ~/.codex/skills
Install Python dependencies:
python3 -m venv ~/.codex/state/tw-precision-stock-screener/.venv
source ~/.codex/state/tw-precision-stock-screener/.venv/bin/activate
python -m pip install yfinance pandas numpy beautifulsoup4
Smoke test:
python3 ~/.codex/skills/tw-precision-stock-screener/scripts/screen.py --help
python3 ~/.codex/skills/tw-precision-stock-screener/scripts/watchlist.py add 1815 5536 2327 8299
python3 ~/.codex/skills/tw-precision-stock-screener/scripts/screen.py \
--as-of 2026-05-18 \
--include 1815,5536,2327,8299 \
--output-dir /tmp/tw-screener-smoke
Expected behavior:
--helpshould print CLI options.watchlist.py addshould normalize known tickers.screen.pyshould produce a report and, when--output-diris supplied, JSON/CSV files.- Network/data-source failures should be reported as caveats, not silently ignored.
Optional TradingView Sync
TradingView sync is optional and user-specific. Do not assume Marcus's browser profile exists in another environment.
The original Marcus setup uses:
Browser profile: ~/.clawdbot/browser/clawd/user-data
CDP URL: http://127.0.0.1:9223
TradingView lists: TW, Red list
If the friend wants TradingView sync, configure their own authenticated Chrome profile and then run:
node ~/.codex/skills/tw-precision-stock-screener/scripts/tradingview-watchlist-sync.mjs \
--lists "TW,Red list"
The sync writes:
~/.codex/state/tw-precision-stock-screener/tradingview-watchlists.json
~/.codex/state/tw-precision-stock-screener/watchlist.json
tradingview-watchlists.json is the source-of-truth mirror. watchlist.json is only the Taiwan-stock cache consumed by the screener.
Never print TradingView cookies or session tokens.
Original Skill Context
The original public reference was himself65/finance-skills. Marcus's local skill is not a verbatim copy. It maps selected finance-skills ideas into a Taiwan-specific high-precision screener.
Mapped primitives:
yfinance-data: OHLCV, moving averages, 52-week high/low, relative strength, historical prices, financial statement fallback.sepa-strategy: Minervini-style Stage 2 orientation, trend template, relative strength, and pivot/extension discipline.earnings-preview: EPS, operating margin, earnings context when cutoff-safe.estimate-analysis: optional current estimate/revision overlay when available; do not use current estimate snapshots in historical backtests.company-valuation: PE and growth-adjusted valuation sanity checks.stock-liquidity: traded value and liquidity filters.
Added by Marcus's skill:
- Frozen high-precision gate policy.
- Taiwan-specific MOPS monthly revenue cutoff handling.
- Persistent watchlist state.
- TradingView watchlist mirror support.
- Information overlay for dated MOPS investor conferences, company IR, credible news, and high-signal social discussion.
- Machine-readable JSON/CSV outputs.
Progressively Reverse Training, described below.
Canonical Statuses
Use the exact status semantics from the skill:
QUALIFIED All five gates pass and no veto. Screen-qualified, not guaranteed buy.
INFO_CONFIRMED Baseline WATCH plus cutoff-safe company-specific evidence and no overlay veto.
WATCH Interesting enough to monitor, but not actionable now.
PASS Setup is not high precision.
VETO False-positive risk is too high.
DATA_GAP User-requested/watchlist stock cannot be evaluated due to missing data.
Never treat WATCH as a direct buy. A WATCH result often means "good company, wrong entry" or "good thesis, not enough precision."
Frozen Filter Policy
Do not tune thresholds during a run. If the result feels wrong, report the weakness and propose a future versioned policy change.
Gate 1: Liquidity
Pass when both are true:
- 20-day average traded value >= NT$100 million.
- Latest daily traded value >= NT$30 million.
Gate 2: SEPA Trend Quality
Pass when:
- Trend score is 8 of 8.
- Price > 50MA.
- Price is within 25% of 52-week high.
- 60-day relative return vs TAIEX is positive.
The eight trend conditions:
- Price > 150MA and Price > 200MA.
- 150MA > 200MA.
- 200MA rising for roughly one month.
- 50MA > 150MA and 50MA > 200MA.
- Price > 50MA.
- Price >= 30% above 52-week low.
- Price within 25% of 52-week high.
- 12-month relative strength beats TAIEX.
Gate 3: Revenue and Earnings Momentum
Primary pass, when Q financial data is available:
- Latest monthly revenue YoY >= 10%.
- Latest cumulative YTD revenue YoY >= 10%.
- Latest quarter EPS > 0.
- Latest quarter operating margin >= 5%.
Fallback, when Q financials are unavailable but revenue exists:
- YTD revenue YoY >= 20%, or
- Latest monthly revenue YoY >= 30%.
Revenue-only fallback can qualify a stock for WATCH, but not QUALIFIED.
Gate 4: Growth-Adjusted Valuation
Pass when:
- PE is positive.
- PE <= 50.
- PE / growth_proxy <= 1.5.
Use sustained growth, not whichever single month looks best. Prefer YTD revenue YoY capped at 80%. Do not use latest monthly revenue YoY alone for valuation.
Gate 5: Extension Risk
Pass when:
- Price is no more than 18% above 50MA.
- Price is no more than 35% above 150MA.
- RSI14 <= 75.
- Price is not limit-up or parabolic on the latest day.
This is the gate that separates "good company" from "high precision entry."
Veto Layer
Veto or downgrade when any applies:
- Latest-day or recent multi-day vertical move makes entry price unbounded.
- 10-trading-day return > 35%, unless the stock has since consolidated.
- RSI14 > 85.
- Price is more than 35% above 50MA.
- Cyclical commodity/pricing thesis appears near peak earnings.
- Narrative is crowded while revenue/earnings quality does not confirm.
- Data quality is too weak.
Data Cutoff Rules
Historical as_of runs must not use future information.
Price and volume:
- Use yfinance OHLCV only up to
as_of. - Listed tickers use
.TW; OTC tickers use.TWO. - Benchmark is
^TWII.
Monthly revenue:
- Current listed:
https://openapi.twse.com.tw/v1/opendata/t187ap05_L - Current OTC:
https://www.tpex.org.tw/openapi/v1/mopsfin_t187ap05_O - Historical listed:
https://mopsov.twse.com.tw/nas/t21/sii/t21sc03_<roc_year>_<month>_0.html - Historical OTC:
https://mopsov.twse.com.tw/nas/t21/otc/t21sc03_<roc_year>_<month>_0.html
Cutoff rule:
- Treat monthly revenue for month M as available from day 11 of the next month.
- Example:
as_of=2026-03-31may use February 2026 revenue, not March 2026 revenue.
Quarterly financials:
- Use only rows whose report date is on or before
as_of. - Do not use current Yahoo trailing EPS as historical evidence.
Information overlay:
- Every source used for a historical run must have been public by
as_of. - If publication date is unclear, do not use the source to promote a stock.
Information Overlay
Apply after the mechanical screen, not before.
Only baseline WATCH names are eligible for promotion to INFO_CONFIRMED.
Never promote:
PASSVETODATA_GAP- Any stock whose only evidence appears after
as_of
Promote a WATCH name only when:
- Evidence is company-specific.
- Evidence confirms the actual screened thesis.
- Evidence was public by
as_of. - It is not contradicted by revenue, margins, guidance, or customer demand.
- Extension/crowding risk remains acceptable.
Good evidence:
- MOPS investor conference decks.
- Company IR presentations.
- Monthly revenue commentary.
- Exchange filings.
- Credible financial news about orders, customer/product mix, capex, shipment schedule, pricing, margins, or guidance.
- High-signal public investor discussion with concrete thesis details.
Bad evidence:
- Generic sector optimism.
- Pure price-chasing social posts.
- Repeated headlines with no new information.
- Undated snippets.
- Hindsight summaries.
Output Contract
Human reports should lead with:
as_ofdate, data vintage, benchmark close.QUALIFIEDcandidates.INFO_CONFIRMEDcandidates.WATCHcandidates.- Watchlist/user-specified status.
- Veto/pass/crowding warnings.
- Caveats and data gaps.
Minimum table columns:
- Ticker
- Name
- Status
- Confidence
- Close
- Trend score
- Latest monthly revenue YoY
- YTD revenue YoY
- EPS / operating margin when available
- PE
- Extension from 50MA
- Main reason
When information overlay is applied, also include:
- Information status.
- Evidence date/source.
- Thesis confirmed.
- Crowding risk.
Default Universe
The default universe is Taiwan AI and upstream supply-chain equities.
Categories:
- Semiconductors, IP, design, OSAT, memory.
- AI server, ODM, systems.
- Power, thermal, mechanical, passives.
- PCB, CCL, substrate, upstream materials.
- Cleanroom, equipment, materials.
- Network, optical, connectors, cables.
Watchlist and one-run --include tickers are always merged into this universe.
Add stocks only when they plausibly connect to AI infrastructure, semiconductors, PCB/CCL, memory/storage, thermal/power, cleanroom/equipment, networking/optics, connectors, or related upstream inputs.
Progressively Reverse Training
Progressively Reverse Training is the new interactive mode.
It is designed for strategy learning, not one-off stock picking. The agent asks the user for a strategy idea, freezes it into a versioned hypothesis, then evaluates it on historical snapshots where the future answer is masked.
Core Mechanism
For each training round:
- Select a past
as_ofdate, usually three months before the evaluation date. - Build the stock state exactly as it was known on
as_of. - Hide all future returns, future revenue, future filings, future news, and future social discussion.
- Run the frozen policy and commit predicted positives.
- Reveal the forward three-month outcome.
- Compute precision and recall.
- Diagnose false positives and false negatives.
- Discuss changes with the user.
- Freeze the next policy version before the next round.
Initial Questions
Before running the mode, ask the user:
- What market/universe should the strategy target?
- What is the expected holding horizon? Default: three months.
- What counts as "went up"? Default: forward 3-month return >= 20%, or forward 3-month excess return vs TAIEX >= 10%.
- Which statuses count as predicted positives? Default:
QUALIFIED + INFO_CONFIRMED. - What strategic intuition should we test?
- Should qualitative information overlay be allowed, and if so, what source types are allowed?
Then summarize:
policy_version: prt-YYYYMMDD-vN
universe:
as_of_dates:
prediction_statuses:
forward_window:
positive_label:
gates:
vetoes:
manual_overlay_allowed:
excluded_data:
If the policy includes new subjective criteria, ask the user to approve the frozen version before testing.
Masking Rules
Allowed before prediction:
- OHLCV up to
as_of. - Moving averages and technical indicators computed only from pre-
as_ofdata. - Monthly revenue that would have been published by
as_of. - Quarterly reports with report dates on or before
as_of. - Dated MOPS/IR/news/social evidence published on or before
as_of.
Forbidden before prediction:
- Future price returns.
- Later monthly revenue.
- Later filings.
- Later investor conference decks.
- Later news or social discussion.
- Current Yahoo trailing/forward metrics used as historical evidence.
- Any threshold change after seeing outcomes.
Metrics
The primary target is precision.
TP = predicted positive and future outcome is positive
FP = predicted positive but future outcome is not positive
FN = not predicted positive but future outcome is positive
TN = not predicted positive and future outcome is not positive
precision = TP / (TP + FP)
recall = TP / (TP + FN)
false_discovery_rate = FP / (TP + FP)
coverage = (TP + FP) / evaluated_universe_count
The system should optimize precision first. Recall is useful for understanding what the strategy misses, but the stated goal is: when the system says "this will likely rise," the hit rate should be high.
Recommended targets:
- Minimum before trusting a policy: at least 20 predicted positives across rounds, or label the result provisional.
- Strong precision: >= 70%.
- Excellent precision: >= 80%.
- Recall should only be optimized if precision stays above the selected threshold.
Failure Review
For false positives, classify:
- Extension/crowding risk underestimated.
- Revenue did not become earnings or margin expansion.
- Cyclical pricing was near peak.
- News confirmed company quality but not a 1-3 month catalyst.
- Valuation was too full.
- Data cutoff/source quality was weak.
For false negatives, classify:
- Trend gate too strict.
- Valuation gate too strict.
- Catalyst visible only in qualitative sources.
- Stock outside universe.
- Missing/illiquid data.
- Move was event-driven and outside strategy scope.
Only promote a lesson into the next policy version if it explains multiple examples or a high-conviction edge. Do not add one-off exceptions to beautify the last score.
Progressively Reverse Training Report
Each report should include:
- Frozen policy version.
as_ofdates and cutoff rules.- Prediction table before outcomes.
- Revealed outcome table.
- Precision/recall metrics.
- False-positive review.
- False-negative review.
- Proposed next policy version.
- Whether the result is provisional or sample-backed.
Use direct language:
- "This version produced high recall but weak precision, so it is not acceptable for the stated goal."
- "This policy is promising but under-sampled."
- "The next version should add an extension veto instead of loosening the whole model."
Example Agent Prompts
Screen today:
Use tw-precision-stock-screener to screen Taiwan stocks for high-precision candidates as of today. Include the persistent watchlist and explain QUALIFIED, INFO_CONFIRMED, and WATCH separately.
Historical cutoff-safe screen:
Use tw-precision-stock-screener as of 2026-03-31. Do not use any April or later data. Include 5536, 2308, and 3443. Explain which data was available by the cutoff.
Add tracked stocks:
Add 1815, 5536, 2327, and 8299 to the screener watchlist, then run the current screen.
Progressively Reverse Training:
Use Progressively Reverse Training. I want to test a strategy: find Taiwan AI supply-chain stocks that are not yet crowded but have strong revenue acceleration and acceptable entry risk. Use a three-month forward window and optimize for precision.
Setup Checklist for the Friend's Agent
Before saying the skill is ready:
- Package downloaded and checksum verified.
- Skill extracted into the correct skills directory.
- Python venv created under
~/.codex/state/tw-precision-stock-screener/.venv. - Dependencies installed.
screen.py --helpworks.- A watchlist add/list command works.
- A small historical screen works.
- The agent has read
SKILL.md,filter-policy.md,data-sources.md,information-overlay.md,output-contract.md, andprogressive-reverse-training.md. - TradingView sync is either configured or explicitly marked unavailable.
Common Mistakes
- Treating
WATCHas a buy. - Using current Yahoo fields in a historical run.
- Optimizing recall first and calling the result high precision.
- Changing thresholds after seeing outcomes.
- Promoting a stock because the sector is hot, without company-specific evidence.
- Ignoring extension risk because fundamentals are strong.
- Assuming Marcus's TradingView browser profile exists in another user's machine.
Handoff Summary
This skill is best understood as a precision-first research harness:
- Mechanical screen first.
- Information overlay second.
- Watchlist always included.
- Historical runs must be cutoff-safe.
Progressively Reverse Traininglets the user and agent turn strategy intuition into versioned, masked backtests.- Precision is the north-star metric; recall is a secondary diagnostic.
If the friend wants to adapt it to another market, create a new skill fork. Do not quietly reuse Taiwan-specific MOPS/TWSE/TPEX assumptions for non-Taiwan equities.