Lesson 35
Building a Mechanical Trading System
Turn a NIFTY trading idea into an inspectable rulebook, then separate research, paper observation and actual execution.

A cancelled exit can leave a position open.
Constructed record · three bought call teaching lots of 65 units · logical sequence, not elapsed time
Could another reader rebuild your decision?
I’m Mr. Chartist. Let’s move from “I would buy this breakout” to a record of what was known, what the rule required and what actually happened. Clear rules make differences easy to see. A good result alone cannot tell you whether the process was sound.
By the end you will be able to answer
- What makes a trading decision mechanical?
- How do you turn a market idea into a complete specification?
- Why must the information arrive before the decision?
NIFTY crosses the previous session’s high. One trader calls it a breakout at once. Another waits for the candle to close. A third wants a retest. They saw the same chart and made three different decisions. Before you compare their results, you need to know what each decision actually was.
A mechanical trading system is a written set of rules that another person can apply to the same information and check. It links what you observe to a contract, a size, an order, an exit and a plan for failures. “Buy a strong NIFTY breakout” is an idea. It becomes something you can test only when those decisions are written down. Someone still uses judgment to choose the rules and assumptions.
This lesson builds an educational NIFTY Call rulebook and asks the questions a reviewer would ask. The classroom inputs are invented. A separate eight-trade arithmetic record teaches costs and how to measure results. Those trades were not produced by the rulebook. Neither example is a tested edge or a sign of future returns.
Updated
What makes a trading decision mechanical?
Defines clear conditions that another reader could follow.
MayaTwo traders see NIFTY clear an earlier high. One says it is convincing, the other says it looks stretched.
That is the problem. A mechanical system gives a third reader clear conditions: when to enter, how much exposure, when to ask for an exit, and what to do when information is missing.
So the system is automatic?
Not always. Systematic means decisions follow written rules. Automated means software does some of the steps. Coding changes who does the work, not whether the idea earns money.
Then judgment disappears?
It moves into choosing the rules, the data and the tests. Written rules make a deviation visible. They do not guarantee discipline.
Mr. ChartistTwo traders watch NIFTY move above an earlier high. One calls it convincing. The other waits because it looks stretched. A mechanical trading system gives a third reader clear conditions for the decision: when to enter, how much exposure to accept, when to ask for an exit, and what to do when information is missing.
Systematic means decisions follow written rules. Automated means software carries out part or all of the work. You can check a completed candle against a written threshold and place the order by hand. A program can do the same check and send the order. Coding changes who does the steps. It does not make the idea profitable, and it does not make the order fill.
Discretionary trading leaves some choices to judgment in the moment. You can still review it, if you wrote down what you saw, what you decided and why, at the time. The hard part is rebuilding a judgment nobody recorded, once you already know what happened next. A hybrid is fine to study too, if it says which decisions follow rules and where a person may step in.
Another reader should reach the same signal from the same information, and be able to explain any difference in the result. Judgment does not disappear. It moves into choosing the rules, the data, the fill assumptions and the review tests. Written rules make a deviation visible. They do not guarantee discipline or remove emotion. The previous lesson, on emotional control, is where those deviations start.
Three ways to run the same idea
The words matter: they say who decides, and who acts.
Judgment in the moment
Reviewable only if you wrote down what you saw and why, at the time.
Written rules decide
You may still place the order by hand. Another reader reaches the same signal.
Software acts
A program checks the rule and sends the order. The rules still came from a person.
Judgment does not disappear. It moves into choosing the rules, the data, the fill assumptions and the review tests.
How do you turn a market idea into a complete specification?
Writes one idea as a full set of rules and sizes.
Specimen 0.1 is an untested classroom idea with invented prices, times and budgets. Its signal is a completed five-minute NIFTY 50 index candle that closes strictly above the previous session’s high: here 25,020 against 25,000. Equal does not count. The index gives a bullish signal. The instrument to act on it is a bought Call (CE), and its premium is a separate price.
The invented contract is an NSE NIFTY index Call with strike 25,000 and expiry 13 October 2026. Its listing is assumed, not checked against a real exchange file. A real study must confirm that exact expiry and strike in the dated contract file, with the quantity for that contract. Never quietly swap in another expiry. The example uses 65 units per lot only as a teaching quantity. It does not state the current or past exchange lot size.
The specimen looks only at the first qualifying completed bar between 10:00 IST and a 15:00 IST cutoff. If data, quote filters or funding fail at that moment, record no entry for the day and do not hunt for a later signal. If an order is sent, allow no second attempt, filled or not. Before sending, you need a known contract, a complete index bar and a fresh two-sided option quote. The invented quote is bid ₹99 and ask ₹100, with 65 units shown at the ask. The classroom filters allow a spread of at most ₹1 and a quote no older than two seconds. One chance a day is an arbitrary paper-study choice, not a rule for all systems.
The entry is a buy limit at ₹100 per unit. If it is still unfilled after 30 seconds, request cancellation, then reconcile confirmations and any fills that happened meanwhile. After a confirmed entry, an option bid at or below ₹60 triggers an exit request. So does the 15:00 cutoff, whichever comes first. There is no profit target and no planned overnight hold. The exit is a sell limit at the available bid for the confirmed open quantity. An unfilled or rejected exit goes to incident handling and a supervised position check. A requested time or price cannot promise the position is closed.
Size the position on the premium you commit, not on the planned stop loss. At an assumed ₹100 fill, 65 units cost ₹6,500. Add an invented ₹100 round-trip cost reserve and you get ₹6,600. An allowance of ₹10,000 permits floor(10000 ÷ 6600) = 1 lot. Assumed available cash of ₹7,000 also permits 1. Round down and take the smaller answer. If either limit cannot cover one lot, the answer is zero lots. These budgets are teaching inputs, not suggested account limits. The Start lesson on risk management shows how to set your own.
A fill at the planned ₹60 exit gives a net loss of ₹2,700: ₹40 per unit across 65 units, plus ₹100 of costs. That is a planned outcome, not a ceiling on loss. A gap, a missing bid or an unfilled order can make the exit worse, and the whole premium can be lost. The ₹6,600 includes an estimated reserve, so real costs can differ. A futures or short-option system needs its own margin, obligation and portfolio-risk treatment. This premium-only sum does not cover it.
Can another reader identify the same decision?
Specimen 0.1, a paper-only candidate. Every price, time, quantity and budget is invented, and it claims no performance. Tap a row for why it can be observed.
Input and versionSpecimen 0.1 · completed five-minute NIFTY 50 index bar, 09:55–10:00 IST.
The index bar is the input. The Call premium is a separate price.
SignalClose 25,020 > previous-session high 25,000.
Strictly above. Equal does not count. A bullish signal, not a fill.
ContractNSE NIFTY index Call / CE · strike 25,000 · classroom expiry 13 October 2026.
Listing assumed. Check expiry, strike and lot size. 65 units is a teaching assumption.
Size and cash₹6,600 per lot including estimated costs; allowance ₹10,000, available cash ₹7,000.
Round down, take the smaller: 1 whole lot. Zero if either limit fails.
Entry requestOne buy limit at ₹100 per unit; at most one attempt from 10:00 to the 15:00 IST cutoff.
Cancel after 30 seconds unfilled. Then reconcile fills.
Exit requestAvailable option bid ≤ ₹60, or 15:00 IST, whichever first; no profit target or planned overnight holding.
Sell limit at the bid. A rejection or no fill goes to incident handling.
Input failuresComplete index bar, known contract, two-sided option quote: spread ≤ ₹1 and age ≤ 2 seconds at submission.
First qualifying bar only. A failed check ends entry for the day. Open exposure still needs reconciling.
An untested classroom candidate, not a recommended strategy. The expiry’s real listing and the lot size are not confirmed here. Real research needs the dated contract and data records. Actual fills and charges can differ, and the whole premium can be lost. Call blue names the contract. It does not mean profit.
Two limits, one answer: take the smaller
One lot costs ₹6,500 of premium plus ₹100 reserved for costs. Whole lots only.
The smaller of the two limits sets the size.
₹10,000 ÷ ₹6,600 = 1.52 lots
₹7,000 ÷ ₹6,600 = 1.06 lots
One tile is one whole lot: ₹6,600. A part of a tile cannot be bought.
Invented prices, lot size and budget for a classroom specimen. The planned exit does not set the size: the premium committed does.
Why must the information arrive before the decision?
Keeps each input in the order it really arrived.
A backtest is a simulation of past decisions and results under a stated rule version, dataset and fill model. It asks what might have happened under those assumptions. It is not a record of what a trader earned. Point-in-time data means using only what was actually available at each simulated decision, including the contract definitions of that day, and not figures corrected or published later.
In our invented sequence, the five-minute index bar completes at 10:00:00 IST. Its final value arrives at 10:00:02, and the signal is checked at 10:00:03. That check is not yet an entry decision. The option quote arrives at 10:00:04 with ask ₹100 and 65 units shown. Only then can the other entry checks run and an order go out. The model assumes a fill at 10:00:05, and only if the price and the quantity are still there when the order reaches the market. These timings are invented, not measured data-feed delays. A signal known at 10:00:02 cannot justify a buy at 09:59:59.
Keep three things apart: the index input, the option quote, and the execution report or assumed fill. A last traded price can be old. It is neither a current ask for buying nor a bid for selling. Displayed depth shows quantity at one moment. It promises no queue place and no later fill. A midpoint fill needs a reason. NSE separates snapshots from levels of order-book depth, and a dataset cannot supply detail it never recorded.
An open-high-low-close bar records four prices, not the order they came in. If an option bar reaches both the stop level and the target, the bar cannot tell you which came first. And a price touched is not a price filled. Use finer data, a conservative rule fixed in advance, or report both outcomes. Otherwise mark the case unresolved. Picking the favourable path after seeing the result adds hindsight to the test.
Keep expired contracts, and the set of contracts that were eligible on each test date. Today’s option chain cannot rebuild yesterday’s choices. Use the session calendar, expiry rules and quantity in force then. For stock options you also need the corporate-action adjustments. Treat stale or missing inputs as unavailable, and record what you left out. An exit with missing data stays unresolved exposure in the model. It does not become a convenient zero or vanish from the sample.
The signal becomes known before an assumed fill
The 09:55–10:00 index candle gives a final close. The separate option quote then gives a possible fill input.
- 10:00:00
Interval completes
final index close 25,020 exists. It was unavailable inside the forming bar.
- 10:00:02
Bar arrives
the completed value becomes available to this hypothetical process.
- 10:00:03
Signal checked
25,020 > 25,000. Contract and other checks precede submission. No position yet.
- 10:00:04
Call quote observed
bid ₹99 / ask ₹100; 65 units displayed at the ask. A quote is not a fill.
- 10:00:05
Assumed arrival / fill
assume 65 units fill at ₹100 only if eligible price and quantity remain available.
A final close known at 10:00:02 cannot justify a purchase at 09:59:59. The quote observed at 10:00:04 also cannot guarantee execution at 10:00:05. A changed or unavailable quote produces no assumed fill under this condition, with the reason recorded. All times, prices, displayed size and delays are invented. The sequence shows a fill model. It is not an exchange confirmation or a measured delay. Buying uses the ask and selling uses the bid. Visible depth does not assure queue place or liquidity on arrival, and a larger request may fill only in part. The steps show order, not a time scale.
How do you keep rule selection apart from unseen evidence?
Separates research data from the block reserved for testing.
Start with earlier history to build the idea and find errors. Use later history to choose between recorded versions and to see whether costs, fill assumptions or small threshold changes alter the answer. All of that is research and selection. Before you open a final reserved block, freeze the full specification and the test plan. Then report its losses, rejected signals, missing data and failures along with the good fills.
Out-of-sample means the data had no influence on the choices that selected the tested version. A later date alone does not give you that. If the reserved result talks you into changing the entry, exit, filter or size, that block becomes research input for the new version. Running the new rule on the same block is another research comparison. It is no longer fresh, unseen evidence.
Which data helped choose this rule version?
One fixed time order keeps development and selection apart from a reserved comparison, then forward paper observation. The dates describe roles, not observed results.
- January 2022–December 2023
Research: define candidates and investigate errors.
Every attempted variant, data choice, cost assumption and reason for rejection.
- January–December 2024
Selection: compare candidates and sensitivity.
Choices made from these comparisons. This block belongs to research history.
- January–June 2025
Final unseen comparison: freeze specification and evaluation plan before opening.
All outcomes, exclusions, missing data and failures. Any result-led revision makes this research data.
- July–September 2025
Forward paper observation: record signals as information arrives.
Available quotes, assumed fills, skipped orders and deviations from the frozen version.
- October 2025
Review: reject, continue observation or research a new version.
The evidence and reason for the decision. A capital decision is separate.
Table view of the same rows
| Date block | Role of the block | What the record must retain |
|---|---|---|
| January 2022–December 2023 | Role of the blockResearch: define candidates and investigate errors. | What the record must retainEvery attempted variant, data choice, cost assumption and reason for rejection. |
| January–December 2024 | Role of the blockSelection: compare candidates and sensitivity. | What the record must retainChoices made from these comparisons. This block belongs to research history. |
| January–June 2025 | Role of the blockFinal unseen comparison: freeze specification and evaluation plan before opening. | What the record must retainAll outcomes, exclusions, missing data and failures. Any result-led revision makes this research data. |
| July–September 2025 | Role of the blockForward paper observation: record signals as information arrives. | What the record must retainAvailable quotes, assumed fills, skipped orders and deviations from the frozen version. |
| October 2025 | Role of the blockReview: reject, continue observation or research a new version. | What the record must retainThe evidence and reason for the decision. A capital decision is separate. |
This is one fixed chronological arrangement, not rolling walk-forward. If an unseen result guides a rule change, that block becomes research input for the new version; evaluating the revision there again does not create fresh unseen evidence.
Every date block is invented, with no real results and no required waiting schedule. Time order cannot remove all selection bias, thin samples or changing markets. Paper fills stay simulated. A good comparison does not prove a lasting advantage, and no stage requires a live trade.
Overfitting means shaping or choosing rules around the quirks of your research history. Try enough strikes, cutoffs and exits and you will find a past winner by chance, even with simple rules. Record the alternatives and why you dropped them. A holdout cannot account for every earlier search or prove a lasting edge. A weak later result may also come from changed conditions, costs or an implementation error, so look for those too.
Rolling walk-forward testing repeats the time order. At each starting point you use an earlier window to select or calibrate by a stated procedure, test on the next window, then move both forward. A rolling window of fixed length drops the oldest data. An expanding window keeps it. One research block plus one final holdout is a fixed split, not walk-forward. If the rolling comparisons help you pick the final rule, they belong to that rule’s research history. Positions that cross a window edge need a stated accounting rule.
Forward paper observation then records signals as new information arrives, with quotes, missing inputs, assumed fills and any gaps from the frozen specification. It tests whether the process can be watched and repeated. Simulated fills still cannot show your real queue place, price impact or every operational fault. No split ratio, trade count or observation period validates every system. The review may end in rejection or more research. Finishing this lesson does not require a live trade.
What does the ledger say after costs and through losses?
Reads eight invented trades after costs and drawdown.
These eight closed Call round trips are a separate invented accounting sample. They are not market data and not results from Specimen 0.1. Every entry is assumed at ₹100 for 65 units. Exits are ₹120, ₹85, ₹115, ₹80, ₹110, ₹90, ₹125 and ₹78, and each round trip carries an invented ₹100 total charge. The ledger teaches arithmetic, not how the candidate performs.
For each row, the gross result is (exit − entry) × quantity, and the net result takes off costs once. The eight gross results add up to a ₹195 gain. Total assumed costs are ₹800, which leaves a ₹605 net loss. In a real test, define brokerage, exchange and statutory charges for the dates and trades involved. Also model spread and slippage, the gap between your reference price and the price you got. If your bid and ask prices already include crossing the spread, do not charge that spread a second time.
The same trades finish differently after costs
Eight separate invented bought Call round trips, each entering at ₹100 per unit for one 65-unit teaching lot. Each complete trade carries a chosen ₹100 charge. The exits are invented inputs.
- Cumulative before costsSolid line
- Cumulative after costsDashed line
Cumulative closed-trade result · ₹
Closed-trade number · 0–8
Both series start at ₹0 and share one rupee scale with a visible zero line. Numbers show trade order, not dates or equal time gaps. The joined closes do not show what happened while positions were open.
| Series | Closed-trade number · 0–8 | Cumulative closed-trade result · ₹ |
|---|---|---|
| Cumulative before costs | 0 | 0 |
| Cumulative before costs | 1 | 1,300 |
| Cumulative before costs | 2 | 325 |
| Cumulative before costs | 3 | 1,300 |
| Cumulative before costs | 4 | 0 |
| Cumulative before costs | 5 | 650 |
| Cumulative before costs | 6 | 0 |
| Cumulative before costs | 7 | 1,625 |
| Cumulative before costs | 8 | 195 |
| Cumulative after costs | 0 | 0 |
| Cumulative after costs | 1 | 1,200 |
| Cumulative after costs | 2 | 125 |
| Cumulative after costs | 3 | 1,000 |
| Cumulative after costs | 4 | −400 |
| Cumulative after costs | 5 | 150 |
| Cumulative after costs | 6 | −600 |
| Cumulative after costs | 7 | 925 |
| Cumulative after costs | 8 | −605 |
| Closed trade | Assumed exit / unit | Before costs | After costs |
|---|---|---|---|
| Trade 1 | Assumed exit / unit₹120 | Before costs+₹1,300 | After costs+₹1,200 |
| Trade 2 | Assumed exit / unit₹85 | Before costs−₹975 | After costs−₹1,075 |
| Trade 3 | Assumed exit / unit₹115 | Before costs+₹975 | After costs+₹875 |
| Trade 4 | Assumed exit / unit₹80 | Before costs−₹1,300 | After costs−₹1,400 |
| Trade 5 | Assumed exit / unit₹110 | Before costs+₹650 | After costs+₹550 |
| Trade 6 | Assumed exit / unit₹90 | Before costs−₹650 | After costs−₹750 |
| Trade 7 | Assumed exit / unit₹125 | Before costs+₹1,625 | After costs+₹1,525 |
| Trade 8 | Assumed exit / unit₹78 | Before costs−₹1,430 | After costs−₹1,530 |
The before-cost total is +₹195. Subtracting ₹800 in assumed charges leaves −₹605 after costs. At each close, the gap between the lines is ₹100 multiplied by the number of completed trades. The two lines are the two accounting series. The ledger shows each gain or loss with its sign.
This record is separate from Specimen 0.1. Its prices were chosen for the arithmetic, not produced by a tested rule. The assumed fills already include any spread or slippage, so do not deduct it again. The charge is a teaching input, not a live tariff or a maximum cost. Every position is closed at each observation, and there are no deposits or withdrawals. No dates, holding times or marks during a trade are given.
Inspect the sample statistics and account denominator
Sort wins and losses after the assumed charge. The drawdown sum adds the cumulative net result to a separate invented account that starts at ₹5,00,000. It does not divide by the cumulative-result curve.
Per trade: before costs = (exit − 100) × 65; after costs = before costs − 100Net winners = 4; net losers = 4; winning fraction = 4/8 = 50%Net winning total = ₹4,150; net loss magnitude = ₹4,755Average net winner = ₹4,150/4 = ₹1,037.50; average net loss magnitude = ₹4,755/4 = ₹1,188.75Sample mean net = −₹605/8 = −₹75.625 per trade ≈ −₹75.63; profit factor after costs = 4,150/4,755 ≈ 0.873Account peak after trade 1 = ₹5,01,200; later trough after trade 8 = ₹4,99,395Maximum account drawdown at recorded closes = ₹1,805/₹5,01,200 × 100 ≈ 0.3601%; final result / starting account = −₹605/₹5,00,000 × 100 = −0.121%These figures do not estimate a future win chance or show an edge. A drawdown from closes alone can miss bigger losses while a trade is open. It is not a ceiling on future loss.
Four rows win and four lose after costs. The average net winner is ₹1,037.50. The average loss is ₹1,188.75. Across all eight, the mean net result is −₹75.625 per round trip, about −₹75.63 to the paisa. So four wins in eight can still give a negative average. This describes eight invented rows. It forecasts nothing.
Profit factor is total positive net results divided by the size of total negative net results. Here it is ₹4,150 ÷ ₹4,755, about 0.873. A ratio below one agrees with the net loss. Always show the totals and the sample beside a ratio, because one neat number can hide a thin sample, a few big gains or trades that depend on each other. Trades exposed to the same market move carry less separate information than their count suggests.
Drawdown is the fall from an earlier equity peak to a later low. With an invented start of ₹5,00,000, the close-of-trade net path peaks at ₹5,01,200 after trade 1 and reaches ₹4,99,395 after trade 8. The largest fall seen is ₹1,805, about 0.3601% of that peak. It measures only the closing figures supplied. It leaves out marks during a trade, open positions and any deeper dip between observations, and it is not a ceiling on future loss.
A real study needs the sample dates, the eligible and excluded signals, the costs, the capital basis, any open exposure and how often drawdown was observed. Check whether a single gain drives the result, or whether plausible costs and fills overturn it. This eight-row ledger has no holding times and no prices during the trade. It cannot support an annual return or a safe account size.
Does an order request close a position?
Tells a signal, an order and a fill apart.
A signal, an accepted order and an executed trade are three different events. An order can be acknowledged, rejected, left pending or filled in parts. A stop condition turning true creates an instruction in your system. It does not reserve an exit price. NSE describes partial order matching, and Kite Connect’s documentation separates placing an order from executing it and shows filled and pending quantities. The exact labels on your terminal depend on your provider.
Here is a separate invented execution record with three already-bought Call lots: 195 units at 65 units a lot. An exit request for all three lots fills one lot, leaving 130 units open. You request cancellation of the two outstanding lots. Before it is confirmed, another 65 units fill. The confirmed cancellation then removes the last 65-unit exit order. Total exited quantity is 130, and one lot of 65 is still open. Cancelling an order has not sold the position. This case uses whole-lot fills and is separate from the one-lot candidate and the eight accounting rows.
Before you send another instruction, reconcile the order log, the trade confirmations and the current position. A connection timeout can leave the order state unknown, and retrying as if the first request failed can double your exposure. Pause new entries while you resolve the mismatch, keep the timestamps, and decide who checks the position and how. Switching off new orders does not manage an existing position on its own. An emergency may need action under your written incident procedure.
Check available funds and open obligations again at the moment of decision. An earlier allowance does not prove that premium cash or margin is still free after other positions, charges or changed requirements. A roll closes or reduces one contract and opens another, each with its own execution, funding and costs. Following rules by hand and routing orders by program also have different operating needs. Before you automate anything, check the current SEBI, exchange and broker rules for that specific route. A classroom checklist is not permission to run a bot.
A cancelled exit order can leave a Call position open
Start with three already-bought Call lots: 195 units in all. The exit order asks to sell all 195. Each fill is one whole 65-unit lot. This case does not use the eight accounting trades.
130 of 195 units exited; Exit order cancelled; 1 teaching lot still open.
No exit sent yet
Pending acknowledgement or fill
130 exit units remain outstanding
Cancellation is pending
Reconcile intervening trade confirmation
Exit order cancelled; 1 teaching lot still open
One tile is one bought Call lot of 65 units. A blue tile is still open.
Two confirmed 65-unit exit fills sell 130 units. The cancellation removes the last unmatched 65-unit exit order, and 65 bought Call units stay open. Reconcile the fill that arrived meanwhile, and the current order state, before you decide the quantity of another exit. These records show reconciliation. They are not a guaranteed sequence or delay. Submitting and acknowledgement do not prove a fill, and a cancellation request is pending until confirmed. Pausing new entries or cancelling an order still leaves the open position, funding checks and obligations to manage. The lot size is a teaching quantity, not a current contract specification.
How do you keep a record of what changed and why?
Records each rule version, its data and its reason.
Review the process and the outcomes separately. Was the input available at the recorded time? Did the chosen contract meet the specification? Were quantities, fills and costs reconciled? Did any manual decision depart from the rule? A profitable exception is still an exception, and a correctly executed loss is still a loss. Keeping those apart lets a reviewer diagnose the process without rewriting the result.
Keep every rule version, its data, its tested assumptions and the alternatives you looked at. A wider stop or a different entry cutoff starts a new research version, with a reason and an effective date. Keep the earlier history, including the final block that prompted the change. An urgent safety step during an incident may be needed. Record the circumstances and the orders. Do not insist that nothing may ever change mid-trade, and do not quietly relabel the exception as the tested rule.
Choose your review and pause conditions in advance, and look into serious failures as they happen. The conclusion may be rejection, data repair, more paper observation or a new research version. Explain the decisions and the exposure, including why the system did nothing. A good research result alone does not settle a separate decision about capital or going live. The next lesson, dual-journaling, shows how to link what you intended to what you did.
A rule change also changes which evidence is fresh
A reviewer records the rule version and whether a data block helped choose it. The version numbers are examples of that record. They claim no research or test result.
- 0.1 · candidate
Research comparisons used to choose rules and assumptions
Keep the attempted variants and reasons for selection or rejection.
- 0.2 · frozen selection
Final block withheld before evaluation; once inspected, its result is known
Report the frozen version’s result. If it guides a revision, retain this block as used research for that revision.
- 0.3 · revised rules
Earlier inspected block is used evidence for this new version
Returning to that block is another research comparison. A fresh unseen check requires data uninvolved in choosing this revision.
A new version number keeps the change history. It cannot make evidence you have already seen unseen again. Rejection, more research or more paper observation are all possible review outcomes. This log goes with the earlier time-order example. It is not a minimum number of versions, a waiting period or proof that a final comparison shows future profit. Record emergency actions separately, with the reason and time, and keep the earlier specification and results.
Before you go
Check yourself
5 questions from this lesson. Pick an answer to see why, then slide on to the next.
Question 1 of 5
01A rule needs a completed NIFTY bar. When can the simulated decision use its final close?
02A paper budget is ₹6,000 and the assumed commitment including allowance is ₹6,600 per whole lot. What size fits that budget?
03An existing 195-unit position has a sell exit order. Two 65-unit fills occur before the remaining 65-unit order balance is confirmed cancelled. What remains?
04A researcher views the reserved test result and changes the entry threshold to improve it. How should the reused period be labelled?
05The constructed record earns +₹195 before costs and assigns ₹800 in total charges. Which conclusion follows?

0 of 5
Some questions are still open: go back and answer them.
Questions readers ask
Common questions
01Is a mechanical trading system the same as automated trading?
No. Mechanical or systematic means written rules guide the decisions. Automated means software does some of the work, such as checking a condition or sending an order. You can follow a mechanical checklist by hand, and software can run an incomplete rule. Coding does not make a system profitable. Before you automate, check the current Indian exchange, broker and SEBI rules for that route.
02What makes a trading rule reproducible?
Another reader, with the same rule version and the information available at the time, must reach the same decision. That needs the series you watch, the rule for a completed bar, the threshold, the contract, the quantity, the funding checks, the order instructions, the exits and what to do on an exception. Keep skipped and rejected signals as well as fills. A recorded discretionary decision can be reviewed too. An unrecorded one is hard to rebuild without hindsight.
03How should a system handle missing or stale option data?
Follow the data-quality rule you wrote before testing, and record why. A missing quote is unknown. It is not a zero price and not proof the signal failed. Skipping a new entry is different from managing a position you already hold. If an exit or an order status is unknown, reconcile the real position and the open orders under your incident procedure. Do not erase the trade or assume the account is flat.
04What is look-ahead bias in an options backtest?
It is using information in a simulated decision that was not available yet. Examples: using a candle before its final value arrived, picking contracts by their later liquidity, or choosing the favourable stop-or-target order from a bar that cannot say which came first. Keep both the event time and the time the data arrived, the contracts that were eligible then, and a stated rule for unclear outcomes.
05Can I reuse the same out-of-sample period after changing the rules?
You can look at it again as research, but it is no longer fresh, unseen evidence for a version shaped by that look. Keep the original version and every change you tried. A fixed holdout reserves one later block. Rolling walk-forward moves an earlier fitting window and a later test window forward together. If those tests help you choose the final rules, they count as research and selection.
06Why can a record with a 50% win rate still lose after costs?
Win rate counts how many closed trades made money. It says nothing about how much. In the invented eight-trade record, four net winners average ₹1,037.50 and four net losers average ₹1,188.75. After the assumed charges the record ends at −₹605. The 50% and the negative average describe these chosen outcomes, not future odds.
07Does profitable paper trading prove a system will work with real orders?
No. Paper observation can check that signals arrive, data is available, logging works and the process matches the specification. Its assumed fills do not show real queue place, execution price, available size or funding. Keep those assumptions visible and chase any gap. A review can reject the candidate or continue research. You never need a live trade to finish this lesson, and a good paper result guarantees nothing.
08Should a trading pause freeze every action or allow rule changes?
A pause can switch off new entries and additions. Existing positions, protective orders, pending cancellations, funding and settlement still need managing. Use incident and restart criteria you prepared earlier, and record any emergency exception with its reason, the information you had and the orders or fills. A planned change to entry, exit or size gets a new version and its own test history. It must not quietly replace the version behind earlier results.
