Next Session · Paid Workshop

Your backtest said “buy.”
Now what?

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.

Data
Session 1
Signal
Session 1
Trail
Squareoff
Recovery
Alerts
Next session: you build a simulator, then read a real system's trade log.
Session 2 — Two halves

Build it. Then read the real thing.

Hour 1 — Build a paper trading simulator

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.

Hour 2 — Read a real production log

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.

Sent 3 instead of 195

One segment counts in lots. Another in units. The API doesn't warn you. It just places the wrong quantity.

SL rejected at circuit limit

Exchange says max price is 180. Your SL was at 200. Rejected. Position now has no safety net.

Cancel and fill at the same time

You cancelled the order. Broker said OK. But it filled 30ms earlier. Now you own something you didn't want.
These are from a real bug log. 197 entries. You'll read three of them.
Next Session

From Signal to Order.

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.

One session. Hands-on.

~2 hours · you build + you investigate

2,500

Prerequisite: your NIFTY data from Session 1 (the free Parquet files).

Session 2 · From Signal to Order

Your code said “buy.”
Let's see what happens next.

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.

Part 1: Build a simulator
Part 2: Read a real trade log
~2 hours total
The problem

Your backtest lied to you.

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.
Today we fix the first four. The fifth one — that's the full course.
Part 1 · Build

Paper trading simulator.

Same data from Session 1. But now your backtest knows about order types, slippage, unfilled orders, and stop-losses.
Vocabulary

Six words you need before we start.

LIMIT order
Buy only at this price or better. Won't fill if the market never touches it.
Buy NIFTY CE at ≤ 150.00
Fill
Your order matched with a seller. Money moved. You now own the position.
FILLED 65 units @ 148.50
Slippage
The gap between the price you wanted and the price you got. Always exists.
Wanted 150, got 152. Slippage = −₹150
Stop-loss (SL)
An exit order that fires when price moves against you. Your safety net.
SL at 120 → exit if price ≤ 120
Squareoff
Force-close the position at a fixed time. No opinions — just get out.
Squareoff at 15:15 IST
Rejection
The exchange said no. Insufficient margin, invalid price, circuit limit. Your order didn't happen.
REJECTED: price exceeds circuit limit
Step 1

Describe your rule. One sentence.

What you type to Claude
“Simulate this on my NIFTY data: if NIFTY drops 80 points from today's open, buy with a LIMIT order 2 points below current price. Stop-loss 30 points below entry. Squareoff at 15:15. Add 2 points of slippage on every fill.”

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.

Same data. Much more honest question.
Step 2

What the simulator does, minute by minute.

1

09:15 — Day opens

Record the opening price. Start scanning candles. No signal yet.

2

Signal fires

Price dropped 80 points from open. Place a LIMIT order 2 points below current price. Order status: PENDING.

3

Fill check (each candle)

Did this candle's low touch our limit price? Yes → FILLED. No → keep waiting. After 5 minutes with no fill → EXPIRED.

4

SL & squareoff

Once filled: check each candle. Did low breach SL? → SL HIT. Reached 15:15? → SQUAREOFF at close price.

SIGNAL
PENDING
FILLED
SL ACTIVE
SL HIT
or
SQUAREOFF
Step 3

Run it. Read the trade log.

simulation output
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
Notice: 3 orders never filled. That never happened in your Session 1 backtest.
Step 4

Tweak the knobs. See what changes.

Each of these is one sentence to Claude. Re-run the simulator, compare results.

A

“Change SL to 50 points”

Wider stop-loss. Fewer SL hits — but when you lose, you lose bigger. Does net P&L improve or get worse?

B

“Add 5 points slippage instead of 2”

More realistic for volatile moments. Watch your win rate stay the same but P&L shrink. That's the cost of execution.

C

“Only trade if signal fires before 10:00 AM”

Filters out late signals. Fewer trades, but are they better trades? You now have a time filter.

D

“What if 30% of orders only partially fill?”

You wanted 65 units, you got 40. Your P&L math changes. Welcome to partial fills.

Same strategy. Four different realities. That's why execution matters.
What just happened

You built a realistic simulator.

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

What's still missing?

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.

Part 2 · Investigate

A real system's trade log.

This is one day’s output from a system that trades real money on Indian markets. You'll parse it, trace a trade, and find the failure.
The data

One CSV file. One day of real trades.

trade_log_2026-05-19.csv
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
...
Real order IDs replaced with dummy IDs. Everything else is exactly as it happened.
Your investigation

Parse it. Answer five questions.

Load the CSV in pandas. Then answer:

  1. How many orders were placed? How many filled, how many rejected?
  2. Trace ORD-7741 — from PENDING to FILLED. What was the slippage? (Hint: compare price vs fill_price)
  3. How many times was the SL modified (trailed) before it triggered? What was the final SL price vs the original?
  4. Find the CRITICAL alert. Why was ORD-7744 rejected? What does “position has no SL” mean for the trader?
  5. Compute the P&L for the CE leg. Entry fill price − exit fill price × quantity. Was it a win or a loss?
You're reading the same log format the system's operator reads every morning.
The failure

Did you catch it? Position with no stop-loss.

PE FILLED
SL PLACED
SL REJECTED
NO SAFETY NET

What happened

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.

What the real system does

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.

Live demo

Now let me show you the real thing.

Order book

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.

Stop-losses

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.

Log stream

Same format as your CSV. But scrolling in real time. Signals, fills, SL modifications, alerts. Every line is a decision the code made.

Telegram alerts

Entries, exits, errors, CRITICAL warnings — on my phone. Four severity levels. The system watches itself so the operator doesn't have to.

Same structure you parsed. Real money. Running right now.
The full picture

What you built today is boxes 1–3.

Signal
Session 1+2
Order
Today
Fill / SL
Today
Trail
Course
Margin
Course
Recovery
Course
Alerts
Course
Multi-leg
Course
Go live
Course
197
Bugs found
in live trading
197
Bugs fixed
with code
12
Weeks to build
the full system
Each box has bugs that cost real money. The course teaches all nine.
What you take home

Today you leave with three things.

1

A simulator

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.

2

A mental model

Signal → order → fill → SL → exit. You understand the lifecycle. You know what PENDING, FILLED, REJECTED, and EXPIRED mean.

3

A healthy fear

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 simulator is yours. Run it tonight. Change the rule. See what happens.
End of Session 2

Signal → Order → Fill → SL.
You get it now.

The full course builds the remaining six boxes — trailing, margin, crash recovery, alerts, multi-leg, going live. One lot of real money. Twelve weeks.

The full course.

12 weeks · ~3 hours each · build a live trading system

2,500/week
← → navigate · F fullscreen · click to advance
1 / 17