Review every closed trade in R-multiples, automatically

An agent runs a script on your closed-trade CSV to compute R-multiple and holding days (and MAE/MFE if you supply price history), then checks each trade's execution against the plan you wrote before entry.

How it works

  1. Export closed trades from your broker as CSV (or a read-only report such as a Flex Query) into a folder the agent can read.
  2. Load {{price_history_path}} (daily high/low for each hold, or broker-reported MAE/MFE). A fill export alone cannot produce MAE/MFE; if this path data is missing the script must leave MAE_R and MFE_R blank and must not estimate them.
  3. The agent loads your written trade plans (entry reason, initial stop, planned risk) from your journal.
  4. A Python script, not the model, calculates R-multiple and holding days from the export and your planned risk, after netting partial fills into one closed position before any R math. If you provide a price-history file, the same script computes MAE and MFE; do not derive MAE/MFE from fill prices alone.
  5. The agent matches each trade to its plan and flags deviations: stop moved, size above plan, exit outside your rules.
  6. It shows you a dry-run diff of the rows and end-of-day note it intends to add to your journal sheet, and writes them only after you confirm.
  7. On Sunday it rolls the rows up into a weekly summary for your own review.

Copy-paste prompt

You are my post-trade review assistant. You do not give trading advice and you have no order access.
Inputs: {{trades_csv_path}} (closed trades), {{price_history_path}} (daily high/low or broker-reported MAE/MFE) and {{journal_path}} (my pre-trade plans).
1. Run {{calc_script}} to compute R-multiple and holding days. Compute MAE and MFE only if a price-history file is present; leave those columns blank otherwise. Use only the script output for numbers.
Define long-only R as realized P&L divided by initial risk, where initial risk = shares times (size-weighted average entry minus the planned initial stop), after partial fills are netted into one position. Require the script to emit one row per closed position: trade_id, date, setup_tag, R, hold_days, MAE_R, MFE_R. Use no number the script did not output.
2. For each trade, compare execution with my written plan: initial stop, planned risk, setup tag, exit rule. Match plans only on {{match_key}}; if unmatched, write "no written plan" and do not invent stop, size, or exit rule.
3. List every deviation in one line each, for example "Stop moved lower after entry" or "Position risk 1.4R vs plan 1.0R".
4. Show me a preview (diff) of the rows you would add to {{journal_sheet}} with columns: trade_id, date, setup_tag, R, hold_days, MAE_R, MFE_R, deviations. Write them only after I reply "confirm".
5. Finish with at most three objective statistical observations about process adherence (percentages, averages, counts only). Never interpret behavior, suggest changes, or use evaluative words. Say "insufficient sample" if fewer than 20 trades. Do not mention instrument names or any specific trade.
On the Sunday run, roll that week's rows into deviation counts, average R, and median hold days, and still say "insufficient sample" if fewer than 20 trades are in scope.

Guardrails

  • All numbers come from code; the model only explains them.
  • Read-only access to trade data; the agent has no order access.
  • No conclusions about a setup until at least 20 closed trades are in the sample.
  • Summaries refer to setup tags and process, never to instrument names.
  • Journal writes are shown as a dry-run diff first and applied only after you confirm.
  • Observations must be strictly objective statistics (e.g., "42% of trades moved stops", "average deviation 0.3R") with no interpretive language, advice, or suggestions.
  • Any deviation flagging must be based solely on explicit, machine-readable fields in the plan and trade data; model may not infer intent or rules.

What can go wrong

Partial fills, mismatched trade IDs, and free-text plan parsing are the classic traps. The model can misreport deviations or generate plausible but false observations. All matching logic must move into the Python script; the LLM may only format already-computed results. Add explicit sample-size and statistical-only constraints to prevent premature conclusions.

Why it helps

Most traders review their wins and skip their losses. Reviewing every closed trade in R-multiples makes the process measurable, and comparing it with the plan you wrote before entry shows whether you followed your own rules.

Set-up notes

  • Give the agent read access to the export and the journal only; no trading permissions.
  • Exporting broker data to third-party LLMs may breach your broker agreement or GDPR obligations; verify compliance and consider local/offline tools. Always verify the first 30 days of agent output line-by-line against raw files before relying on journal entries.
  • Check the first 30 days of calculations by hand before trusting them.

Source and references

Original write-up by Agents for Traders. Background reading is linked below.

Spotted an error, or want your post removed? Email hello@agentsfortraders.com.

Educational content only. Not investment advice or a personal recommendation. No tickers, signals or trade alerts. Trading involves risk of loss.

Conteúdo exclusivamente educativo. Não constitui aconselhamento nem recomendação de investimento. Sem tickers, sinais ou alertas de negociação. Negociar envolve risco de perda.

Related use cases