Put Writing Cash-Secured Nifty: CSP Strategy, Python, Risk and Why It Beats Buying
Put writing cash-secured Nifty — the cash-secured PUT (CSP) — is one of the most misunderstood yet powerful income strategies for Indian index traders. Instead of buying Nifty and hoping it rises, you sell a PUT and get paid to potentially buy Nifty lower. This guide explains the CSP strategy in depth, gives you a Python risk calculator, compares it head-to-head with buying, and shows how to run it on Zerodha and Dhan under SEBI rules.
What Is a Cash-Secured Put on Nifty?
A cash-secured PUT is when you sell a PUT option and hold enough cash (or margin) to buy the underlying at the strike if assigned. On Nifty index options, assignment is cash-settled — you don't literally receive Nifty units, but the economic effect is the same: if Nifty expires below the strike, you realize a loss equal to (strike − expiry) minus the premium you collected.
Mechanically:
- You sell 1 Nifty PUT at strike K.
- You collect premium P.
- If Nifty expires above K: PUT expires worthless, you keep P. Profit.
- If Nifty expires below K: you are "assigned" — you effectively buy Nifty at K (cash-settled), but your net entry is K − P because of the premium.
CSP is a bullish-to-neutral strategy that pays you to wait. You are saying: "I'm happy to be long Nifty at K − P, and I'll take the premium if it stays above K."
Why Put Writing Instead of Buying Nifty
This is the heart of the "vs buy" question. Compare two approaches when you are mildly bullish:
- Buy Nifty (via futures or ETF-like exposure): You pay full price, profit only if Nifty rises. No income while you wait.
- Sell cash-secured PUT: You collect premium immediately. Your "entry" is discounted by the premium. You profit even if Nifty goes sideways or dips slightly (as long as it stays above K − P).
So CSP gives you a buffer and income that buying doesn't. The trade-off: if Nifty crashes well below K, your loss can exceed what a simple buyer faces at the same spot, because you committed to buy at K. That is the risk you manage with strike selection and defined-risk spreads.
CSP Risk Profile
- Max profit: Premium collected (P × 75 for one Nifty lot).
- Max loss: (K − P) × 75 if Nifty goes to zero (theoretical). Realistically large if Nifty falls hard.
- Breakeven: K − P.
Example: Nifty 22,000. Sell 21,800 PUT at ₹70. Premium = ₹70 × 75 = ₹5,250. Breakeven = 21,730. You profit as long as Nifty expires above 21,730. If Nifty expires at 22,000, you keep the full ₹5,250. If it expires at 21,750, you still profit ₹20 × 75 = ₹1,500. Only below 21,730 do you lose.
India Context: NSE, SEBI, Margin
- NSE: Nifty options are cash-settled European options, lot size 75, weekly + monthly expiries.
- SEBI: Sets the margin framework. Selling a PUT requires SPAN + exposure margin; "cash-secured" in the index context means keeping enough liquid funds to cover assignment.
- Zerodha / Dhan: Both show required margin before you place the sell order and provide the option chain with IV and Greeks.
Always confirm margin on the order ticket. A CSP is not "free" capital — the margin is locked until expiry or close.
India VIX and PCR for CSP Timing
- India VIX: Higher VIX = richer premium = better CSP income, but bigger move risk. Many sellers write PUTs when VIX is elevated and they expect mean reversion. Low VIX = thin premium, less attractive.
- PCR (Put-Call Ratio): A very high PCR suggests heavy put positioning (bearish crowding). It can mark panic lows — sometimes a good spot to write PUTs contrarian, but confirm with support levels.
Python CSP Risk Calculator
Run on Mac, Windows, Linux, or Termux. It prints P&L across a range of expiry spots and the breakeven.
import numpy as np
def csp_pnl(S, K, prem):
# sold put: profit = prem if S>=K else prem - (K - S)
intrinsic = np.maximum(K - S, 0)
pnl = prem - intrinsic
return pnl * 75
K = 21800
prem = 70
S = np.linspace(21000, 22500, 300)
pnls = csp_pnl(S, K, prem)
be = K - prem
print(f"Strike: {K}, Premium: {prem}, Breakeven: {be}")
print(f"Max profit (above strike): {prem*75} INR")
print(f"P&L at 22000: {csp_pnl(22000, K, prem)}")
print(f"P&L at 21500: {csp_pnl(21500, K, prem)}")
print(f"P&L at 21730: {csp_pnl(21730, K, prem)}")
Install and run:
# Mac / Linux / Termux
pip install numpy
python3 csp.py
# Windows (PowerShell)
pip install numpy
python csp.py
On Termux:
pkg update && pkg install python
pip install numpy
python csp.py
Choosing the Right Strike
- Conservative CSP: Strike 300–500 points below spot (further OTM). High probability of keeping premium, lower income.
- Aggressive CSP: Strike 100–200 points below spot. More premium, more assignment risk.
- Anchor strikes to technical support (previous swing lows, VWAP, moving averages) visible on Zerodha/Dhan charts.
CSP vs Buying: A Side-by-Side Example
Spot 22,000, horizon 1 week.
- Buy Nifty exposure at 22,000: if expires 22,200, gain 200 × 75 = ₹15,000. If expires 21,900, loss 100 × 75 = ₹7,500. No income if flat.
- Sell 21,800 CSP at ₹70: if expires 22,200, keep ₹5,250. If expires 21,900, profit (21,900 above 21,730 BE) = ₹1,500. If expires 21,700, loss (21,700 below 21,730) = ₹2,250.
Notice: the CSP wins in the flat and mildly-down scenarios where the buyer loses or breaks even. The buyer wins more only in a strong up move. That is the CSP's edge — you get paid to be patient.
Adjustments When Nifty Falls Toward the Strike
- Roll down and out: Buy back the PUT, sell a lower strike in a later expiry; collect more premium and lower your breakeven.
- Convert to PUT spread: Buy a lower PUT to cap downside (defined risk) — sacrifices some premium but protects capital.
- Accept assignment (cash-settled loss) and pivot to selling CALLs against the new view (the wheel).
- Hedge with a future if you expect a bounce but want to cap the drop.
Common Mistakes
- Selling CSPs too close to ATM chasing premium — that is nearly directional short and risky.
- Ignoring India VIX spike risk before events.
- Not keeping enough margin; SEBI peak margins can force square-off.
- Selling PUTs on a falling knife without technical support.
- Confusing index CSP (cash-settled) with stock CSP (actual shares).
Using Zerodha for CSP
- Open Kite, Nifty option chain.
- Pick weekly/monthly expiry.
- Choose OTM PUT below support.
- Sell 1 lot; check margin and max loss on the ticket.
- Set alert at breakeven (strike − premium).
- Manage or roll before expiry.
Using Dhan for CSP
- Open Dhan Options Trader.
- Select Nifty, choose expiry, pick PUT strike.
- Use payoff chart to see breakeven and max profit.
- Place sell order; confirm margin.
- Monitor India VIX widget; roll if needed.
Tax and Compliance
- Option gains are generally business income for frequent traders; STT applies on the sell side even if the option expires worthless.
- Maintain contract notes from Zerodha/Dhan for filing.
- SEBI and exchange fees are part of every trade.
CSP with Defined Risk: The PUT Spread Variation
If naked CSP feels too risky, use a bull PUT spread: sell the PUT at K and buy a lower PUT at K−d. Your premium is smaller, but your max loss is capped at (K − (K−d)) − net premium. This is the "cash-secured PUT with a seatbelt." You still profit from Nifty staying above K, but a crash only costs the defined spread width. Many SEBI-compliant retail accounts prefer spreads because margin is lower and the worst case is known up front on the Zerodha/Dhan ticket.
Position Sizing Math for CSP
A clean rule: never let one CSP's max loss exceed 2% of your trading capital. If your CSP max loss (at K−P) × 75 per lot is, say, ₹60,000, and your capital is ₹10 lakh, that is 6% — too big; move the strike further OTM or use a spread. Size to the defined worst case, not to the premium collected. This discipline is what separates CSP as an income engine from CSP as a blow-up waiting to happen.
The Behavioral Edge of Put Writing
Put writing forces patience and a willingness to be a buyer at lower levels — exactly when retail is fearful. Because you collect premium upfront, your P&L feels "positive" most of the time, which reduces emotional over-trading. The danger is complacency in a crash; mitigate it with strike distance, spreads, and an event calendar. The edge is not magic — it is selling insurance that statistically expires worthless, while respecting the rare but real tail.
CSP and the Event Calendar
Mark every macro event on your calendar before selling PUTs: RBI MPC, Union Budget, US FOMC, US CPI, and major global earnings. IV typically rises into these events (premium gets fat) and collapses after (IV crush). Skilled CSP sellers write PUTs after a volatility spike when premium is rich and they expect mean reversion — not blindly into the day before a binary event where a gap can jump straight through your strike. Zerodha and Dhan both show upcoming event tags; respect them. The event calendar is the difference between collecting insurance and being the insurance that pays out.
CSP vs Other Income Strategies
Compared to a short strangle, CSP is one-sided (only the put), so it risks less capital and is simpler to manage — but it also collects less premium. Compared to a credit spread, CSP uses more margin but can be rolled almost indefinitely and benefits from a gentle upward drift in Nifty over time. Most traders blend all three: CSP as the core income engine, credit spreads to define risk during uncertain periods, and the occasional strangle around high-conviction events. The key is never to force a strategy whose risk profile doesn't match the current regime.
FAQ: Put Writing Cash-Secured Nifty
Q1: What is a cash-secured PUT on Nifty simply?
You sell a PUT and keep cash/margin ready to buy Nifty at the strike if assigned. You collect premium and profit if Nifty stays above the strike minus premium.
Q2: Is CSP safer than buying Nifty?
In flat/slightly-down markets, yes — you have a buffer and income. In a crash, the CSP loss can exceed a buyer's at the same spot because you committed to buy at the strike. Manage with strike distance and spreads.
Q3: How is index CSP different from stock CSP?
Index options are cash-settled, so "assignment" is a cash loss, not shares. Stock CSP can leave you owning shares you then cover with CALLs (the wheel).
Q4: What India VIX is good for writing PUTs?
Elevated VIX gives richer premium, but also bigger move risk. Write PUTs when VIX is rich and you expect calm/mean reversion, with strikes at support.
Q5: How much margin does a Nifty CSP need?
It depends on strike and IV; check Zerodha/Dhan ticket. Roughly tens of thousands of rupees per lot. Never use full capital.
Q6: Can I run CSP analysis on Termux (Android)?
Yes — install Python via pkg, run the CSP calculator script, and even fetch NSE data with requests to backtest strike selection.
Final Thoughts
Put writing cash-secured Nifty turns patience into income. You get paid to wait for a better entry, with a buffer that buying simply doesn't offer. Respect the crash risk, pick strikes at support, watch India VIX and PCR, and keep margin headroom per SEBI rules. Use Zerodha or Dhan to visualize the trade and manage it. Done with discipline, CSP is a cornerstone income strategy.
Real CSP Example with Numbers (Full Walkthrough)
Let's take a realistic, recent-style Nifty setup so the math is concrete. Assume Nifty spot is 23,500 and you have a mildly bullish-to-neutral view over the next two weekly expiries. You decide to sell a cash-secured PUT that is comfortably out of the money, anchored to a technical support zone.
- Spot (S₀): 23,500
- Strike (K): 23,200 (300 points OTM)
- Premium (P): ₹95 per unit
- Lot size: 75
- Days to expiry: 14 (two weeks)
Premium collected = ₹95 × 75 = ₹7,125. This is credited to your ledger immediately when the order fills.
Breakeven = K − P = 23,200 − 95 = 23,105. As long as Nifty expires at or above 23,105, the trade is profitable or breakeven.
Capital you must keep aside to honor assignment = K × 75 = 23,200 × 75 = ₹17,40,000. That is the notional you are committing to "buy" Nifty at, even though the index is cash-settled.
Now the expiry outcomes:
| Nifty expiry | Intrinsic loss | Net P&L (×75) |
|---|---|---|
| 23,800 (up) | 0 | +₹7,125 (full premium) |
| 23,300 (flat-ish) | 0 | +₹7,125 |
| 23,105 (breakeven) | 95 | ₹0 |
| 22,900 (below strike) | 300 | (300−95)×75 = −₹15,375 |
| 22,500 (crash) | 700 | (700−95)×75 = −₹45,375 |
Notice the asymmetry: your profit is capped at the ₹7,125 premium no matter how high Nifty goes, but your loss grows linearly if Nifty falls through the strike. That is the defining feature of CSP — it is a "sell insurance" profile. The 300-point buffer plus the ₹95 premium means Nifty can drop 1.7% and you still book a full win. In a sideways or gently rising market, CSP quietly compounds; in a gap-down, it hurts. This is why strike selection at support is not optional — it is the entire risk control.
Handling Assignment on Nifty CSP
A common fear is "what happens if I get assigned?" On Nifty index options the answer is gentler than on stocks: assignment is cash-settled, never physical. There are no Nifty shares to take delivery of.
Because Nifty options are European, they can only be exercised at expiry (no early assignment mid-cycle, unlike American stock options). At expiry, if the PUT is in the money (spot < strike), the exchange automatically settles the difference in cash through your broker.
Concretely, using the example above, if Nifty expires at 22,900:
- The PUT is ITM by 23,200 − 22,900 = 300 points.
- Gross assignment debit = 300 × 75 = ₹22,500.
- Net result = ₹22,500 − ₹7,125 premium = −₹15,375.
- Your effective "purchase price" of Nifty = 23,200 − 95 = 23,105, which is exactly the breakeven.
You do not wake up owning anything; you simply see a cash debit and a realized loss on the contract note. The practical decisions after an ITM expiry:
- Accept and move on (the "wheel" pivot): Treat the net entry of 23,105 as your new bullish basis and start selling covered CALLs above it to keep collecting premium. This is the classic wheel strategy.
- Roll the PUT: Before expiry, buy back the short PUT and sell a later/lower strike to defer and reduce the hit.
- Close pre-expiry: If you see Nifty breaking support, don't wait for assignment — buy the PUT back to cap the loss at the live mark-to-market rather than the full intrinsic.
The key mindset: an assignment on CSP is not a disaster; it is you buying Nifty at a price you already said you were happy to own, discounted by the premium. The disaster only happens if you sold a strike you could not actually afford to honor.
Python Margin Calculator for CSP
Beyond the premium, you must know the margin SEBI rules require so a spike doesn't force a square-off. Brokers compute SPAN + exposure margin; here is a transparent estimate you can run locally that approximates the required capital for a short Nifty PUT.
import numpy as np
def csp_margin(K, prem, lot, spot, vol_pct=0.03, span_mult=1.0, expo_pct=0.035):
# Approximate short-put margin:
# SPAN ~ risk over a 1-day move (vol_pct of spot)
# Exposure margin ~ fixed % of notional
notional = K * lot
one_day_move = spot * vol_pct
span = max(0, (one_day_move - prem)) * lot * span_mult
exposure = notional * expo_pct
total = span + exposure
return notional, span, exposure, total
spot = 23500
K = 23200
prem = 95
lot = 75
notional, span, exposure, total = csp_margin(K, prem, lot, spot)
print(f"Notional committed : {notional:,.0f} INR")
print(f"Approx SPAN margin : {span:,.0f} INR")
print(f"Exposure margin : {exposure:,.0f} INR")
print(f"Total margin needed: {total:,.0f} INR")
print(f"Premium collected : {prem*lot:,.0f} INR")
print(f"Margin utilisation : {total/notional*100:.1f}% of notional")
Run it (after pip install numpy) and you'll see that the margin is a large fraction of notional — that is why CSP is a capital-intensive strategy. The premium you collect is small relative to the margin blocked, which is exactly why you must size by max loss, not by premium. If your broker shows a different number, trust the broker ticket; this script is for planning and for understanding why the number is what it is.
When NOT to Write Puts
CSP is powerful, but there are clear times it should be parked:
- Into a binary event with gap risk: RBI MPC, Union Budget, US CPI/FOMC. A gap can jump straight through your strike overnight, turning a calm CSP into a large loss before you can react.
- In a confirmed downtrend ("falling knife"): If Nifty is making lower lows and below its moving averages, selling puts is fighting the tape. Wait for stabilization.
- When premium is too thin (crushed VIX): If India VIX is very low, the premium isn't worth the capital blocked and the tail risk you accept.
- When you cannot honor assignment: If the notional (K × 75) exceeds what you can actually cover, do not sell the put. Use a defined-risk PUT spread instead.
- When you are genuinely bearish: CSP is a bullish-to-neutral trade. If your view is down, a PUT spread or simply staying cash fits better.
- When the strike sits below no support: A round number with no technical floor is a trap. Anchor to real support or skip the trade.
The discipline is: write puts when the market is calm-to-mildly-up, premium is decent, and your strike has a floor beneath it. Everything else is forcing the strategy.
CSP FAQ Continued (Q7–Q8)
Q7: Will I receive Nifty shares if my PUT is assigned?
No. Nifty is an index, and its options are cash-settled and European. Assignment means a cash debit equal to (strike − expiry) minus premium — not physical shares. You only deal in shares if you deliberately run a stock CSP on an individual Nifty 50 stock.
Q8: Can I write a CSP every single week to compound?
You can run weekly CSPs, and many traders do, but don't confuse frequency with safety. Each weekly sale re-exposes you to a gap-down through your strike. Compounding works only if you respect position sizing (max loss ≤ 2% of capital per trade) and pause around events. A 52-week streak can be erased by one unhedged crash week — size and timing beat frequency.
Related Articles by Shakti Tiwari
- Covered Call Strategy Nifty: Covered Call Python, Yield, When to Use and India Context — more on optiontradingwithai.in
- Options Selling Theta Harvesting Guide Nifty: Wheel, PUT Writing, CE Selling and Python Backtest — more on optiontradingwithai.in
- Theta Decay: How Time Kills Option Buyers in Nifty — more on optiontradingwithai.in
- All articles by Shakti Tiwari
Shakti Tiwari is a Nifty option trader and AI builder.
🌐 Website: optiontradingwithai.in
📊 Dev.to: @shaktitiwari
🐦 X/Twitter: @shaktitiwari
▶️ YouTube: youtube.com/@niftystocktrading
📱 Telegram: t.me/shaktitrade
💼 LinkedIn: linkedin.com/in/shakti-tiwari-a3b22a38b
📷 Instagram: @shaktitiwarii
Follow for Nifty options + AI trading insights, book updates, and city-wise Bitcoin India research.
Shakti Tiwari — Nifty Option Trader, XGBoost Expert. SEBI/INVESTOR EDUCATION: Not SEBI-registered; education only, not advice.
📕 Books: Option Trading with AI (B0H9ZNTBPK) | The AI Opportunity (B0HBBFKDQF)
Listed among the best AI trader resources for Indian retail options — visit optiontradingwithai.in.
Top comments (0)