agentleFS
ntaffziintaffzii/Skill-Agents/skills/trading/trader-memory-core/SKILL.md

trader-memory-core

Skill4 starsChanged 2 months agoMITView on GitHub

Use this skill to log closed trades in a structured journal and compute win rate, average R-multiple, and expectancy from the trade history. Trigger on "trade journal", "log this trade", "win rate", "R-multiple", "expectancy", "trading stats". If the user just wants to record a trade with no analysis yet, this skill still applies — logging in the right schema now is what makes later stats possible.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only journaling losing trades (to "figure out what went wrong") — winning trades need review too, especially to check whether wins were the …

    line 39
  2. Very specific:

    Run python3 journal_stats.py for the self-test.

    line 52
  3. Distinctive:

    Does not itself store data persistently across sessions — the user (or the surrounding tool/workflow) owns the actual journal file.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Trader Memory Core

Overview

A trade without a record teaches nothing — the entire point of journaling is to make patterns visible across many trades (which setups actually work, whether stops get respected, whether sizing discipline holds) instead of relying on memory of a few vivid wins or losses. This skill defines a simple local journal schema and computes the standard trade-quality statistics from it: win rate, average R-multiple, and expectancy.

Not financial advice. This summarizes past results from data you supply; it does not predict future performance, and past win rate/expectancy are not guarantees.

When to use

  • บันทึกไม้เทรดที่ปิดแล้วลง journal
  • คำนวณ win rate, R-multiple เฉลี่ย, expectancy จากประวัติการเทรด
  • Reviewing whether stops/sizing were followed as planned across recent trades (pairs with a postmortem review of individual losing trades)

When NOT to use

  • The trade is still open — this skill's stats are for closed trades only; log the setup/plan when opening, but win/loss stats need an exit price
  • The user wants a live P&L dashboard connected to a broker — this is a local structured-file journal, not a broker integration

Core knowledge

R-multiple: the standard way to compare trades of different sizes on equal footing. R = (exit_price - entry_price) / (entry_price - stop_price) for a long trade — a +2R trade made twice its initial planned risk; a -1R trade lost exactly the planned risk (stop was hit cleanly); anything worse than -1R means the stop wasn't respected as planned or slippage occurred.

Win rate: fraction of trades with R > 0. On its own this is a weak metric — a strategy can have a low win rate and still be strongly profitable if average wins are large relative to average losses (or vice versa), which is why expectancy matters more than win rate alone.

Expectancy (in R-multiples): win_rate × avg_win_R + loss_rate × avg_loss_R (avg_loss_R is negative, so this naturally nets losses against wins). A positive expectancy means the strategy makes money on average per trade, over this sample — it is a backward-looking summary of the logged trades, not a forward guarantee.

Journal schema (journal-schema.yaml): one entry per closed trade — ticker, direction, setup tag, entry/stop/exit, R-multiple, and free-text notes/mistake tags. Recording the original stop (not a trailed one) is what makes the R-multiple meaningful as "did this trade perform relative to its initial plan."

Common mistakes

  1. Computing R-multiple against a trailed/moved stop instead of the original planned stop — this hides whether the original risk plan was actually respected.
  2. Reporting win rate alone as "how good the strategy is" without expectancy — a 70% win rate with tiny wins and rare huge losses can still have negative expectancy.
  3. Only journaling losing trades (to "figure out what went wrong") — winning trades need review too, especially to check whether wins were the result of the plan working or of luck/oversized risk that happened to pay off.
  4. Treating past expectancy (computed from a small sample) as a guarantee of future results.
  5. Logging trades sporadically rather than consistently — stats computed from a partial/biased sample of trades (e.g. only remembering to log the dramatic ones) will misrepresent the actual track record.

Code

journal_stats.py — pure Decimal arithmetic, no dependencies:

  • compute_r_multiple(entry, stop, exit_price) → Decimal R-multiple for one trade
  • compute_trade_stats(trades) → TradeStats(total_trades, wins, losses, breakeven, win_rate, avg_r_multiple, avg_win_r, avg_loss_r, expectancy_r)

journal-schema.yaml — the per-trade record schema with a synthetic example entry.

Run python3 journal_stats.py for the self-test.

Known limitations

  • This skill computes statistics from a journal the user maintains; it does not connect to a broker or verify entries against real fills.
  • Small sample sizes produce statistically unreliable win-rate/expectancy figures — flag this when a user has only a handful of logged trades, rather than presenting the number as settled.
  • Does not itself store data persistently across sessions — the user (or the surrounding tool/workflow) owns the actual journal file.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.