Your broker shows a monthly total. It does not show which habit produced it.
I don't have a public track record to show, so the example below uses a made-up statement: 88 closing trades over four weeks, generated with random P&L and a deliberate penalty for trades right after a loss. Treat the numbers as an illustration of the method, not as real trading results.
On that file, 10 trades closed within 15 minutes of a loss. Together they lost $953, which is -$95 per trade. All 78 other trades averaged +$49 each. The month still ended at +$2,896, so the monthly total hid the pattern.
Here is the method, so you can run it on your own file.
1. Export the right file
In IBKR: Performance & Reports, Statements, Activity, run as CSV. The file has a Trades section. Each row with DataDiscriminator = Order is one fill. Rows with ClosedLot repeat the same fill at lot level, so skip them or you count twice.
2. Keep only closing trades
A closing trade has a non-zero Realized P/L. Opening trades show 0.
3. Flag the ones that follow a loss
Sort closing trades by time. Walk through them and remember the time of the last loss. Any closing trade within 15 minutes of that time goes in the "after a loss" group. Everything else is the baseline group.
let lastLoss = null, after = [], rest = [];
for (const t of closes) {
if (lastLoss !== null && t.time - lastLoss <= 15 * 60000) after.push(t);
else rest.push(t);
if (t.pl < 0) lastLoss = t.time;
}
Note that a loss inside the window restarts the clock. A bad streak counts as one episode.
4. Compare averages, not totals
Total P&L after a loss depends on how many trades you took. Compare the average per trade in each group.
How to read the result
- If the after-loss average is clearly worse than the baseline over 20 or more trades, the habit costs you money. Try a rule: after a loss, no new order for 15 minutes.
- If the two averages are close, the habit is not your problem. Look at time of day or symbol next.
- Under about 10 trades in the after-loss group, the number is noise. Do not change anything yet.
This does not tell you what to buy or sell. It describes what already happened.
Skip the code
I put the same checks in a page that runs in your browser. You drop in the CSV, the file stays on your computer, and there is no signup: https://ab-autopsy.agentbets.workers.dev/?utm_source=devto#try
It reports closed trades, net P&L, win rate, fees, the after-loss group, your worst hour and worst symbol. It only reads the Trades section of an IBKR Activity Statement CSV. I have only tested it on a made-up file like the one above; if it fails on yours, tell me in the comments which column looked different.
Who should skip it: if you trade under about 20 times a month, there is too little data for any of these splits.
Top comments (0)