Oracle3
Oracle3: 예측시장 거래 엔진·MCP 서버
AI-based stock analysis and trading system
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗AI-Powered Stock Market Analysis & Trading System
13+ specialized AI agents collaborate to detect surge stocks, generate analyst-grade reports, and execute trades automatically.
AI3, creator of WrksAI - the AI assistant for professionals, proudly sponsors PRISM-INSIGHT - the AI assistant for investors.
Past results? We don't take them. Every Stance record starts at registration — no uploaded track records, no backfills. Decisions and outcomes build one continuous public record that shows a strategy's actual skill and risk, not a cherry-picked highlight reel. Rankings are split into KRX and US and show return beside worst drawdown, average invested exposure, and record rate.
See the live leaderboard · Enter my strategy · Read the quickstart
Open your strategy project in Codex CLI, Cursor, Claude Code, or another coding agent, then paste the instruction copied from the Stance dashboard into its chat. The agent finds separate strategies and KRX/US portfolios, asks only for missing public profile details, shows the registration plan, and proceeds only after your approval. It also stores keys, changes the code, and runs tests.
Your strategy appears under Building a record from its first decision. For stock markets, official ranking begins after 63 trading days and 20 closed trades that each used at least 1% of assets. The record starts on connection day; historical results cannot be backfilled. No live brokerage account, balance, or broker key is required.
No API key? No problem. PRISM-INSIGHT now supports running analysis directly through your ChatGPT Plus ($20/mo) or Pro ($200/mo) subscription via the Codex OAuth Proxy.
# One-time login (browser will open for ChatGPT auth)
python -m cores.chatgpt_proxy.oauth_login
# Re-authenticate (switch account, or refresh expired tokens)
python -m cores.chatgpt_proxy.oauth_login --force
# Run with your ChatGPT subscription
PRISM_OPENAI_AUTH_MODE=chatgpt_oauth python stock_analysis_orchestrator.py --mode morning
Tokens auto-refresh in the background, so you only need to log in again if you change ChatGPT accounts or your password.
Zero API bills. Same powerful analysis. Your existing subscription does the work.
Get AI stock analysis on the go
See AI trading performance in real-time: analysis.stocksimulation.kr
Get daily surge stock alerts and AI analysis reports:
Watch an AI-generated Apple Inc. analysis report:
The fastest way to try PRISM-INSIGHT. Only requires an OpenAI API key.
# Clone and run the quickstart script
git clone https://github.com/dragon1086/prism-insight.git
cd prism-insight
./quickstart.sh YOUR_OPENAI_API_KEY
This generates an AI analysis report for Apple (AAPL). Try other stocks:
python3 demo.py MSFT # Microsoft
python3 demo.py NVDA # NVIDIA
python3 demo.py TSLA --language ko # Tesla (Korean report)
Get your OpenAI API key from OpenAI Platform
Optional: Add a Perplexity API key to
mcp_agent.config.yamlfor news analysisOptional: Add
ADANOS_API_KEYto enrich US stock news analysis with structured social sentiment context
Your AI-generated PDF reports will be saved in prism-us/pdf_reports/.
# 1. Set your OpenAI API key
export OPENAI_API_KEY=sk-your-key-here
# 2. Build and start the local quickstart image
docker compose -f docker-compose.quickstart.yml up --build -d
# 3. Run analysis
docker exec -it prism-quickstart python3 demo.py NVDA
The first run builds the image locally, so it may take several minutes.
Reports will be saved to ./quickstart-output/.
# 1. Clone & Install
git clone https://github.com/dragon1086/prism-insight.git
cd prism-insight
pip install -r requirements.txt
# 2. Install Playwright for PDF generation
python3 -m playwright install chromium
# 3. MCP servers (Firecrawl, Perplexity, ...) start on demand via npx/uv,
# as listed in mcp_agent.config.yaml — no separate install step
# 4. Setup config
cp mcp_agent.config.yaml.example mcp_agent.config.yaml
cp mcp_agent.secrets.yaml.example mcp_agent.secrets.yaml
cp trading/config/kis_devlp.yaml.example trading/config/kis_devlp.yaml
# Edit mcp_agent.secrets.yaml with your OpenAI API key
# Edit trading/config/kis_devlp.yaml with your KIS API keys (Korean market data)
# 5. Run analysis (no Telegram required!)
python stock_analysis_orchestrator.py --mode morning --no-telegram
US market analysis runs the same way:
# Run US analysis
python prism-us/us_stock_analysis_orchestrator.py --mode morning --no-telegram
# With English reports
python prism-us/us_stock_analysis_orchestrator.py --mode morning --language en
# After the config files from step 4 above are ready:
docker compose up -d
docker exec prism-insight-container python3 stock_analysis_orchestrator.py --mode morning --no-telegram
Full Setup Guide: docs/SETUP.md
PRISM-INSIGHT is a completely open-source, free AI-powered stock analysis system for Korean (KOSPI/KOSDAQ) and US (NYSE/NASDAQ) markets.
Models used in production (each can be changed in .env; see .env.example):
| Role | Default model |
|---|---|
| Report sections, strategy, summary, macro intelligence | OpenAI GPT-6 Luna (REPORT_MODEL) |
| Buy/sell decisions | OpenAI GPT-6.1 Sol (PRISM_BUY_CODEX_MODEL, PRISM_SELL_CODEX_MODEL) |
| Telegram Q&A | OpenAI GPT-6.1 Sol (TELEGRAM_ANALYSIS_MODEL) |
| Translation (EN, JA, ZH, ES), trading journal | OpenAI GPT-6 Luna |
| Optional on-demand insight agent | Anthropic Claude Sonnet 5.5 (INSIGHT_MODEL) |
Everything runs on an OpenAI API key or a ChatGPT Plus/Pro subscription (Codex OAuth).
Agents are grouped by execution path rather than by a fixed count:
| Team | Agents | Purpose |
|---|---|---|
| Macro | KR / US | Leading sectors, risks, and events on top of the rule-based market regime |
| Stock analysis | 6 base sections per market | Technical, trading flows, company, industry, news, market |
| Strategy & summary | Created at run time | Turns the base sections into an investment strategy and key summary |
| Trading | KR / US buy and sell | AI scenarios combined with score, portfolio, and re-entry gates |
| Journal & memory | Review, compression, principles | Feeds closed-trade results into the next decisions |
| Communication & consultation | Evaluation, optimization, translation, follow-up | Telegram summaries and user conversations |
Details: Pipeline architecture (KO) | AI agent system
We show two measures of the same closed trades:
| Korea (Season 2) | US | |
|---|---|---|
| Period | 2025-09-30 ~ 2026-10-02 | 2026-01-28 ~ 2026-10-02 |
| Closed trades | 211 | 127 |
| Win rate | 40.3% (85 wins) | 33.1% (42 wins) |
| Average return per trade | +1.68% | +0.65% |
| Sum of per-trade returns | +355.3% | +82.8% |
| 10-slot account return | +35.2% | +8.3% |
| Largest drop of the account curve | −9.3%p | −13.7%p |
| Same-period index | KOSPI +103.5% (3,431 → 6,982)KOSDAQ +5.3% (847 → 892) | S&P 500 +10.8% (6,969 → 7,723)Nasdaq +14.8% (23,685 → 27,191) |
| Best closed trades | Samsung Electro-Mechanics +86.8%SK hynix +73.8%SK Square +57.6% | Micron +105.7%, Micron +52.8%IBM +27.0% |
The account trailed KOSPI in this period, and we want to be upfront about it. KOSPI roughly doubled while KOSDAQ rose about 5%, a rally led by large-cap semiconductor stocks. PRISM's own exit review (October 2026) found the biggest gap: in Korean trades that rose 30% or more within 60 trading days of entry, the median realized gain was +2% while the median peak gain was +60%. The system was selling its leaders too early. The changes in the next section target exactly that, and we will keep publishing both measures so the effect can be checked.
Source: live dashboard data (KR, US), generated 2026-10-02 (KR) and 2026-10-03 KST (US). Index changes are measured from the first point of the dashboard curve (KR 2025-09-29, US 2026-01-29). Open positions are excluded. Simulated results, not investment advice.
The direction. PRISM follows O'Neil-style trend following. Most trades are kept small and cut quickly, and the account is meant to grow in steps from a few stocks that make big moves. Trading more raises the chance of finding those stocks, but repeated stop-losses can drain the account, so the core skill is screening and buying the right stocks.
| Step | What happens |
|---|---|
| 1. Screening | Morning and afternoon triggers pick stocks with unusual price and volume momentum. Each trigger gets a quality weight (0.7–1.3) from PRISM's own last 180 days: how often its candidates reached +20%, and the average realized result. Weak triggers no longer get a guaranteed final spot. |
| 2. AI analysis | Specialized agents write the report (technicals, trading flows, financials, industry, news, market), then an investment strategy. |
| 3. Buy decision | The buy agent scores the setup from 1 to 10 against a written rubric: fundamentals (profitability, balance sheet, growth, business clarity), momentum signals, and a trend check. An entry also needs the minimum score for the current market regime, a risk/reward floor, and a stop-loss no wider than the regime limit (−5% to −7%). |
| 4. Small first buy | The account is split into 10 equal slots. A new position starts at 30–80% of one slot, sized by the stock's volatility; high-scoring setups from the strongest triggers start a step larger. |
| 5. Scenario adds | At entry, the AI writes 2–4 add scenarios (for example a breakout, or a pullback that recovers) and updates them every day. Code buys more only when a scenario's conditions are met, only above the average cost, never more than the previous buy, within the original risk budget, and up to one full slot. A confirmed strong move (8% above entry on 1.5× normal volume, after a first add that day) can add a second time in the same session. |
| 6. Leader hold | A stock that closes 20% above its first buy price within 4–15 trading days, without being stretched far above its 50-day average, is treated as a leader. For up to 40 trading days it is sold only if it closes below the 50-day line or falls below the first buy price. Stocks that jump 20% in 1–3 days keep the normal profit-protection stops. |
| 7. Re-entry | A stock that was stopped out, or skipped because of its price location, is watched for up to 60 trading days. If it reclaims its key level shortly before the close (KR 14:00, US 13:50), an AI re-check must approve the buy. Up to 3 attempts in each watch period, and at most 2 re-entry orders per market per day. |
| 8. Review loop | A weekly leader report tracks big-winner capture, missed winners, stop-loss cost, and results by trigger. A two-week review (Oct 18, 2026) judges each October change against the same yardsticks. |
Most of these changes went live between Oct 2 and Oct 4, 2026, and Oct 6 is the first trading day under all of them, so the Season 2 numbers above mostly predate them. Design notes (Korean): direction · trigger priority · small first buy · scenario adds · leader hold · re-entry · weekly report · two-week review
The Korean-market history shows two opposite failure modes: avoiding too many entries, then taking risk without enough state control. The releases from v1.16.7 through v2.18 progressively moved the system from prompt-level bias correction to deterministic regime, exit-state, and re-entry safeguards.
The figures are diagnostic. Cumulative return is the sum of trade-level return rates, while outcomes for unentered candidates are post-hoc observations—not a time-weighted portfolio return or a realizable backtest.
Before a rule changes, PRISM replays it on its own past candidates and trades, and the conclusion goes into a lessons ledger so the same question is not tested twice.
Dropped (did not beat the current rules):
Adopted:
Full ledger (Korean): docs/RESEARCH_LESSONS_ko.md
| Document | Description |
|---|---|
| docs/SETUP.md | Complete installation guide |
| docs/CLAUDE_AGENTS.md | AI agent system details |
| docs/PIPELINE_ARCHITECTURE_ko.md | Screening → analysis → trading → feedback design (KO) |
| docs/TRIGGER_BATCH_ALGORITHMS.md | Surge detection algorithms |
| docs/TRADING_JOURNAL.md | Trading memory system |
| docs/TRADING_CHANGE_REVIEW_HARNESS.md | Investment direction and the review checklist for trading changes (KO) |
| docs/RESEARCH_LESSONS_ko.md | Research lessons ledger: what was tested, kept, and dropped (KO) |
| docs/TRIGGER_QUALITY_PRIORITY_ko.md | Trigger priority from PRISM's own record (KO) |
| docs/micro-split/B3_LIVE_ko.md | Small first buy and live position building (KO) |
| docs/micro-split/ADD_SCENARIOS_DESIGN_ko.md |
Real-time portfolio tracking and performance dashboard.
cd examples/dashboard
npm install
npm run dev
# Visit http://localhost:3000
Features: Portfolio overview, trading history, performance metrics, market selector (KR/US), return comparison vs KOSPI/KOSDAQ
Dashboard Setup Guide: examples/dashboard/DASHBOARD_README.md
cores/market_data)git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Code contributors — thank you to everyone who has improved PRISM-INSIGHT:
@dragon1086 · @rocky-mun · @tkgo11 · @alexander-schneider · @bonggu-kang · @willagio · @lifrary · @cjinzy · @don9x2E · @jk5745 · @sungwoowi
Gold Supporter — @tkgo11
Thank you for supporting the project.
Dual Licensed:
Free under AGPL-3.0 for personal use, non-commercial projects, and open-source development.
Separate commercial license required for SaaS companies.
Contact: [email protected] Details: COMMERCIAL-LICENSE.md
Third-party open source components remain subject to their respective terms. See THIRD_PARTY_NOTICES.md for notices, source links, and license texts.
Analysis information is for reference only, not investment advice. All investment decisions and resulting profits/losses are the investor's responsibility.
Monthly operating costs (as of January 2026, ~$313/month):
Currently serving 450+ users for free.
If this project helped you, please give us a Star!
Contact: GitHub Issues | Telegram | Discussions
| AI add scenarios and fast adds (KO) |
| docs/RUNNER_HOLD_RULE_ko.md | Leader hold rule (KO) |
| docs/REENTRY_V3_LIVE_ko.md | Re-entry rules (KO) |
| docs/WEEKLY_RUNNER_REPORT_ko.md | Weekly leader report (KO) |
| docs/TWO_WEEK_REVIEW_ko.md | Two-week review of the October changes (KO) |