尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證AI 驅動的交易日誌與自我檢視儀表板,用於交易後分析、結構化日誌、螢幕截圖檢視,以及長期績效分析。
AI 翻譯
AI-powered trading journal and self-review dashboard for post-trade analysis, structured journaling, screenshot review, and long-term performance analytics.
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
A post-trade reflection journal and analytics dashboard for SMC/ICT day traders — it reviews every chart, grades your process against your own rules, and learns your corrections. Not a signal app, not a bot, not financial advice.
Live demo: https://tradelenai.streamlit.app/ · runs in DEMO_MODE (cached AI, zero API spend).
Most journals store outcomes. TradeLens models the process behind them, with structure a generic journal can't express:檢視完整 README ↗A post-trade reflection journal and analytics dashboard for SMC/ICT day traders — it reviews every chart, grades your process against your own rules, and learns your corrections. Not a signal app, not a bot, not financial advice.
Live demo: https://tradelenai.streamlit.app/ · runs in DEMO_MODE (cached AI, zero API spend).
Most journals store outcomes. TradeLens models the process behind them, with structure a generic journal can't express:
flowchart LR
User([Trader]) --> UI["Streamlit UI<br/>pages + components"]
UI --> SVC["services/<br/>business logic"]
SVC --> AIC["ai_client.py<br/>single Anthropic wrapper"]
AIC -->|claude-opus-5| API[(Anthropic API)]
SVC --> DB[("SQLite<br/>SQLAlchemy + Alembic")]
SVC --> CHARTS["Plotly charts"]
CHARTS --> UI
Pages only render and call services; all business logic lives in services/, and all AI calls route through one audited ai_client.py (no page ever calls the API directly). Database access is SQLAlchemy 2.x over SQLite (Postgres-ready), with every schema change shipped as a reversible Alembic migration.
| Feature | What it does | Screenshot |
|---|---|---|
| New Trade | Log a trade with full SMC/ICT fields; killzone auto-fills from entry time | |
| Journal | Unified filterable table + inline trade detail with editable AI screenshot analysis | |
| AI Screenshot Analysis | Post-trade chart review from an uploaded image or a direct image URL; AI labels are editable before "Apply to Trade", and overrides are remembered | |
| Analytics | Tabs: Performance, Calendar, Weekly Review, Pattern Insights — equity curve, killzone edge, edge leak, consistency | |
| Pattern Insights | Deterministic, no-API-key insights that auto-load (best/worst killzone, costly mistakes, edge leak, HTF-bias alignment) with confidence labels | |
| Calendar | Real HTML month grid (teal/red tinted day cells) with a per-day trade drill-down | |
| Weekly Review | Deterministic weekly stats always shown; AI-written coach summary when a key is set | |
| Settings | CSV import/export, monthly AI cost dashboard |
git clone https://github.com/AyoubA05/tradelens-ai.git && cd tradelens-ai
pip install -r requirements.txt
python -m src.tradelens.db.init_db
alembic upgrade head # apply schema migrations to an existing DB
streamlit run src/tradelens/ui/app.py
The app is gated by a sign-in page. Configure it via Streamlit secrets / environment:
# .streamlit/secrets.toml (or .env)
TRADELENS_USERNAME = "demo" # secrets login (used until DB users exist)
TRADELENS_PASSWORD = "tradelens2025"
TRADELENS_INVITE_CODE = "your-code" # gates signup; omit to hide the signup form
demo / tradelens2025 while no accounts exist, so the public demo stays usable.TRADELENS_INVITE_CODE is set. Signup needs that invite code; passwords are bcrypt-hashed (never stored in plaintext). Username rules: 3–20 chars, letters/numbers/underscore.user_id; legacy trades (no owner) stay visible to everyone. See docs/secrets_setup.md.The New Trade form is organized into tabs (Timing → Market Context → Setup → Risk & Outcome → Psychology → Screenshot). Price levels default to empty and auto-calculate your planned/realized R; tick "Skip price levels" to enter P&L and R by hand. Double-submits and reruns are de-duplicated by a content fingerprint, and CSV import skips rows that already exist.
This app uses Anthropic. Add the key named ANTHROPIC_API_KEY:
ANTHROPIC_API_KEY = "your-key-here".streamlit/secrets.toml or .env, then restart.Settings → AI Status shows whether the key is detected, with step-by-step instructions. Prefer to explore first? Set DEMO_MODE=true and the whole app runs on cached AI output at zero API cost (see Demo Mode).
Six prompts power six features. Each is a locked contract in prompts/ — versioned, never rewritten in place, only extended. Every prompt below is also wrapped by a central correction few-shot block (<past_corrections>): the trader's most-repeated and most-recent label edits, de-duplicated and capped at ~800 tokens, injected into every call so the model converges on the user's labeling over time. The design goal across all six is the same: deterministic pre-processing in Python wherever possible, then a single well-shaped model call with a strict output contract the service can validate.
prompts/screenshot_v2.txt → services/vision.py)Problem: turn a raw chart image into structured, reviewable SMC/ICT labels after a trade has closed. Input: the resized chart (≤1024px, base64 JPEG), the trade context, and the active strategy profile. Output contract: a single JSON object — bias and confidence, market structure, BOS/CHoCH booleans, a list of key zones, and four SMC proposals (HTF bias, liquidity sweep, FVG, order block) that pre-fill editable widgets but are never auto-applied. Token strategy: one claude-opus-5 vision call; the image is downscaled before encoding to cap input tokens, and response_format=json_object removes parse retries. Malformed JSON is caught and surfaced as a typed error, never a crash.
prompts/journal_v1.txt → services/journal.py)Problem: produce a consistent, reflective write-up from confirmed labels so journaling isn't a blank page. Input: the trade dict plus the user-confirmed AI labels and strategy profile. Output contract: an 8-section markdown document — Trade Summary, Market Bias, Strategy Used, What Went Well, What Went Wrong, Missed Opportunities, Emotional Review, Improvement Plan — validated for presence and order before persistence. Token strategy: a single claude-opus-5 call; because the labels are already structured upstream, the prompt carries no image and stays text-light. The strict section contract means the UI can render the result verbatim with no post-processing.
prompts/grade_v1.txt → services/grading.py)Problem: grade process quality, not outcome — a winning trade can be a bad process and vice-versa. Input: the trade, the confirmed vision labels, and the strategy rules (or a generic ICT fallback). Output contract: JSON with a letter grade, numeric score, a one_line_verdict, and a rubric of exactly five dimensions (entry quality, risk management, exit quality, rule adherence, emotional control), each with its own score and note — all validated. Token strategy: a single claude-opus-5 call, like every other feature — grading is a bounded, rubric-shaped task, so the prompt stays small and the strict five-dimension contract is validated before anything is persisted.
prompts/weekly_v2.txt → services/weekly.py)Problem: summarize a week of trading into an actionable retrospective. Input: the last 7 days of trades with metrics, detected patterns, and the correction few-shot — all pre-aggregated in pandas so the model reasons over numbers, not raw rows. Output contract: a 5-section markdown report (What Worked, What Didn't, Killzone Review, Rule Adherence, Focus for Next Week), validated for completeness. Token strategy: a single claude-opus-5 call run at effort="high" with the thinking summary captured and shown in a "How the AI reasoned" expander. A zero-trade week short-circuits before any API call — no spend on empty input.
prompts/patterns_v2.txt → services/patterns.py)Problem: surface behavioral edges and leaks without hallucinating from sparse data. Input: a deterministic pandas pre-pass computes candidate statistics (killzone win rates, streaks, mistake clusters, rule-violation cost); only those numbers go to the model. Output contract: at most six JSON cards, each with an insight, an evidence stat, sample size, confidence, impact, and a suggested rule; cards under five samples are labeled "early signal — low sample." Token strategy: the deterministic pre-pass keeps the prompt small and grounds every claim in a real statistic, so a single claude-opus-5 call produces reflection, never prediction.
prompts/partner_v2.txt → services/partner.py)Problem: let a trader interrogate a completed trade conversationally, with a senior partner's SMC/ICT vocabulary — and never drift into giving signals. Input: the trade context, vision analysis, the prompt-cached strategy profile, the correction few-shot, and the trimmed chat history. Output contract: a conversational reply; a hard scope guard lives in the system prompt and a post-check replaces any signal-seeking answer with a redirect. Token strategy: the strategy profile is sent with cache_control so multi-turn conversations bill it at cache rates; history is trimmed to the last 10 turns with a running summary; the call runs at effort="medium". Per-conversation token and cost are displayed in the UI.
Set DEMO_MODE=true (env var or .streamlit/secrets.toml) and the entire app runs on cached, synthetic output:
services/demo.py) renders the dashboard, analytics, and calendar with zero database writes.tests/fixtures/demo_ai/), keyed by trade with a default fallback — zero API calls, zero spend, guaranteed by a short-circuit in ai_client._complete() before any network access.This is what the public deployment runs on, so visitors never spend the owner's API budget.
Post-MVP, intentionally out of scope today:
MIT. See LICENSE.