If I could keep only one part of my trading bot, it wouldn't be a strategy. It would be the trade journal.
Strategies come and go; I've built and tested more than 150 of them. The journal is what tells me which ones deserve to stay, why a bad week was bad, and what to fix next. Without it, every change to the bot would be a guess.
Most trade logs start with the same handful of columns: date, instrument, entry price, exit price, quantity and profit or loss.
That's enough to tell you when a week has gone badly. It's no help at all in working out why. Did the market do something unusual? Were the fills worse than normal? Were the exits too slow, or did a setting change on Tuesday that nobody remembers? A basic log can't say, so you're left guessing.
So my bot's log is built around one question: if I read this trade in six months, could I explain it without opening a chart? More than 10,700 trades later, mostly in paper mode, this is what it records and why.
Why the journal matters more than the strategy
A strategy is one idea about the market. The journal is how you find out whether that idea is working, and it keeps paying off long after a strategy has been switched off. It's what lets you:
- spot a strategy that has quietly stopped working, before it costs much
- see what live trading really costs compared with paper
- catch bugs that never throw an error, like a stop that isn't moving or a column that isn't being filled
- tell the difference between the market changing and you changing something
A good strategy with a poor journal gets tweaked blindly. An average strategy with a good journal gets steadily better.
Why a basic trade log isn't enough
Profit and loss tells you the result. It doesn't tell you the cause, and the same loss can come from very different places:
- a poor entry, where the idea was wrong from the start
- a poor fill, where the idea was fine but the order cost too much
- a poor exit, where the trade was winning and gave it all back
- a market that did something rare, where there was nothing wrong with the trade at all
These need completely different fixes. If you can't tell them apart, you end up changing the wrong thing, and a strategy that was fine gets "improved" into a worse one.
The five things I record for every trade
Each trade gets one row, and that row answers five questions:
| Part | The question it answers | What I record |
|---|---|---|
| Intent | Why was this trade taken? | Strategy and version, direction, the reason in words, a confidence value, paper or live |
| Context | What did the market look like at that moment? | Index price, time of day, days to expiry, distance to the nearest important level, India VIX, whether the day opened with a gap |
| Execution | Did I get the price I wanted? | The price that triggered the entry, the price actually filled, the difference (slippage), order type, quantity |
| Management | What happened while it was open? | The first stop, the last stop, how many times the stop moved, the worst and best points of the trade |
| Exit | Why did it close, and was that a good moment? | Exit reason, holding time, result in percent, how much of the best move was kept |
A few of these deserve a word of explanation.
Slippage is the gap between the price the signal wanted and the price the order got. On paper it's often zero. In live trading it's never zero, and on a fast-moving option it can eat a large part of a small target. You can only measure it if you record both prices at the moment of entry.
The worst and best points of a trade have names: maximum adverse excursion (MAE), how far the trade went against you before it closed, and maximum favourable excursion (MFE), how far it went in your favour. They're the most useful numbers in the whole log, because they show how trades behave, not just how they end. Part 2 is mostly about what they can tell you.
The exit reason comes from a fixed list — stop hit, target hit, trailing stop, time exit, manual exit, end of day — never free text. Free text feels more informative when you write it, and is almost impossible to count later.
The price a few minutes after exit is on my list rather than in the log: it's one of the columns I added but haven't wired up yet (more on that below). It sounds odd to record, because by then the trade is over. But it's the only way to answer a question every trader asks: do my exits leave too much behind, or do they get me out just before it turns?
Beyond the trade row: four more logs
One row per trade, however detailed, is a summary. Four other logs sit next to it, all linked to the trade by the same ID.
1. The price path while the trade is open
While a trade is live, the bot records the option price and the index price roughly every three seconds. Since late July that adds up to more than 5,000 trades with a full path.
With the path, the MAE and MFE can be rebuilt at any time, along with things I didn't think to record: how long a winner took to reach its best point, or how often a trade that went well early turned into a loss. It also means I can test a different exit rule on real trades later, without waiting months for new ones.
2. A snapshot of the market every minute
Every minute during market hours, the bot writes down what the wider market looks like: things like the put-call ratio, implied volatility, the gap between futures and the index, how many stocks are rising, and where price sits against the day's average. None of this is specific to one trade.
Joined to the trades by time, these snapshots let me ask "does this strategy do better on some kinds of days than others?" without having to decide in advance which kinds of days matter.
3. The decisions the bot didn't act on
This is the log most people skip, and I think it's the most important one.
When a risk check stops a signal from going live, the rule that stopped it, the reason and the market context at that moment are recorded. While a trade is open, the part of the bot that watches for exits records what it concluded every few seconds, including the times it decided to hold or only raise a warning.
Without this log, a filter can quietly block good trades for months and you would never know. With it, you can follow every blocked signal on the recorded prices and see what it would have done.
4. Every change I make
Every change I make from the dashboard is logged with a timestamp: switching a strategy between paper and live, turning one on or off, changing quantity, exiting a trade by hand, using the kill switch. There are more than 2,600 of them so far.
This is what separates "the strategy got worse" from "I changed something". When results dip, the first thing I check is what I touched in the days before.
What a trade record looks like
Here's the shape of one record, with made-up values:
{
"trade_id": "2026-09-24-0931-A7",
"mode": "paper",
"strategy": "breakout_v3",
"direction": "long_call",
"entry_reason": "range_break_up",
"confidence": 0.62,
"context": {
"time": "09:31:12",
"index_price": 23112.4,
"days_to_expiry": 5,
"india_vix": 12.7,
"gap_at_open_pct": -0.21,
"distance_to_key_level_pts": 38
},
"execution": { "trigger_price": 101.5, "fill_price": 102.4, "slippage_pts": 0.9 },
"management": { "first_stop": 91.0, "last_stop": 104.0, "stop_moves": 3, "mae_pts": -4.1, "mfe_pts": 14.8 },
"exit": { "reason": "trailing_stop", "exit_price": 108.6, "hold_seconds": 1140, "kept_of_best_move_pct": 42 }
}
Every field is either a raw number captured at the moment or a label from a fixed list. Nothing needs a chart or my memory to make sense.
Rules that keep the log useful
Collecting data is easy. Keeping it usable takes a few rules.
- One row per trade, with one ID. The same ID links the trade to its price path, its snapshots and any blocked or warning decisions around it.
- Fixed lists, not free text. When I checked my own table while writing this, the mode column contained both "LIVE" and "live". Small, but enough to make a count quietly wrong.
- Record at the moment, never afterwards. A value filled in from memory at the end of the day is a guess.
- Raw values first. Store prices, times and quantities. Ratios and scores can always be worked out later; missing raw data can't.
- Times you can join on. Record when things happened in one consistent format. Joining a trade to the wrong minute's market snapshot is an easy mistake and a hard one to spot.
- Paper and live side by side, never blended. Same table, clearly marked, always analysed separately.
- Log the dull trades too. The small, forgettable trades are most of the sample.
The last rule is the one I'd underline: check that fields are actually being filled. My own check turned up that only about one trade in ten has the full stop and excursion detail, and three columns I added for later analysis have never been filled at all. Nothing crashed and no error appeared. The data just wasn't there.
What I'd do if I started again
- Write the questions first, then the fields. Every field should exist because it answers something you'll want to ask.
- Record context from the first trade. You can recompute a statistic later. You can't go back and capture what the market looked like.
- Add a coverage check the day you add a column. A column nothing writes to is a promise, not data.
- Log what didn't happen. Blocked signals and "hold" decisions are half the story.
The journal is the most important part of the bot, but only if you use it. In part 2, how I analyse my bot's trades, I go through the questions I ask this data, from where stops should sit to whether a filter earns its place. If you want the story of the first strategy these trades came from, start with the opening range breakout I tested in 25 versions.