Skip to content

CortexReach/smart_octopus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Smart Octopus

๐Ÿ™ Smart Octopus ยท ่ชๆ˜Ž็š„็ซ ้ฑผ

The open-source, self-hosted AI equity desk โ€” your local Claude CLI is the brain, your repo is the body.

Eight arms across every market ยท ๅ…ซ่‡‚่งฆ่พพ๏ผŒๆดžๅฏŸๅ…จๅธ‚ๅœบ

English ยท ็ฎ€ไฝ“ไธญๆ–‡

๐Ÿš€ Quick Start ยท ๐Ÿ™ Why Smart Octopus ยท ๐Ÿ“ธ Product Tour ยท ๐Ÿง  The Claude Harness


Smart Octopus โ€” Claude-powered single-stock decision dashboard

๐Ÿง  Your local claude CLI is the analysis engine. Type a ticker and the agent runs a multi-lens skill, refutes its own thesis, and writes a research report. No model API keys to manage โ€” it runs on your Claude subscription.

โšก Self-hosted & private. Data never leaves your machine. Schedule the astock-* routines on your own cron, or fall back to the legacy GitHub Actions pipeline for headless / CI environments.

What is Smart Octopus?

Smart Octopus is a self-hosted research desk for the stock market that you run from your own repo โ€” no SaaS, no per-seat pricing, no data leaving your machine. It pulls multi-market data and news, hands the hard reasoning to an LLM agent, and ships a structured decision dashboard (score, trend, entry/exit, risk, catalysts, an action checklist) to WeCom, Feishu, Telegram, Discord, Slack, or email.

What makes it different from the dozens of "ChatGPT-reads-a-stock" scripts:

  • ๐Ÿง  Claude CLI is the brain. The web app drives your local claude CLI as a real agent harness โ€” skills, strategy YAML, and deterministic tools are the tentacles. Type a ticker; the agent runs the multi-lens astock-analyze skill and produces a report.
  • โšก No model keys, self-hosted. The web workstation and scheduled astock-* routines run on your local Claude CLI โ€” no per-call API bill, data stays local. A legacy LLM-provider pipeline (GitHub Actions / Docker / CI) remains for headless environments without an interactive claude login.
  • ๐ŸŒ Five markets, six channels. A-shares, HK, US, plus JP/KR โ€” quotes, K-lines, technicals, fund flow, chips, news, fundamentals โ€” delivered to six push channels out of the box.
  • ๐Ÿ” InkSift ๅขจ็ญ› screening engine. A built-in catalyst / price-action screener sifts the whole market for candidates, then the agent enriches the top names with quotes, fundamentals, and news.

The default brain is your local Claude CLI โ€” install Claude Code and log in (claude) once, and no model API keys are needed.

Option 1 โ€” Local Claude workstation (recommended ยท no model keys)

# Prereq: install the Claude CLI (Claude Code) and run `claude` to log in.
git clone https://github.com/CortexReach/smart_octopus.git && cd smart_octopus
pip install -r requirements.txt
cp .env.example .env             # data-source keys only โ€” no model keys required

python main.py --serve-only      # open http://127.0.0.1:8000, then type a ticker

The Home / Ask / Portfolio / AI-signals pages drive your local claude as the brain through the astock-* skills โ€” manual analysis, task progress, history, Markdown reports, backtest, paper portfolio, strategy editor, light / dark themes. The only optional key here is TICKFLOW_API_KEY (A-share index & market-breadth data). Details โ†’ harness guide ยท A-share usage.

Option 2 โ€” Scheduled Claude routines (your own cron / launchd)

scripts/astock/run_routine.sh premarket   # or: intraday | review | screen | analyze

Trading-day-gated; runs the matching astock-* skill headless via claude -p and logs to reports/astock/_cron/. Wire it to cron / launchd on a machine where claude is logged in โ€” this is the Claude-native replacement for a daily scheduler.

Option 3 โ€” Legacy LLM-provider pipeline (headless / CI ยท GitHub Actions)

For environments without an interactive claude login (GitHub Actions, Docker, plain CI), the original provider-based daily pipeline still ships. It needs one model API key + a push channel instead of the Claude CLI:

python main.py --stocks 600519,hk00700,AAPL   # provider pipeline, needs a model key in .env

Fork โ†’ add Secrets (one model key such as GEMINI_API_KEY / AIHUBMIX_KEY / any OPENAI_API_KEY-compatible service, one push channel, and STOCK_LIST) โ†’ enable Actions. Runs every trading day at 18:00 Beijing (cron: 0 10 * * 1-5). All model/provider and channel keys are documented inline in .env.example.

๐Ÿ™ Why Smart Octopus

๐Ÿ™ Smart Octopus Closed AI-stock SaaS A plain "LLM reads a stock" script
Open-source (MIT) โœ… โŒ usually โœ…
Self-hosted, data stays local โœ… โŒ โœ…
Zero-cost via GitHub Actions โœ… โŒ โŒ
Local Claude-CLI agent harness โœ… โŒ โŒ
No model API keys (Claude subscription) โœ… โŒ โŒ
5 markets (A / HK / US / JP / KR) โœ… partial partial
6 push channels built-in โœ… partial โŒ
Built-in market screener โœ… InkSift partial โŒ
Editable strategy YAML (16 built-in) โœ… โŒ โŒ
Web + desktop workstation โœ… varies โŒ

๐Ÿ“ธ Product Tour

InkSift screening engine
Single-stock analysis via the local Claude harness
Home ยท Claude harness โ€” type a ticker; the local claude brain runs a multi-lens analysis.
InkSift screening engine
InkSift ๅขจ็ญ› ยท Screening โ€” catalyst / price-action strategies sift the whole market.
Editable strategy YAML harness
Strategies โ€” 16 editable, declarative strategies the agent reads (built-in + custom YAML).
Copilot paper-trading and calibration
Copilot โ€” paper portfolio, floating P&L, and prediction-accuracy calibration.
๐ŸŒ— Prefer a light theme? There's a ๅฎฃ็บธ (rice-paper) mode too.
Smart Octopus light theme

๐Ÿง  The Claude Harness

Smart Octopus treats your local Claude CLI as the analysis engine and the repo as its harness:

  • Skills (.claude/skills/astock-*) โ€” pre-open watchlist, single-stock deep dive, intraday watch, post-close review, market screen, and strategy learning.
  • Strategy YAML (strategies/*.yaml) โ€” 16 declarative, editable strategies (MA cross, Chan theory, Elliott wave, trend, sentiment cycle, event-driven, growth, re-rating, hotspot, โ€ฆ) the agent reads at analysis time.
  • Tools (scripts/astock/*) โ€” quotes, market breadth, news, paper-trading, journaling, push โ€” each a deterministic JSON-in / JSON-out command the agent calls.

The web pages (Home / Ask / Screening / Copilot) are thin front-ends over this harness, so the same brain answers from the CLI, the API, the web, and scheduled agents. Details โ†’ Claude harness guide.

๐ŸŒ Markets & Channels

Coverage
Markets ๐Ÿ‡จ๐Ÿ‡ณ A-shares ยท ๐Ÿ‡ญ๐Ÿ‡ฐ Hong Kong ยท ๐Ÿ‡บ๐Ÿ‡ธ US ยท ๐Ÿ‡ฏ๐Ÿ‡ต Japan ยท ๐Ÿ‡ฐ๐Ÿ‡ท Korea
Data quotes ยท K-lines ยท technicals ยท fund flow ยท chip distribution ยท fundamentals ยท news
Sources TickFlow ยท AkShare ยท Tushare ยท Tencent ยท efinance ยท Baostock ยท Yahoo Finance โ€” priority + graceful fallback, field normalization
Push WeCom ยท Feishu ยท Telegram ยท Discord ยท Slack ยท Email (+ PushPlus / ServerChan)

A single data source failing degrades gracefully instead of taking down the whole analysis.

๐Ÿ—๏ธ Architecture

            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 Markets โ”€โ”€โ–ถโ”‚  Data providers  TickFlow ยท AkShare ยท Tushare ยท YF โ€ฆ  โ”‚
 News    โ”€โ”€โ–ถโ”‚  (priority + graceful fallback, field normalization)  โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                        โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 InkSift โ”€โ”€โ–ถโ”‚        Claude CLI harness  (skills ยท strategies)      โ”‚โ”€โ”€โ–ถ Decision dashboard
 screen     โ”‚   multi-lens analysis ยท risk gates ยท action checklist โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                        โ–ผ
   Web ยท Desktop ยท API  โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ  WeCom ยท Feishu ยท Telegram ยท Discord ยท Slack ยท Email

๐Ÿ—บ๏ธ Status

Shipped and running today:

  • โœ… Claude-CLI harness is the default brain โ€” web workstation + scheduled astock-* routines, no model keys
  • โœ… Five markets ยท seven data sources with priority fallback
  • โœ… Six push channels (WeCom / Feishu / Telegram / Discord / Slack / Email)
  • โœ… Web + Electron desktop workstation (analysis, backtest, paper portfolio, alerts, config)
  • โœ… Legacy LLM-provider pipeline retained for headless / CI (GitHub Actions zero-cost daily flow)
  • ๐Ÿงช InkSift ๅขจ็ญ› market screener โ€” experimental, improving
  • ๐Ÿ”ญ Exploring: richer JP/KR calibration, broader catalyst taxonomy

๐Ÿค Contributing

Issues and PRs are welcome. Keep changes focused, tested, and consistent with the existing contracts. If a change touches the report format or the web UI, attach before / after screenshots in the PR description. The contributor rules live in AGENTS.md.

โญ Star us

If Smart Octopus saved you an afternoon of wiring data sources and prompts together, give it a star โ€” it's the signal that keeps the project moving and helps others find it.

Star History Chart

๐Ÿ“„ License

MIT License ยฉ 2026 chenjiyong. Attribution to this repository in derivative work is appreciated.

โš ๏ธ Disclaimer

For learning and research only. Nothing here is investment advice. Markets carry risk; the authors are not liable for any losses incurred from using this project.


Questions or collaboration ยท cjy416940585@gmail.com ยท Issues

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors