Check exit-rule adherence after the close
After the close, the agent checks each open position against the exit rules you wrote and reports which rules were met. It reports; you decide.
How it works
- Write each exit rule as a structured row: rule_id, type (close_below_stop | close_below_ma | time_stop), threshold or ma_length, applies_to. Use simple, unambiguous conditional statements with explicit numeric thresholds.
- A Python script reads {{positions_csv}} plus a daily-close file you already export (symbol, date, close). A broker position CSV does not include moving averages. The script computes days_held and any required MA, compares each rule, and writes {{eod_values_csv}} with columns symbol, rule_id, value, threshold, met (true/false), missing (true/false). The script, not the model, sets met.
- The agent receives the pre-computed values and your exact rule statements, then lists per position which rules are met or not met.
- You review and decide; the agent has no order access.
- The agent shows the journal draft; you fill in the decision and append it yourself. The agent drafts a journal entry recording the decision you state and shows it to you as a preview; nothing is written to your journal until you confirm.
Copy-paste prompt
Using {{eod_values_csv}} (met/not-met already computed; do not recompute, do not infer missing numbers) and {{exit_rules_file}} for labels only, list each open position and each rule as met, not met, or unchecked if missing=true, with value and threshold copied from the file. Do not add rules, do not interpret chart patterns, do not recommend an action. Then draft a one-line journal note per position with rule ids met and a blank decision: field. End with: Review complete. Decisions are yours. Do not write the journal until I confirm this draft.Guardrails
- Reports only; no order access.
- Only your written rules are checked.
- Your decision is logged, so rule-following can be measured.
- Rules must be written as simple, unambiguous conditional statements with explicit numeric thresholds (e.g. "close < initial_stop" or "days_held > 10").
- You must spot-check every agent report against the raw CSV numbers before logging any decision; treat the agent output as a first draft only.
What can go wrong
Plain-English rules such as 'trail it if it looks extended' cannot be checked. When those rows were missing, the model filled in a guessed met/not-met. Keep only threshold rules the script can compute, and treat missing as unchecked, not as not-met.
Why it helps
Writing exit rules is easy; noticing that one was met on a busy day is not. This check does the noticing.
Source and references
Original write-up by Agents for Traders. Background reading is linked below.
- Stop order (glossary) · Investor.gov (SEC) (checked 17 Oct 2026)
- Stop-Loss Orders: One Way to Limit Losses · Investopedia (checked 17 Oct 2026)
- Trading Plan: Definition, Examples, and Tips · Investopedia (checked 17 Oct 2026)
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
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.
Journaling & post-trade reviewPropose one evidence-backed playbook change from the weekly review
On Sunday the agent compiles your mistakes and best trades from the journal and proposes at most one change to your written playbook, with the evidence. You approve or reject it.
The Daily 3
Three agent workflows for swing traders, free, on US trading days.