How mars-tw/anti-gambling-trader-tw works
反詐投資王 is a local-first trading-record analyzer and anti-scam toolkit, with a secondary strategy/scaffold generator for automated trading projects. The primary workflow is: a trader supplies records or screenshot/chat evidence; the CLI routes it through parsing and normalization; statistical and domain analyses produce a conservative verdict and report. Other documented branches cover scam-text and guru-claim checks, return forensics, risk simulation, and strategy scaffolding. Edges are grounded in the README or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: cli.py Command interface · analyzer.py Analysis coordinator · performance.py Performance metrics · loader.py Record loader
Components 24
User entry
- Command interface
core/cli.py - Screenshot review
core/ingest/screenshot.py
Trade analysis
- Record loader
core/ingest/loader.py - Trade records
core/models.py - Market rules
core/markets.py - Analysis coordinator
core/analyzer.py - Performance metrics
core/metrics/performance.py - Significance tests
core/verdict/statistics.py - Verdict engine
core/verdict/judge.py - Out-of-sample check
core/backtest/validate.py - Strategy breakdown
core/strategy/per_tag.py - Experience stage
core/onboarding.py - HTML report
core/report_html.py
Scam checks
- Chat scanner
core/antiscam/text_scanner.py - Guru claim check
core/antiscam/guru_claim.py - Return forensics
core/forensics/analyzer.py - Survivorship model
core/survivorship.py
Additional insights
- Time trends
core/trend/timeline.py - Risk simulation
core/montecarlo/simulate.py
Trading projects
- Strategy skeleton
core/strategy/skeleton.py - Project generator
core/scaffold/generator.py - Broker templates
core/broker/registry.py - Chart options
core/charts/registry.py
Other components
- Trader
Connections 33
- Trader → Command interface: runs commands
- Command interface → Record loader: loads records
core/cli.py - Command interface → Screenshot review: routes screenshots
core/cli.py - Command interface → Chat scanner: routes chat scans
core/cli.py - Record loader → Trade records: normalizes trades
core/ingest/loader.py - Record loader → Market rules: infers markets
core/ingest/loader.py - Command interface → Analysis coordinator: starts analysis
core/cli.py - Analysis coordinator → Record loader: loads input
core/analyzer.py - Analysis coordinator → Performance metrics: computes metrics
core/analyzer.py - Analysis coordinator → Verdict engine: requests judgment
core/analyzer.py - Analysis coordinator → Out-of-sample check: validates holdout
core/analyzer.py - Analysis coordinator → Strategy breakdown: breaks down tags
core/analyzer.py - Analysis coordinator → Strategy skeleton: builds strategy
core/analyzer.py - Performance metrics → Trade records: reads trades
core/metrics/performance.py - Performance metrics → Market rules: uses market data
core/metrics/performance.py - Verdict engine → Performance metrics: uses metrics
core/verdict/judge.py - Verdict engine → Significance tests: tests expectancy
core/verdict/judge.py - Out-of-sample check → Performance metrics: summarizes segments
core/backtest/validate.py - Out-of-sample check → Significance tests: tests segments
core/backtest/validate.py - Command interface → Experience stage: checks stage
core/cli.py - Command interface → HTML report: outputs report
core/cli.py - Command interface → Guru claim check: checks claim
core/cli.py - Guru claim check → Significance tests: uses probability tests
core/antiscam/guru_claim.py - Guru claim check → Survivorship model: models chance
core/antiscam/guru_claim.py - Command interface → Return forensics: runs forensics
core/cli.py - Command interface → Survivorship model: checks survivorship
core/cli.py - Command interface → Time trends: requests timeline
core/cli.py - Command interface → Risk simulation: runs simulation
core/cli.py - Command interface → Project generator: generates project
core/cli.py - Project generator → Broker templates: selects broker
core/scaffold/generator.py - Project generator → Chart options: selects chart
core/scaffold/generator.py - Command interface → Broker templates: lists brokers
core/cli.py - Command interface → Chart options: lists charts
core/cli.py