Disciplined Traders Academy

The Trader’s Codebook

Build your own automated options trading system. For traders who want to code their own system — no prior coding experience required.

12 weeks · 1–2 hours a week · A laptop, a broker account, a Claude Max plan with a basic ChatGPT plan alongside, and the willingness to be wrong out loud.

Tap any week to expand. Each week follows the same shape: the idea, the outcome, the new vocabulary, the hands-on work, and the real-money story that anchors the rule of the week.

Week01

Why automate, and what "automated" really means

  • IdeaA bot follows your rules without flinching. You stay the head chef.
  • OutcomeYou can explain what an automated trading system does, in plain words.
  • Vocabbot, headless process, scheduler, log file, exit code
  • PracticeWrite three of your trading rules as precise if-then sentences.
One careless kill command stopped two strategies. Per-strategy name tags now mandatory.
Week02

Meet Claude, your coding partner who never sleeps

  • IdeaYou describe; Claude writes. You read the steps before they run.
  • OutcomeClaude Code installed; you have asked it for today's NIFTY price.
  • VocabClaude Code, prompt, terminal, model tier, context window
  • PracticeInstall Claude Code, ask it for the NIFTY price, read every step before saying yes.
Claude once wrote a confidently wrong table of expiries. Every number must be looked up, not guessed.
Week03

Markets, the way software sees them

  • IdeaSoftware is pedantic about IDs, timestamps, and which holiday file belongs to which exchange.
  • OutcomeYou know why this codebase always means trading-day DTE, and you can tell display symbol from instrument_id.
  • Vocabinstrument_id, JSON config file, primary key versus display name, dictionary lookup, canonical identifier
  • PracticeBuild a small table of your instruments with their canonical IDs.
"Is today a trading day?" is now line one — after a wrong holiday file put a strategy live on a closed exchange.
Week04

Setting up your toolkit

  • IdeaPros are not smarter; their desks are tidier. We tidy yours once.
  • OutcomeEditor, repository, and Claude Code working; a ten-line script prints NIFTY.
  • Vocabcode editor, repository, commit and revert, virtual environment, .env file
  • PracticeRun a script, make a small mistake on purpose, undo it.
"3" in one segment means "195" in another. The lots-versus-units trap that has cost traders the most.
Week05

Talking to your broker through code (from a fixed cloud address)

  • IdeaAn API is a polite way to ask your broker for things — but brokers only talk to whitelisted IPs, so we set up a small cloud server first.
  • OutcomeYou can fetch funds and positions from a cloud server whose IP your broker has whitelisted.
  • VocabAPI endpoint, OAuth flow, access token, cloud instance (AWS Lightsail), static IP
  • PracticeProvision Lightsail, attach a static IP, whitelist it with Upstox, then fetch your funds from the server.
A second broker had no quote API. Every later strategy was redesigned around that one missing feature.
Week06

Your first real strategy, coded from scratch

  • IdeaA strategy is a sentence. We turn it into a function.
  • OutcomeA function that takes today's market state and returns what it would sell.
  • Vocabfunction, parameters, return value, if-else branching, unit test
  • PracticeTranslate one of your Week-1 rules into a working function; run it on today and last Tuesday.
A "wait for breakdown" LIMIT order filled instantly at the current price. The fix is a different order type entirely.
Week07

Telegram: your bot's voice, wired before money moves

  • IdeaYour bot cannot tap your shoulder. Telegram is the tap — wire it before Week 9.
  • OutcomeFour message types working; you know what each looks like at three in the morning.
  • Vocabbot token, chat ID, severity levels (info / warn / error / critical), dedupe key, retry policy
  • PracticeBootstrap a Telegram bot; wire your Week-6 strategy to ping at entry, exit, and end-of-day.
Every routine adjustment used to buzz the phone. Operator muted the bot; a real emergency got muted too. Now routine events log silently.
Week08

Safety nets: hard limits in code

  • IdeaA strategy without coded limits is a confession that you do not believe your own rule.
  • OutcomeYour function also returns a stop-loss price and a position size based on a risk you choose.
  • Vocabatomicity, race condition, watchdog, fail-safe, idempotency
  • PracticeSet a fifty-percent SL; print entry and SL side by side for the next three trades; decide if you can sleep.
SL filled milliseconds before our cancel reached the exchange; emergency exit fired anyway; we bought twice what we sold.
Week09

Going live with one lot

  • IdeaOne lot live is the cheapest tuition you will ever pay.
  • OutcomeOne real order placed, watched, and squared off cleanly. You watched it on the broker terminal.
  • Vocablive mode flag, simulator, smoke test, dry run, structured logging
  • PracticeRun one lot, one tranche, one day; screenshot the broker terminal the moment it fires.
Cancel-and-replace once turned into both orders filling, because nobody asked the broker whether the cancel went through.
Week10

From script to system

  • IdeaThe difference between "it worked today" and "it will run for a year while I sleep."
  • OutcomeYour strategy on the cloud server restarts itself, refreshes its broker token before market open, audits itself before going live, and writes its diary.
  • Vocabcron schedule, daily token refresh, pre-live audit, log rotation, background daemon
  • PracticeSet up the daily reminders; run the pre-live audit and address every finding; verify the strategy comes back after a reboot.
Three independent bugs hit a brand-new strategy in the first sixty seconds of live trading, while ninety-nine unit tests sat happy and green.
Week11

Backtesting your now-running strategy

  • IdeaYou are already live at one lot. Backtesting answers: would it have made money on the days you have not traded yet?
  • OutcomeAn honest ninety-day simulation against your live-tested rule, with no peeking and no zero-cost fills.
  • Vocabhistorical data feed, simulation harness, look-ahead bias, event-driven loop, time-series alignment
  • PracticeFetch ninety days, run the strategy in strict time order, plot a simple curve.
A beautiful-on-paper strategy secretly used a future close to decide an entry. One line does it; one line prevents it.
Week12

Reading backtest results

  • IdeaNumbers do not lie; the summaries do. We read the honest signal.
  • OutcomeYou can spot overfitting, missing slippage, and out-of-sample collapse. You have your own scale-up rule.
  • Vocaboverfitting (formal sense), walk-forward analysis, in-sample versus out-of-sample, Monte Carlo simulation, statistical significance
  • PracticeRe-run Week 11 on a different ninety-day window the strategy has never seen; decide in writing whether to scale up.
A great-looking backtest collapsed live because historical fills assumed zero slippage and zero brokerage.
Ask Vishal