You downloaded data. You tested an idea. But between a backtest and real money, there's a machine you've never seen — orders, fills, stop-losses, rejections, race conditions. Next session, you build a piece of it.
You describe a rule. Claude turns it into a simulator that runs on your NIFTY data. LIMIT orders, slippage, stop-losses, partial fills. Your backtest gets honest.
You get a day’s trade log from a system that trades real money. Parse it. Trace a trade. Spot the failure. Then see the live system on screen.
You build a simulator on your data. You read a real system's trade log. You see the live system on screen. No broker account needed.
~2 hours · you build + you investigate
Prerequisite: your NIFTY data from Session 1 (the free Parquet files).
You have data. You have a signal. Today you'll simulate the entire journey from signal to filled order to stop-loss — then read how a real system does it.
| What your backtest assumed | What actually happens |
|---|---|
You buy at close of the candle |
By the time your order reaches the exchange, price moved 2–5 points |
| Every order fills instantly | LIMIT orders can sit unfilled for minutes — or expire |
| Stop-loss triggers at the exact price | SL is a LIMIT order too. It can be rejected, delayed, or partially filled |
| You always exit at your chosen time | No liquidity in last 2 minutes. Squareoff at 3:15, not 3:29 |
| One trade at a time, no complications | Cancel-and-fill race. Partial fills. Margin blocks. Circuit limits. |
Notice what changed from Session 1: you're not just saying “buy.” You're saying how — LIMIT, not market. With a stop-loss. With slippage. With a closing time. That's the difference between a backtest and a simulation.
Record the opening price. Start scanning candles. No signal yet.
Price dropped 80 points from open. Place a LIMIT order 2 points below current price. Order status: PENDING.
Did this candle's low touch our limit price? Yes → FILLED. No → keep waiting. After 5 minutes with no fill → EXPIRED.
Once filled: check each candle. Did low breach SL? → SL HIT. Reached 15:15? → SQUAREOFF at close price.
Paper Trading Simulator — NIFTY 1-min data (21 trading days) Rule: buy if open-80, LIMIT current-2, SL 30pts, exit 15:15, slippage 2pts Day Signal Limit Fill Entry SL Exit Why P&L 2026-04-21 09:47 24,418 24,420 24,420 24,390 24,405 Squareoff −₹1,125 2026-04-22 — — — — — — No signal ₹0 2026-04-23 10:12 24,308 24,310 24,310 24,280 24,280 SL Hit −₹2,250 2026-04-24 09:32 24,548 EXPIRED — — — No fill ₹0 2026-04-25 11:05 24,477 24,479 24,479 24,449 24,522 Squareoff +₹3,225 2026-04-28 09:22 24,610 24,612 24,612 24,582 24,582 SL Hit −₹2,250 2026-04-29 — — — — — — No signal ₹0 2026-04-30 10:45 24,380 24,382 24,382 24,352 24,418 Squareoff +₹2,700 ... (21 days total) Summary: Signals: 14 | Fills: 11 | Expired: 3 | SL Hits: 4 | Squareoffs: 7 Net P&L: −₹2,025 | Win rate: 63% | Avg win: +₹2,850 | Avg loss: −₹2,250
Each of these is one sentence to Claude. Re-run the simulator, compare results.
Wider stop-loss. Fewer SL hits — but when you lose, you lose bigger. Does net P&L improve or get worse?
More realistic for volatile moments. Watch your win rate stay the same but P&L shrink. That's the cost of execution.
Filters out late signals. Fewer trades, but are they better trades? You now have a time filter.
You wanted 65 units, you got 40. Your P&L math changes. Welcome to partial fills.
| Session 1 backtest | Session 2 simulator |
|---|---|
| Buy at candle close — instant | LIMIT order, waits for fill, can expire |
| Perfect price every time | Slippage on every fill |
| No stop-loss concept | SL placed, tracked, triggered |
| Exit at any time | Forced squareoff at 15:15 |
| Every trade happens | Orders can expire unfilled |
Margin checks. Broker rejections. Multiple positions. Trailing stop-losses. Crash recovery. Concurrent orders. That's the full course — but your simulator is already more honest than 90% of backtests people use to trade real money.
timestamp,event,order_id,instrument,side,qty,order_type,price,status,fill_price,fill_qty,sl_price,remarks 09:15:01,SIGNAL,—,NIFTY25MAY24500CE,—,—,—,—,—,—,—,—,entry signal fired 09:15:02,ORDER,ORD-7741,NIFTY25MAY24500CE,BUY,65,LIMIT,152.00,PENDING,—,—,—,entry order placed 09:15:04,FILL,ORD-7741,NIFTY25MAY24500CE,BUY,65,LIMIT,152.00,FILLED,151.50,65,—,full fill 09:15:05,ORDER,ORD-7742,NIFTY25MAY24500CE,SELL,65,SL-LIMIT,121.20,PENDING,—,—,121.20,SL placed 09:45:00,SL_MODIFY,ORD-7742,NIFTY25MAY24500CE,SELL,65,SL-LIMIT,128.50,OPEN,—,—,128.50,SL trailed 10:15:00,SL_MODIFY,ORD-7742,NIFTY25MAY24500CE,SELL,65,SL-LIMIT,135.80,OPEN,—,—,135.80,SL trailed 11:02:33,FILL,ORD-7742,NIFTY25MAY24500CE,SELL,65,SL-LIMIT,135.80,FILLED,134.90,65,—,SL triggered — 09:15:02,ORDER,ORD-7743,NIFTY25MAY24500PE,BUY,65,LIMIT,148.00,PENDING,—,—,—,entry order placed 09:15:03,FILL,ORD-7743,NIFTY25MAY24500PE,BUY,65,LIMIT,148.00,FILLED,148.50,65,—,full fill 09:15:05,ORDER,ORD-7744,NIFTY25MAY24500PE,SELL,65,SL-LIMIT,118.40,PENDING,—,—,118.40,SL placed 09:47:12,REJECTED,ORD-7744,NIFTY25MAY24500PE,—,—,—,—,REJECTED,—,—,—,price exceeds circuit limit 09:47:13,ALERT,—,NIFTY25MAY24500PE,—,65,—,—,—,—,—,—,CRITICAL: position has no SL ...
price vs fill_price)The PE position was filled at 148.50. The system placed a stop-loss at 118.40. But the exchange had set a circuit limit — max allowed price was lower than 118.40. SL was rejected. The position is now naked.
Sends a CRITICAL Telegram alert immediately. The operator sees it. The code retries with a clamped price. If retry fails — emergency squareoff. Never leave a position unprotected.
Your Session 2 simulator doesn't handle this. A real system must. This is why execution engineering exists.
Open positions, pending SLs, filled trades — on the broker terminal. The same structure you just parsed in CSV, but live. Code placed every one of these.
Each position has an SL. Some were trailed three times today. Some hit circuit limits and were re-placed. The safety net you just saw fail — here's how it's fixed.
Same format as your CSV. But scrolling in real time. Signals, fills, SL modifications, alerts. Every line is a decision the code made.
Entries, exits, errors, CRITICAL warnings — on my phone. Four severity levels. The system watches itself so the operator doesn't have to.
A Python script that runs realistic paper trades on your NIFTY data. LIMIT orders, slippage, SL, squareoff, partial fills. Re-run with any rule you want.
Signal → order → fill → SL → exit. You understand the lifecycle. You know what PENDING, FILLED, REJECTED, and EXPIRED mean.
You saw a real SL rejection. You saw a position go naked. You know that the gap between a simulator and a live system is where money is lost.
The full course builds the remaining six boxes — trailing, margin, crash recovery, alerts, multi-leg, going live. One lot of real money. Twelve weeks.
12 weeks · ~3 hours each · build a live trading system