People imagine a trading bot as something constantly buying and selling. Mine spends most of its day doing something much less exciting: checking that everything is working. This is the timeline of an ordinary trading day, kept general on purpose. It shows the shape of the day, not the rules inside it.
The day at a glance
| Time (IST) | What the bot does | What can go wrong |
|---|---|---|
| Just after 6 AM | Logs in for a fresh access token | Login fails, so nothing else runs |
| About 7 AM | Pulls overnight data: GIFT Nifty, crude, yesterday's range | Stale or missing data |
| Before 9:15 | Health checks: price feed, instruments, mode, guards | A wrong contract or a dead feed |
| 9:15 onwards | Watches the open, mostly waiting | Wide spreads, fast prices |
| Late morning to afternoon | Applies each strategy's rules, places and manages trades | Rejections, partial fills |
| Before 3:30 PM | Closes anything still open | A position left open |
| After the close | Writes the journal and the daily summary | A log that doesn't tell the truth |
Just after 6 AM: the login
The broker's access token expires at 6 AM every day. Before anything else can happen, the bot has to log in and get a fresh token. This is the step most likely to go wrong, so it's the one I check first. How the daily token refresh works is a separate guide.
If the login fails, nothing else runs. That's deliberate. A bot that can't see the market shouldn't act as if it can.
About 7 AM: the data pull
The bot collects the things known before the market opens: how GIFT Nifty is trading, overnight crude, the previous day's close and range, and the global backdrop. It writes them down.
Two things come out of this. One is the state the bot starts the day with. The other is my daily pre-market report, which is a description of that data. As the analysis of 125 mornings shows, this data describes where the day starts and says almost nothing about where it ends.
Before the open: health checks
Before the open, the bot verifies the kinds of things that would hurt if they were wrong:
- The connection to the broker's price feed is up, and prices are actually arriving.
- The instruments it plans to trade are the right ones, on the right expiry.
- Whether it's in paper mode or live mode, and which strategies are allowed in each.
- The guards are in place: a cap on how many live trades it may take in a day, and a kill switch I can use if something looks wrong.
If a check fails, the bot doesn't open. My month-one mistakes are a good argument for why this section exists.
9:15: the open
The market opens. For the first several minutes, the bot mostly watches. Many intraday ideas begin by measuring what the market does at the open, which is why it is quiet at first. The opening minutes are when spreads are widest and prices move fastest, so it's also the time I'm most likely to be watching the dashboard myself.
Mid-morning to early afternoon: decisions
This is when trades happen, if they happen at all. Each strategy applies its own fixed rules to the incoming prices. When one fires, the bot goes through a short list before it places anything:
- Is this strategy allowed today, in this mode?
- Would this order break a limit, such as the daily cap?
- Can it be priced and sized? If it's live, is the order acceptable to the broker?
In paper mode, the bot records the order and a simulated fill. In live mode, it sends the order, waits for the confirmation and checks what filled. Nothing is assumed.
On many days, very few live trades happen. The paper side logs far more records than the live side, because it runs many more strategy ideas: in May, for example, 832 paper records against 75 live.
Managing open trades
Once a trade is open, the bot's job changes from deciding to watching. It tracks the price against a stop and a target set in advance, and closes the trade when one is reached, or when a time limit runs out. Exits are decided by code before the trade starts. My dashboard also has a manual exit button. Using it less is the habit I'm working on hardest, and the data on it is public.
Before 3:30 PM: closing up
Before the market closes, the bot closes anything still open. Carrying an intraday options position past the close isn't part of the design.
After the close: the log
The trading day ends at 3:30 PM. The bot's day doesn't. Every trade is written to a journal, with what it saw at entry, what happened during the trade, and how it ended. The bot then produces a daily summary.
This is the part I spend the most time on personally. I read the day's summary, look at the trades that went badly, and check that the log is telling the truth. Once a month it becomes the bot scorecard. How I analyse the trades explains the method.
The evening
The bot stops. GIFT Nifty keeps trading well into the night, but nothing on my side is watching it. Tomorrow starts again at 6 AM.
What surprised me about the shape of it
Almost none of the day is trading. Most of it is logging in, checking, waiting and writing things down. The parts that need my attention are the morning login, the first fifteen minutes and the log after the close.
If you're building your own, the order I'd build things in is the order of this day: the login, the data, the checks, then the trading. Placing your first order in Python covers the trading step.
This post describes my own trading system in general terms, for information only. It is not investment advice, and it doesn't describe the exact rules or timing of any strategy. I am not registered with SEBI as an investment adviser or research analyst.