agent-trading-journal

v0.1.0
io.github.smizxe/agent-trading-journal Checked 6 hours ago Published 2 months ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_setup_status Setup status (call first)

Profile, strategies, accounts and counts. Tells you whether onboarding is needed.

get_onboarding_guide Onboarding interview guide

The interview script for setting the journal up around this trader. Follow it when get_setup_status says onboarding is needed.

get_workflow Get a workflow

Step-by-step instructions for a packaged workflow: onboarding, log_trade_from_screenshot, weekly_review, pre_session_check.

ParameterTypeDescription
name *string

set_profile Save trader profile

Upsert trader profile entries (language, markets, style, sessions, timezone, experience, goals, weaknesses, ...). null deletes a key.

ParameterTypeDescription
entries *object

list_presets List strategy presets

Example strategies to start from (always adapt them to the user).

import_preset Import a preset as a strategy

Copy a preset into the journal as a strategy (optionally under a new slug/name), then edit it with upsert_strategy.

ParameterTypeDescription
preset *string
namestring
slugstring

upsert_strategy Create / update a strategy

Save the full strategy definition: plan, custom fields (what to measure per trade) and rules (entry checklist). Fields/rules left out are archived, not deleted.

ParameterTypeDescription
name *string
descriptionstring
fieldsarray
marketsstring
planobjectsummary, bias, setup, entry, stop, targets, management, no_trade
rulesarray
slugstringshort id; derived from name when omitted. Same slug = update (version bumps if fields/rules change)
timeframesstring

get_strategy Get a strategy

Full definition with field guides and rules. Call before logging trades.

ParameterTypeDescription
strategy *stringslug or name
include_archivedboolean

list_strategies List strategies

All strategies with version, number of fields/rules and trades.

export_strategy Export a strategy

Portable JSON of a strategy (same format as presets) — to back up or share.

ParameterTypeDescription
strategy *string
pathstringoptional .json file path to write

upsert_account Create / update an account

Trading account with its risk limits (prop-firm style). Same name = update; omitted fields stay unchanged.

ParameterTypeDescription
name *string
currencystring
max_consecutive_lossesinteger
max_daily_loss_pctnumber
max_total_drawdown_pctnumber
max_trades_per_dayinteger
notesstring
profit_target_pctnumber
risk_per_trade_pctnumbere.g. 0.5 = 0.5% per trade
starting_balancenumber
typestring

list_accounts List accounts

Accounts with their limits.

check_risk Check account risk limits

Today's R and estimated % vs the account's daily loss / drawdown / trade-count / loss-streak limits. status: ok | caution | stop.

ParameterTypeDescription
account *string
datestringYYYY-MM-DD, default today

start_session Start a session

A backtest / forward / live session. Returns session_id for log_trade.

ParameterTypeDescription
symbol *string
accountstringaccount name (created if new) — for forward/live
data_fromstringbacktest: start of the replayed range
data_tostring
datestringYYYY-MM-DD, default today
modestring
notesstring
settings_jsonstringJSON of settings that differ from the defaults
strategystringstrategy slug — trades inherit it
timeframesstring
tool_versionstringindicator / tool version used

list_sessions List sessions

Sessions with trade count, win count and total R.

ParameterTypeDescription
accountstringaccount name
modestring
strategystringstrategy slug

log_trade Log a trade or skipped setup

Log one trade into a session with custom fields and rule checks. Skipped setups count too (status=skipped + skip_reason). RR, R and outcome are derived when possible.

ParameterTypeDescription
session_id *integer
chart_timestringentry time on the chart, "YYYY-MM-DD HH:mm" in the trader's timezone
closed_atstring
confidenceinteger
directionstring
entrynumber
exit_pricenumberaverage exit price; R is derived from entry/sl when result_r is not given
exit_reasonstring
fieldsobjectcustom fields defined by the strategy (see get_strategy), e.g. {"setup_type":"pullback","news_nearby":false}
mae_rnumbermax adverse excursion in R (how far it went against you)
mfe_rnumbermax favourable excursion in R (how far it went your way)
mistakesstringdiscipline / execution mistakes
moved_beboolean
notesstring
outcomestringderived from result_r when omitted; leave empty while open
partial_takenboolean
pnlnumberrealised P&L in account currency
quantitynumber
result_rnumberrealised R, net of fees when known
rr_plannednumberderived from entry/sl/tp when omitted
rulesobjectrule checks by rule key: "pass" | "fail" | "na" (or {result, note})
skip_correctbooleanlater review: was skipping right?
skip_reasonstringrequired when status=skipped
slnumber
statusstringdefault taken; a valid setup the user stayed out of = skipped
strategystringstrategy slug — defaults to the session strategy
tagsstringcomma-separated
tpnumber
tp2number

update_trade Update a trade

Change any field, custom field or rule check. Send only what changes.

ParameterTypeDescription
trade_id *integer
chart_timestringentry time on the chart, "YYYY-MM-DD HH:mm" in the trader's timezone
closed_atstring
confidenceinteger
directionstring
entrynumber
exit_pricenumberaverage exit price; R is derived from entry/sl when result_r is not given
exit_reasonstring
fieldsobjectcustom fields defined by the strategy (see get_strategy), e.g. {"setup_type":"pullback","news_nearby":false}
mae_rnumbermax adverse excursion in R (how far it went against you)
mfe_rnumbermax favourable excursion in R (how far it went your way)
mistakesstringdiscipline / execution mistakes
moved_beboolean
notesstring
outcomestringderived from result_r when omitted; leave empty while open
partial_takenboolean
pnlnumberrealised P&L in account currency
quantitynumber
result_rnumberrealised R, net of fees when known
rr_plannednumberderived from entry/sl/tp when omitted
rulesobjectrule checks by rule key: "pass" | "fail" | "na" (or {result, note})
skip_correctbooleanlater review: was skipping right?
skip_reasonstringrequired when status=skipped
slnumber
statusstringdefault taken; a valid setup the user stayed out of = skipped
strategystringstrategy slug — defaults to the session strategy
tagsstringcomma-separated
tpnumber
tp2number

delete_trade Delete a trade

Delete a trade logged by mistake (with its rule checks and screenshot records).

ParameterTypeDescription
trade_id *integer

query_trades Query trades

Trades matching filters, newest first.

ParameterTypeDescription
accountstringaccount name
fieldsobjectfilter on custom field values, e.g. {"setup_type":"pullback"}
fromstringYYYY-MM-DD (trade date)
limitinteger
modestring
outcomestring
session_idinteger
statusstring
strategystringstrategy slug
symbolstring
tagstring
tostringYYYY-MM-DD (trade date)

get_trade Get a trade

One trade with fields, rule checks, screenshots and lessons.

ParameterTypeDescription
trade_id *integer

add_screenshot Attach a screenshot

Copy an image (png/jpg/gif/webp, absolute path) into the journal and attach it to a trade.

ParameterTypeDescription
source_path *string
trade_id *integer
captionstringtimeframe, before/after entry, ...

add_lesson Add a lesson

Record a lesson linked to a session and/or trade. Suggested categories: discipline, strategy, market, risk, psychology, execution.

ParameterTypeDescription
category *string
text *string
session_idinteger
strategystring
trade_idinteger

update_lesson Update a lesson

Edit text or category.

ParameterTypeDescription
lesson_id *integer
categorystring
textstring

delete_lesson Delete a lesson

Delete a lesson recorded by mistake.

ParameterTypeDescription
lesson_id *integer

list_lessons List lessons

Lessons, newest first.

ParameterTypeDescription
accountstring
categorystring
limitinteger
modestring
session_idinteger
strategystring
trade_idinteger

get_stats Stats

Win rate, total R, expectancy, profit factor, payoff, drawdown, streaks, Edge Score, breakdowns (direction, symbol, weekday, hour, every custom field), rule adherence, calendar, equity curve.

ParameterTypeDescription
accountstringaccount name
fieldsobjectfilter on custom field values, e.g. {"setup_type":"pullback"}
fromstringYYYY-MM-DD (trade date)
modestring
session_idinteger
strategystringstrategy slug
symbolstring
tagstring
tostringYYYY-MM-DD (trade date)

run_sql_readonly Read-only SQL

Any SELECT for ad-hoc analysis. Tables: profile, strategies, strategy_fields, strategy_rules, accounts, sessions, trades (custom fields in fields_json → json_extract), trade_rule_checks, attachments, lessons.

ParameterTypeDescription
sql *stringSELECT/WITH only

import_statement Import a broker statement

Import closed trades from an export file. Formats: MetaTrader 4/5 (HTML statement), Interactive Brokers (activity statement), Interactive Brokers (Flex Query), ThinkorSwim / Charles Schwab (account statement), TradeZella (trades export), Tradervue (executions export), TopstepX (fills export), TradingView (paper trading history), NinjaTrader (executions export), Tradovate (orders export), Webull (orders export), DAS Trader Pro (executions export). Duplicates are skipped. Run with dry_run first.

ParameterTypeDescription
account *string
path *stringabsolute path to the exported file
dry_runboolean
file_timezonestringtimezone of naive timestamps in the file, if different
modestringdefault live
multipliersobjectcontract multipliers per symbol for futures
strategystring
symbolstringonly for files without a symbol column
timezonestringIANA timezone for chart_time (default: profile timezone)

export_review Export a review (Markdown)

Markdown review of a scope (Obsidian-friendly). Returns the text, or writes it to path.

ParameterTypeDescription
accountstringaccount name
fieldsobjectfilter on custom field values, e.g. {"setup_type":"pullback"}
fromstringYYYY-MM-DD (trade date)
modestring
pathstring.md file to write
session_idinteger
strategystringstrategy slug
symbolstring
tagstring
titlestring
tostringYYYY-MM-DD (trade date)

start_dashboard Start dashboard

Start the local web dashboard (http://localhost:3777). Only when the user asks.

stop_dashboard Stop dashboard

Stop the dashboard started by this server.

dashboard_status Dashboard status

Whether the dashboard started by this server is running.