Agent Trading Journal

io.github.smizxe由 GitHub 帳號 smizxe 發布v0.1.0更新於 Oct 24, 2026

AI trading journal: your agent logs trades from chart screenshots and checks your own rules.

概覽

AI 產生的概覽

讓 AI 助理從圖表截圖記錄交易到本機 SQLite 交易日誌,依你自己的規則檢查,並檢視統計。

可以做什麼
提供 MCP 工具,透過引導式訪談把你的策略轉成自訂欄位與逐筆通過/不通過的規則清單,接著記錄、修改、查詢與刪除交易和工作階段,並附上截圖。它計算以 R 為單位的統計、規則遵守情況比較、經驗教訓與 Markdown 檢討匯出,可匯入多家平台的券商對帳單,並能啟動本機儀表板(連接埠 3777)。也提供針對自營交易公司式限制的風險檢查,例如單日虧損、最大回撤、每日交易次數與連續虧損次數。
適用情境
適合交易外匯、期貨、股票或加密貨幣,並希望由助理從截圖或對帳單完成繁瑣記錄、檢驗自己寫下的規則是否真正有效的人。可用於回測、前向測試與實盤工作階段,也支援自營交易公司挑戰的追蹤。
執行需求
透過 npx 以 stdio 本機程序執行,需要 Node.js 22 或更新版本,以及桌面版 MCP 用戶端(如 Claude Code、Codex CLI、Claude Desktop、Cursor 或 Windsurf)。不需要帳號或 LLM API 金鑰。資料存放在本機 SQLite 檔案與截圖資料夾中,可用 JOURNAL_DATA_DIR、JOURNAL_DB、JOURNAL_SCREENSHOTS、JOURNAL_PORT、JOURNAL_WEB 與 JOURNAL_LOCALES_DIR 設定。
安裝前請注意
它只做記錄與分析,不下單、不連線券商執行交易,也不提供建議;助理讀取圖表可能出錯,因此記錄值與規則檢查結果應人工核對與修改。交易、截圖與策略資料會寫入本機資料目錄,應做好備份並視為敏感資訊。儀表板僅綁定 127.0.0.1。槓桿交易風險很高。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Trading Journal,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Agent Trading Journal: an AI trading journal (MCP server) for Claude Code and Codex

[npm] [test] [License: MIT] [MCP] [Node]

Works with: Claude Code · Codex CLI · Claude Desktop · Cursor · Windsurf · any MCP client — Markets: forex, futures, stocks, crypto — Imports: MetaTrader 4/5, TradingView, IBKR, NinjaTrader, Tradovate and more

A trading journal your AI agent writes for you. Paste a chart screenshot into Claude Code, Codex or any MCP client. The agent reads it, fills in your strategy's fields, checks the trade against your rules, logs it, and attaches the image. A local dashboard shows what's working.

No forms, no LLM API key, no account. Everything stays on your machine in one SQLite file.

[Dashboard with synthetic demo data] Dashboard with generated demo data (npx agent-trading-journal demo). Not a real account.

Why this exists

Most "AI trading journals" are a web form plus a chatbot that reads your numbers afterwards. Two problems follow:

  1. Logging is the bottleneck. People stop journaling because entering trades by hand is tedious.
  2. Generic fields measure nothing specific. "Setup: A/B/C" doesn't tell you whether your rules work.

Here the agent is the data-entry clerk, and the journal is shaped by an onboarding interview about how you trade:

Typical AI journalAgent Trading Journal
Who enters tradesYou, in a formYour agent, from screenshots (or a broker statement)
How AI connectsThe app calls an LLM with your API keyMCP: your agent (Claude Code / Codex / …) is the AI
What is measuredFixed fields + free tagsFields and a rule checklist defined for your strategy
RulesNotesEach rule is pass/fail per trade → "E[R] when followed vs broken"
Skipped setupsNot trackedLogged and reviewed (was staying out right?)
Risk limitsRarelyProp-firm style guard: daily loss, max drawdown, trades/day, loss streak

Quick start

1. Connect it to your agent. Requires Node.js 22+.

Claude Code:

bash
claude mcp add journal -- npx -y agent-trading-journal

Codex CLI (~/.codex/config.toml):

toml
[mcp_servers.journal]command = "npx"args = ["-y", "agent-trading-journal"]

Claude Desktop, Cursor, or any other MCP client: add a stdio server with command npx and args ["-y", "agent-trading-journal"]. Run npx agent-trading-journal setup to print all the snippets.

2. Tell your agent: "Set up my trading journal."

It interviews you in your language: markets, risk rules, how you find bias, setups, entries, stops and targets, and when you don't trade. From your answers it proposes fields (what to measure on every trade) and rules (your entry checklist). You confirm, and it saves them. See docs/ONBOARDING.md for the full script.

3. Trade or backtest as usual. Paste screenshots and say "log this". Ask for "weekly review" or "pre-session check". Say "open the dashboard" to see it at http://localhost:3777.

Just looking? npx agent-trading-journal demo fills a separate demo journal and opens the dashboard.

What the agent can do (MCP tools)

AreaTools
Setupget_setup_status, get_onboarding_guide, set_profile, list_presets, import_preset, upsert_strategy, get_strategy, list_strategies, export_strategy
Accounts & riskupsert_account, list_accounts, check_risk
Journalstart_session, list_sessions, log_trade, update_trade, delete_trade, query_trades, get_trade, add_screenshot
Lessonsadd_lesson, update_lesson, delete_lesson, list_lessons
Analysisget_stats, run_sql_readonly, export_review (Markdown, Obsidian-friendly)
Importimport_statement: MetaTrader 4/5, TradingView, IBKR, ThinkorSwim, NinjaTrader, Tradovate, TopstepX, Webull, DAS, TradeZella, Tradervue, generic CSV
Dashboardstart_dashboard, stop_dashboard, dashboard_status

MCP prompts (slash commands in clients that support them): onboarding, log_trade_from_screenshot, weekly_review, pre_session_check. The same workflows are available through the get_workflow tool for clients without prompt support.

Concepts

  • Strategy: your plan (bias, setup, entry, stop, targets, management, no-trade conditions), plus:
    • Fields: per-trade variables you want to analyse (enum, bool, number, text). Every non-text field gets its own breakdown chart.
    • Rules: your checklist, each must or should. Rule adherence compares expectancy when all must-rules were followed against when at least one was broken.
    • Versions: when fields or rules change, the version bumps. Old trades keep the version they were logged under, and removed fields are archived, not deleted.
  • Session: a backtest, forward-test or live block on one symbol, optionally tied to an account.
  • R: result in multiples of planned risk. Stats are R-based, so they compare across instruments and account sizes.
  • Presets: presets/ has a starter template (for traders without a written strategy), a trend pullback and an opening-range breakout. They're starting points to edit, not recommendations.
  • Edge Score: an open 0–100 composite (docs/edge-score.md), withheld under 5 trades.

Data and configuration

Env varDefaultPurpose
JOURNAL_DATA_DIR~/.agent-trading-journalfolder with journal.db + screenshots/
JOURNAL_DB, JOURNAL_SCREENSHOTSinside the data diroverride either path
JOURNAL_PORT3777dashboard port (binds to 127.0.0.1 only)
JOURNAL_WEBunset1 = start the dashboard together with the MCP server
JOURNAL_LOCALES_DIR<data dir>/localesextra dashboard languages as <code>.json (docs/locales.md)

Back up by copying the data dir. run_sql_readonly and the SQLite file are yours to query.

CLI

text
agent-trading-journal [mcp]            MCP server on stdio (what MCP clients run)agent-trading-journal dashboard        dashboard at http://localhost:3777agent-trading-journal demo             demo data in a separate dir + dashboardagent-trading-journal import <file> --account <name> [--strategy <slug>] [--dry-run]agent-trading-journal setup            config snippets for Claude Code / Claude Desktop / Codex

Safety

This is a journaling and analysis tool. It does not place trades, connect to brokers for execution, or give financial advice. Leveraged trading is high-risk. The agent's chart reading can be wrong: every logged value is visible and editable, and rule checks show which ones failed and why.

FAQ

Do I need an OpenAI or Anthropic API key?

No. The journal is an MCP server; the AI is the agent you already use (Claude Code, Codex, Claude Desktop, Cursor…). The journal itself never calls an LLM.

Where is my data stored? Is anything sent online?

Everything is in one local SQLite file plus a screenshots folder (~/.agent-trading-journal by default). The dashboard binds to 127.0.0.1. Nothing is uploaded anywhere by the journal.

Can I use my own trading strategy?

That's the point. The onboarding interview turns your plan into custom fields and a rule checklist. Presets are only starting points. SMC/ICT, price action, supply & demand, indicators, options: anything you can describe works.

Can I import trades from MetaTrader 5 or TradingView?

Yes: import_statement (or agent-trading-journal import <file> --account <name>) reads MT4/MT5 statements, TradingView paper/strategy exports, IBKR, ThinkorSwim, NinjaTrader, Tradovate, TopstepX, Webull, DAS, TradeZella and Tradervue exports. Your agent can then add screenshots and rule checks to the imported trades.

Does it work for backtesting (TradingView Replay) and prop firm challenges?

Yes. Sessions are backtest, forward or live. Accounts can carry prop-firm limits (daily loss, max drawdown, trades per day, loss streak), and check_risk warns before you hit them.

Does it place trades or give signals?

No. It only records and analyses. You make every trading decision.

Credits and license

MIT © 2026 smizxe.

Statement parsing and round-trip reconstruction use @luxalgo/journal-importers and @luxalgo/journal-core (MIT) from LuxAlgo's Trade Journal. The Edge Score is adapted from their open formula. This project is not affiliated with or endorsed by LuxAlgo.

來源:README.md,提交 4947dae

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 24, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分