NineFifteenAM

Best practices

The most important part of any algo trading bot is its trade journal

8 min readBy NineFifteenAM

Not the strategy, not the broker API: the trade journal is what tells you why a bot wins or loses. Here's what mine records for each of its 10,700+ trades, and why.

Short answer

The trade journal is the most important part of an algo trading bot because it's the only part that can tell you why the bot wins or loses. For every trade I record five things: why it was taken, what the market looked like at that moment, how the order was actually filled, how the price moved while the trade was open, and why it closed. Alongside the trade itself I keep the price path every few seconds, a market snapshot every minute, the decisions the bot chose not to act on, and every change I make to the system. Without that context, a trade log tells you what happened but not why.

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:

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:

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.

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

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.

Questions people ask me

What is the most important part of an algo trading bot?

The trade journal. Strategies come and go, but the journal is what tells you which ones deserve to stay, why a bad week was bad, what the fills really cost and whether your own changes helped. Without it, every change to the bot is a guess.

What should an algo trading journal record?

At minimum: the reason for the trade, the market conditions at entry, the price you wanted and the price you got, how the trade moved while it was open, and why it closed. Profit and loss alone only tells you the result. The context is what lets you work out the cause.

Should I log the trades my bot didn't take?

Yes. Every signal that a filter or risk check blocked should be recorded with the reason. Later you can follow those blocked signals on the recorded prices and see whether the filter actually helped or quietly cost you good trades.

Should paper trades and live trades go in the same log?

Keep them in the same table so they can be compared, but mark every row clearly as paper or live and never mix them in one result. Paper fills are kinder than real ones, and the gap between the two is one of the most useful things a journal can show you.

How often should I record the price while a trade is open?

For intraday options, a sample every few seconds is enough to rebuild the trade's full path: how far it went against you, how far it went in your favour, and when. I record roughly every three seconds. More often than that mostly adds storage, not insight.

trading journaltrade logalgo trading botalgo tradingnifty optionstrade analysis
N

NineFifteenAM

One trader building an options bot for Indian index markets since early 2026. I write down how it is built, what broke, and what it cost — no tips, no calls, no returns.

Related

28 Sept 2026
How I analyse my trading bot's trades: putting the trade journal to workThe trade journal is the most important part of a trading bot, but only if you ask it good questions. These are the ones I ask my bot's trades: where stops belong, what exits give back, what fills cost, and whether the filters earn their place.
Best practices
27 Sept 2026
Opening range breakout on Nifty: I tested 25 versionsMy first trading bot traded one classic idea, the opening range breakout. I built 25 versions of it on Nifty options. Here's what made the good ones good.
The journey
27 Sept 2026
GPT vs Claude in a live trading bot: letting two AIs voteI asked GPT and Claude to read the same Nifty chart thousands of times and made them vote on my trades. What I learned about using AI in a trading bot.
The journey