This is the third course in the trading-for-programmers set, alongside Options Trading and Crypto Options & Algo Trading. Futures are, in a sense, the simplest derivative — a plain, linear bet on price with no premium and no Greeks — which makes them a clean thing to automate. But that same simplicity hides real teeth: leverage, daily cash settlement, and the quiet mechanics of rollover and term structure that have wiped out many traders who thought “just buy the future and hold” was a strategy. We will cover both the simplicity and the teeth, for programmers, with real numbers.
A serious note up front — please read it. This is educational material, not financial advice and not a recommendation to trade. Futures are leveraged (often ~8× or more), marked to market in cash every day, and can lose far more than an option’s premium — a big adverse move or an overnight gap is a big, real loss, and margin calls can force you out at the worst time. Most retail derivatives traders lose money. Learn first, paper-trade, size tiny, and treat not blowing up as the goal. All numbers are illustrative examples.
Why futures suit a programmer
A future has a linear, 1:1 payoff — no option Greeks, no volatility surface, no premium decay. That makes the maths refreshingly simple: your P&L is just (exit − entry) × lot size, settled in cash. For automation, that simplicity is a gift. The complexity that does exist is mechanical and very learnable: cost-of-carry pricing (why a future sits a little above or below spot), margin and daily mark-to-market (why a losing position bleeds cash in real time), and rollover (why holding a future past expiry quietly costs or pays you, depending on the term structure). Get those three right and futures are a clean, powerful instrument to build systematic strategies on — across NSE index/stock futures and MCX commodities.
We ground everything in real numbers you can reproduce: a Nifty one-month future’s fair value of 24,138 (basis +138) from the cost of carry; ~8.3× leverage on a ₹18-lakh contract against ~₹2.16-lakh margin; a ₹15,000 daily mark-to-market credit on a 200-point move; and a ~7.6%/year “contango bleed” on a rolled long. Then we build up strategies, hedging, risk and a simple algo.
What this course covers
| # | Lesson | What you will learn |
|---|---|---|
| 1 | Why Futures (for Coders) | Leverage, hedging, speculation; the mindset |
| 2 | Futures Basics | Long/short, contract specs, the linear payoff |
| 3 | Pricing & Basis | Cost of carry, basis, contango vs backwardation |
| 4 | The Commodity Universe | NSE index/stock futures + MCX bullion/energy/metals |
| 5 | Margin, MTM & Leverage | SPAN margin, daily mark-to-market, ~8× leverage |
| 6 | Rollover & Term Structure | Rolling, roll yield, the contango bleed |
| 7 | Directional Strategies | Trend following, breakout, mean reversion |
| 8 | Spreads & Arbitrage | Calendar, inter-commodity (crack), cash-and-carry |
| 9 | Hedging | Jeweller, airline, farmer; hedger vs speculator |
| 10 | Risk & Position Sizing | Leverage, gaps, limit up/down, margin calls |
| 11 | Data & Tooling Stack | Continuous contracts, broker APIs, backtesting |
| 12 | Build a Futures Algo | Signal → risk → order → MTM → roll, end to end |
It is written in plain Indian English with a working engineer in mind, grounded in real cost-of-carry and margin numbers, and every lesson ends with the pitfalls and a quick recap. After reading it you should understand futures and commodities properly — basics and a fair bit of the advanced — and be able to build small, safe systematic tools around them.
Start with Lesson 1: Why Futures (for Coders).
For related material, see the Options Trading for Programmers course, the Low-Latency Trading Systems course, the algo trading vocabulary, and the strategy articles on moving-average crossover, mean reversion and momentum/trend-following.
