Skip to content

Latest commit

 

History

207 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartMoney-Cub

SmartMoney-Cub

Python License: MIT Read-only No financial advice Human-in-the-loop Agent-ready

SmartMoney-Cub is a local-first trading review and rule evolution engine for individual traders and AI agents. It writes your journal and keeps market and execution access strictly read-only. Import a blotter or connect an agent to run the 30-second trade checkup and point-in-time evaluation, then sign the evidence, observe challenger rules in silent Shadow, and decide whether to promote them.

READ_ONLY_NO_ORDER_NO_CANCEL_NO_TRADE

简体中文 · v1.2.0 release

SmartMoney-Cub bilingual cover

Why SmartMoney-Cub

A trading journal tells you what you traded, and a chat assistant can help you reflect on it. SmartMoney-Cub connects each review to the original fills, the evidence available at the time, and an explicit human decision about what to change.

  1. 30-second blotter checkup. Drop CSV, TSV, XLSX or PDF into the local Web Workbench. For screenshots, use Import with the optional local OCR engine, confirm the extracted fills, then run the checkup on workspace fills. Decimal FIFO reconstructs each PositionEpisode from opening through partial fills to flat and identifies positions that remain open. The seven-dimension institutional attribution matrix covers stock selection, entry timing, initial sizing, scaling in, size adjustment, scaling out, and exit timing. It flags missing market, benchmark, NAV, or fee evidence and leaves unsupported metrics blank. Review closed-trade disposition patterns, post-loss sizing tilt, overtrading bursts, and profit giveback where evidence supports it. The small-sample style profile reports counts, medians, and interquartile ranges. Episode analysis and evidence inputs

  2. Point-in-time scientific evaluation v2. Decision-time market inputs require 13 provenance fields and enforce bar_end_at <= available_at <= decision_asof. The outcome simulator uses next_open_sim, rejects opens that gap beyond the invalidation boundary, and latches CN-A T+1 exits until the first eligible sellable open. Triple Barrier records the take-profit, stop-loss, or time-limit outcome. Reports show net excess return, R-multiple, and risk-scaled excess. They report process quality, outcome quality, probability calibration, and execution trust separately. v1.2.0 changelog

  3. Verifiable evidence and human-governed rule evolution. capture-run probes macOS sandbox-exec or Linux bwrap to block network access, restrict writes to the work directory, and block reads of protected credential paths. A missing or failed probe is recorded as declarative with verification false. --sandbox selects the artifact output directory. evidence_pack.sha256 seals pack integrity, and the optional [signing] extra adds Ed25519 signatures verified against a pinned public key. The SQLite task ledger records steps and recovery checkpoints.

    The offline RSI loop uses a closed dsl.v2 interpreter with zero eval, and an atomic Holdout ledger rejects overlapping samples and consumes sealed access once. Silent Shadow requires both minimum trading days and aligned events, plus effect and risk checks. Signed human confirmation authorizes cutover or rollback through the SQLite promotion authority, which updates the v2 champion and its audit records in one transaction. RSI and promotion governance

  4. CLI-only agent integration and MycEvo export. Install the skill with smcub skill install --target codex, or use claude or deepseek-harness as the target. The skill uses 18 stable top-level JSON CLI commands and prohibits direct access to SQLite, credentials, and raw attachments. The redacted v2 bridge verifies and replays signed evidence locally, then exports allowlisted aggregates and provenance digests to an authorized destination for MycEvo review with promotion_performed=false.

30-second quickstart

1. Traders · Open the local Web Workbench

If you already installed the Python package, launch the workbench in one line.

smcub workbench

Open http://127.0.0.1:8787 if the browser stays closed. In Import, try the blotter checkup or import fills for later review. Install the wheel with the [ocr] extra for local PDF parsing and screenshot or scanned-PDF OCR.

For a fresh install, download the wheel from GitHub Releases v1.2.0 and install it with python -m pip install ./smartmoney_cub_harness-1.2.0-py3-none-any.whl. The release also includes a source archive and an npm launcher tarball. The Python package is currently unavailable on PyPI. The public npm registry does not currently offer the launcher for npx smartmoney-cub. Use the release wheel and smcub workbench for a fresh install.

2. Developers and AI agents · Install the CLI and skill

The agent-agnostic offline core has zero required third-party Python dependencies. From a checkout, run the following in a Python 3.10+ virtual environment.

python -m pip install .
smcub --version
smcub doctor
smcub skill install --target codex
smcub loop --preset toy --agent-trigger "自进化"

Create an isolated environment with python -m venv .venv on macOS/Linux or py -m venv .venv on Windows. For pipx, pass the downloaded wheel to pipx install or use a tagged Git URL. Follow the versioning and upgrade guide for each release channel.

With your local journal and market slice in the documented JSON formats, run the v2 analysis and evaluation commands. Provide a synchronized --benchmark-source when you need excess return metrics. The v2 evaluation is a scientific preview. Promotion requires a sealed Holdout verdict and signed Shadow approvals.

smcub analyze-episodes review.json
smcub analyze-style review.json
smcub build-outcome --version v2 run --horizon d3 --price-source market.json
smcub evaluate-run --version v2 run --horizon d3
Replay an offline evidence pack with toy data

Run in a clean checkout. The fixed timestamp makes the toy run path predictable on the first invocation.

smcub capture-run --mode after-close --preset toy --sandbox --decision-time "2026-06-01T15:31:00+08:00"
smcub validate-envelope tmp/sandbox/20260601/20260601_153100-after-close/run_envelope.json
smcub build-outcome tmp/sandbox/20260601/20260601_153100-after-close --horizon d1 --price-source smartmoney_cub_harness:data/sample_prices.json
smcub build-evidence-pack tmp/toy-evidence-pack --sample tmp/sandbox/20260601/20260601_153100-after-close --rule-candidate examples/toy_strategy/sample_rule_candidate.json --horizon d1
smcub replay-evidence-pack tmp/toy-evidence-pack

For signed v2 evidence, install [signing], build with --pack-version v2 --signing-key, and replay with --trusted-key and --require-signature. Governance runbook

3. Teams · Self-host with Postgres

Use smcub trader serve --mode hosted with Postgres and authenticated platform identities for tenant-scoped journals. The deployment guide covers Docker Compose, managed Postgres, and systemd with nginx. See the Trader product guide and plugin integrations for deployment scope and optional extensions.

Safety and privacy

  • No trading authority. There is no broker connection for live execution, no automatic trading, and no order placement, cancellation, or account modification. The harness provides no stock picks or financial advice. Optional user-authorized account ingestion is read-only.
  • Human approval for Champion changes. Agents and plugins can propose Challenger rules. Champion cutover and rollback require explicit operator confirmation.
  • Original files stay within the local workbench or your chosen tenant deployment. Local import and OCR keep raw broker files on your machine. The core has no embedded LLM and runs offline. If you configure the optional review assistant, only redacted structured fields go to your chosen model provider.
  • Evidence must be timely and actionable as a review record. Non-silent observations carry invalidation, a time stop, give-up conditions, source, availability time, and data quality. Sources available after the decision time fail validation. Public examples use toy data.

smcub doctor reports READ_ONLY_NO_ORDER_NO_CANCEL_NO_TRADE. The same declaration is carried by manifests, decisions, outcomes, evaluations, and registries. Harness contract · Privacy

System flow and artifact contracts

SmartMoney-Cub bilingual system flow

Architecture · Run Envelope schema · Evidence Pack schema

Curated Open-Source Projects

Plugin installation requires per-item confirmation. The integration guide covers installation methods and review boundaries, including wbh604/UZI-Skill as a companion and TradingAgents as an optional adapter. Integrations · Plugin guide

Browse the Workbench plugin catalog

Market data

Project Upstream Install License Scope
AKShare https://github.com/akfamily/akshare pip install akshare MIT Read-only market and financial data for review.
TuShare Pro https://tushare.pro pip install tushare BSD-3-Clause Read-only market and financial data for review.
BaoStock http://www.baostock.com pip install baostock Apache-2.0 Read-only market and financial data for review.
East Money (efinance) https://github.com/Micro-sheep/efinance pip install efinance MIT Read-only market and financial data for review.
Yahoo Finance https://github.com/ranaroussi/yfinance pip install yfinance Apache-2.0 Read-only market and financial data for review.
Stooq 行情 https://github.com/pydata/pandas-datareader pip install pandas-datareader BSD-3-Clause Read-only market and financial data for review.
FRED 宏观数据 https://github.com/mortada/fredapi pip install fredapi Apache-2.0 Read-only market and financial data for review.
Tencent market snapshot https://gu.qq.com/ Built-in builtin Read-only market and financial data for review.

Performance and risk

Project Upstream Install License Scope
QuantStats https://github.com/ranaroussi/quantstats pip install quantstats Apache-2.0 Analytics and reports for review.
Empyrical Reloaded https://github.com/stefan-jansen/empyrical-reloaded pip install empyrical-reloaded Apache-2.0 Analytics and reports for review.
Pyfolio Reloaded https://github.com/stefan-jansen/pyfolio-reloaded pip install pyfolio-reloaded Apache-2.0 Analytics and reports for review.
Riskfolio-Lib https://github.com/dcajasn/Riskfolio-Lib pip install riskfolio-lib BSD-3-Clause Analytics and reports for review.
PyPortfolioOpt https://github.com/pyportfolio/pyportfolioopt pip install pyportfolioopt MIT Analytics and reports for review.
skfolio https://github.com/skfolio/skfolio pip install skfolio BSD-3-Clause Analytics and reports for review.

Research and evaluation

Project Upstream Install License Scope
pandas-ta-classic https://github.com/xgboosted/pandas-ta-classic pip install pandas-ta-classic MIT Analytics and reports for review.
pandas-market-calendars https://github.com/rsheftel/pandas_market_calendars pip install pandas-market-calendars MIT Analytics and reports for review.
Qlib factor evaluation https://github.com/microsoft/qlib pip install pyqlib MIT Analytics and reports for review.
vectorbt evidence checks https://github.com/polakowo/vectorbt pip install vectorbt Apache-2.0 Analytics and reports for review.
backtesting.py https://github.com/kernc/backtesting.py pip install backtesting AGPL-3.0 Analytics and reports for review.
Backtrader https://github.com/mementum/backtrader pip install backtrader GPL-3.0 Analytics and reports for review.
ZVT https://github.com/zvtvz/zvt pip install zvt MIT Read-only market and financial data for review.

Agent

Project Upstream Install License Scope
Multi-agent review multi-agent-trade-review Built-in builtin Challenger proposals and review observations.
Opposing-rule review smartmoney-cub/challenger-critic Built-in builtin Challenger proposals and counterexamples.
TradingAgents https://github.com/TauricResearch/TradingAgents git clone --depth 1 https://github.com/TauricResearch/TradingAgents Apache-2.0 Optional adapter for importing external analysis as evidence.
UZI-Skill https://github.com/wbh604/UZI-Skill git clone --depth 1 https://github.com/wbh604/UZI-Skill unverified Standalone companion for review evidence.
tick-stock-panel https://github.com/shy3130/tick-stock-panel git clone --depth 1 https://github.com/shy3130/tick-stock-panel unverified Read-only market and financial data for review.

Official API Gateway

SmartMoney-Cub official API gateway

alphatech.net.cn offers an OpenAI-compatible model endpoint at https://alphatech.net.cn/v1. The gateway is optional and grants no trading authority. Review assistant setup

License

MIT

Releases

Packages

Contributors

Languages