Guide
From a manual replay to an algo: turning your option strategy into rules
You replayed a day. You sold a straddle at 9:20, watched it for a while and got out when it felt wrong. Now you want a computer to do that for you. The catch is that "felt wrong" is not an instruction. To turn an option strategy into an algo, every decision you made by feel has to become a rule with a number or a time in it.
This guide takes one hand-made straddle and translates it, step by step, into the pieces an algo needs: an entry time, strikes written as distance from ATM, a size, and an exit. The numbers are invented to show the method. Nothing here describes what any strategy has done or will do.
What an algo needs from you
An algo is a list of conditions. It needs an answer to each of these, in words a machine can follow:
- When does it enter? A clock time, or a condition.
- What does it trade? Which index, which expiry, which strikes, buy or sell.
- How much? A number of lots.
- When does it leave? At a loss limit, at a time, or both.
- What happens next? Trade again today, or stop.
When you trade by hand, you answer these as you go, and some answers live only in your head. The replay is the best place to find them, because the option simulator keeps a trade log of every entry and exit you made.
The example: a straddle with a hand-made exit (illustration)
Here is a made-up session. You open a replay on a day of your choice, with NIFTY at 24,000 (an invented level). At 9:20 you sell one lot of the at-the-money call and the at-the-money put. Together they bring in 230 per unit. You step the clock in ten-minute jumps. At 11:40 the combined price has risen to 312, you do not like it, and you close both legs. Had it not troubled you, you would have closed at 3:15 anyway.
That is a complete strategy, but it lives in your head. Now we write it down.
From what you did to a rule
| What you did by hand | The rule |
|---|---|
| Opened at 9:20 | Entry time: 09:20, once a day |
| Sold the call and put "at the money" | Strikes as ATM offsets: call at ATM+0, put at ATM+0, where ATM is read from the index at 09:20 |
| Sold one lot of each | Quantity: 1 lot per leg, sell |
| Looked at the weekly chain | Expiry: the current weekly (or the monthly, for indices without weekly expiries) |
| Closed when it "troubled" you | Stop-loss: close both legs if the combined premium rises by a third from the entry price (illustration) |
| Would have closed at 3:15 | Time exit: close all legs at 15:15 |
| Did not trade again that day | No re-entry |
With the example numbers, the entry combined premium of 230 gives a stop at about 307. The rule fires at the first minute the premium reaches 307. You looked in ten-minute steps and saw 312 at 11:40, so the rule would have fired at 11:40 or a little earlier. That is the check you want: run the rule against the day you traded and see whether it does what you did, or something else.
The hard part is the exit
Entry rules are easy to write down. Exits are where the "feel" hides. There are three ways to turn a feeling into a rule:
- A price stop. A move in the premium, such as a third above the entry, on one leg or on the combined position. This is a stop-loss.
- An index stop. The index moves a set distance from where you entered.
- A time exit. A fixed clock time, such as 15:15, whatever the price.
A common mix is a price stop plus a time exit. To choose, go back to the replay. Re-run the same day with each version, and ask which one matches the way you would have exited. If none of them does, your real exit depends on something you have not described yet, and it is better to find that now than after the algo is running.
What to drop or define
Some things you did by hand cannot be copied as they are. "I waited for a calm moment" needs a definition, such as a time window or a condition, or it needs to go. "I felt it was too risky" is an exit you have not written yet. "I skipped it because the news looked bad" is a judgement a rule cannot make. Be honest about which of your habits are strategy and which are mood. The first kind can be automated; the second cannot.
Tell Cookie, then check the result
Cookie is Tradetron's AI. You describe your setup in plain words: your entry time, your strikes as distance from ATM, your size, and where you got out and why. Cookie writes it as an algo with an entry rule and a stop-loss or time exit. Keep your trade log from the replay and the table above in front of you while you describe it.
Read what comes back. Does the entry time match? Are the strikes the ATM offsets you meant? Does the exit fire at the level you wrote? If something differs, say so and change it. The algo should describe your trade, not a nearby one.
Then backtest, then decide
A rule that fits one day proves nothing. The next step is a backtest, which runs the rules over years of history in one go. Look at how the rules behave on the kinds of days you replayed: a gap open, an expiry, a volatility spike, a one-way trend. Our practice guide lists five such days. A backtest describes the past, not the future, and it has its own limits, such as costs and fills. If the rules hold up, you can deploy them with your broker when you are ready. Algo trading carries risk.
Common mistakes
- Fitting the rules to one day. If your stop was set to the exact minute that suited the replay, it is a memory, not a rule.
- Too many rules. Each added condition gives the strategy one more way to behave differently from what you meant.
- Skipping the exit. An algo with an entry and no exit holds a position until someone notices.
- Forgetting costs. Brokerage and taxes apply to every entry and exit.
- Going live right after one test. Take the time to look at the log of a few runs.
If you are still choosing a tool for the practice stage, the roundup of option simulators in India sorts them by use case. For how the payoff of the straddle looks on screen, see the option payoff graph, explained.
Questions traders ask
Can I turn my manual option strategy into an algo?
Yes, if you can describe it in rules: an entry time, which strikes, how many lots and how it exits. Tell Cookie, Tradetron's AI, what you did, and it writes the algo. Parts that depend on feel, such as "it looked risky", must first become a stop-loss or a time rule.
What should I write down before I automate a strategy?
Five things: the entry time, the strikes as distance from ATM, the size in lots, the exit (a stop-loss, a time, or both) and whether it can trade again that day. The trade log in a replay shows your actual entries and exits.
How do I turn a stop I set by feel into a rule?
Pick one measurable trigger: a rise in the combined premium, a move in the index, or a clock time. Re-run the same replay day with each and keep the one that matches how you would have exited.
Do I need to know how to code?
No. You describe the setup in plain words to Cookie, which writes it as an algo. You still need to check that the rules match what you meant.
What is the difference between a replay and a backtest?
In a replay you decide each step by hand while the clock moves. A backtest runs written rules over years of history in one go. A replay helps you find the rules; a backtest checks them across many days.
Does automating remove the risk?
No. An algo removes manual execution, not market risk, and a backtest describes the past, not the future. Algo trading carries risk.
Keep reading
- Free NIFTY & Bank Nifty option simulator: replay a real day
- NIFTY option simulator
- Practice options trading with replay
- The option payoff graph, explained
- Option simulators in India, by use case
- AlgoTest and Tradetron simulators compared
Historical replay for education and analysis. Past prices; not investment advice. Nothing here places orders. Algo trading carries risk.