Why go mechanical

Discretionary trading: you look at the market, form a view, place a trade based on judgment.

Mechanical trading: fixed rules define entries, exits, sizing.

Most professional trading is mechanical. Even “discretionary” traders often use mechanical filters.

The five components of any mechanical strategy

  1. Entry conditions — exactly what triggers a trade
  2. Position sizing — how many contracts
  3. Stop-loss rule — when to cut a loser
  4. Take-profit rule — when to close a winner
  5. Time exit rule — when to close if no other rule fires

If any is vague, you’ll waffle in the moment. If all are specific, execution becomes mechanical.

Example: a mechanical iron condor strategy

Example

Nifty weekly iron condor — mechanical rules

Entry conditions (all must be true, checked every Monday at 10 AM):

  • India VIX between 12 and 18
  • Nifty weekly ADX below 25 (range-bound)
  • No FOMC/CPI/RBI scheduled Mon-Thu
  • No monthly options expiry in same week

Trade construction:

  • Short call strike: nearest strike at or above Nifty spot × 1.015
  • Long call strike: short call strike + 200
  • Short put strike: nearest strike at or below Nifty spot × 0.985
  • Long put strike: short put strike − 200
  • Size: 1 lot per ₹2,00,000 account value

Stop-loss:

  • Close entire position if loss reaches 200% of premium collected

Take-profit:

  • Close entire position at 50% of max profit

Time exit:

  • Close at 2 PM on Tuesday (expiry day for Nifty weekly) regardless of P&L

Skip rules:

  • Skip if premium collected is less than 25% of max loss
  • Skip if account is in drawdown > 10% from peak

Every one of these is precise. There’s no “if I feel the market is…” — either the rule triggers or it doesn’t.

The development process

Step 1: Hypothesis

Write down what you think works. “Selling weekly iron condors on quiet Nifty weeks generates positive returns.”

Step 2: Formalize as rules

Convert the hypothesis into precise entry/exit/sizing rules as above.

Step 3: Backtest

Test the rules against historical data. Look at:

Step 4: Reality check

Step 5: Walk-forward test

Split your data:

Step 6: Paper trade

Run the strategy live but without real money for 1-3 months. Check:

Step 7: Live trading with minimum size

Start with the smallest possible position. Scale up over months as the strategy proves itself.

Backtesting infrastructure

Options for Indian retail:

Free / low-cost:

Coding required:

Professional:

For most retail, start with Streak or Sensibull to validate the concept, then upgrade to Python if you get serious.

Common backtesting pitfalls

1. Survivorship bias: using only stocks that still exist. Fixed by using historical constituent lists.

2. Lookahead bias: using data that wouldn’t have been available at trade time. Common with EOD data used as intraday signals.

3. Overfitting: tuning parameters until backtest looks great. Almost always fails live.

4. Ignoring transaction costs: brokerage + GST + STT + slippage = ~₹50-200 per trade round-trip. Small strategies get eaten alive.

5. Ignoring liquidity: strategy trades illiquid strikes; real fills are far worse than backtest.

6. Sample size too small: 20 trades of data is nothing. Aim for 100+ trades before believing anything.

⚠️ The uncomfortable truth about backtests

Most backtested “winning” strategies fail in live trading. Overfitting, transaction cost underestimation, and regime changes destroy them. A profitable backtest is necessary but not sufficient — walk-forward and paper testing are non-negotiable before real capital.

Automated execution

Once your strategy is rules-based, consider automating:

Streak (by Zerodha): point-and-click strategy builder + auto-execution. Free with Zerodha account.

Algo trading via API: Zerodha Kite Connect, Angel SmartAPI. Requires Python coding. Approved by SEBI for retail with disclosure.

Semi-automation: get alerts when rules trigger; place trades manually. Best of both worlds if you want speed + control.

Should you automate?

Yes if:

No if:

Iterating over time

A mechanical strategy is not “set and forget forever.” Review quarterly:

Update rules ONLY based on:

Do NOT update rules based on:

The compound benefit

Mechanical trading isn’t about a single perfect strategy. It’s about building a personal library:

Each strategy compounds your knowledge and diversifies your income streams. The best professional traders often have 5-10 mechanical strategies running simultaneously, each contributing modestly.

Published mechanical systems worth studying

Advanced Historical mechanical option systems (US and Indian)

1. Ken Long’s “SPX 0DTE Iron Condor”

Rules:

  • Enter 0-DTE iron condor at 10:30 AM ET
  • Short strikes at 15-delta
  • Wing width 20 points
  • Take profit at 50% of max
  • Stop-loss at 200% of premium

Long-run backtests: ~55% win rate, positive expectancy over 2015-2022. Fails in trending markets.

Indian adaptation: apply to Nifty weekly (Tuesday morning entry, Tuesday afternoon exit)

2. Karsten’s “Wheel Strategy” (systematic version)

Rules:

  • Sell 30-45 DTE cash-secured put at 30-delta on chosen stock
  • If assigned: sell 30-45 DTE covered call at 30-delta
  • Continue until called away, back to selling puts

Long-run US backtest (2000-2022): outperformed buy-and-hold on tested tickers by 2-4% annualized with lower drawdown.

Indian adaptation: limited by physical delivery mechanics. Best on liquid single-stock options (Reliance, TCS, HDFC).

3. A widely-referenced “Weekly Options Strategist” system

  • Uses “expected move” (implied straddle price) as sizing metric
  • Sells premium at 1σ or wider strikes
  • Systematic profit/loss levels
  • Adjustments based on delta breaches

Long-run: mixed results — works in high IV regimes, struggles in low IV.

4. TastyTrade “1 SD Strangle”

  • Sell 45-DTE strangles at 16-delta each side (~1σ)
  • Manage at 50% profit
  • Roll if tested

Backtested performance (2010-2020 on SPY): ~68% win rate; ~11% CAGR with 2% risk per trade.

Indian: works on Nifty monthlies. Watch out for gap risk.

5. Kirk Du Plessis’s “Small Account Iron Condor”

Rules for accounts < $5,000 (or ₹4L):

  • Only trade iron condors on high-volume indexes
  • Position sizing: 3-5% per trade
  • 30-45 DTE
  • Trade the biggest liquid contract to keep fees %-wise low
  • Manage at 50% profit, stop at 200%

Indian: perfectly adapts to Nifty weekly for accounts ₹4-10L.

Walk-forward optimization in detail

Advanced Proper out-of-sample testing

The problem with in-sample only

Optimizing parameters on the same data you evaluate on = curve-fitting. Your strategy looks great in-sample and fails live.

The walk-forward method

  1. Split data: 60% training, 20% validation, 20% out-of-sample

  2. Optimize on training data — find best parameters

  3. Validate on validation set — do parameters still work?

  4. Final test on out-of-sample — never touched during optimization

  5. Deploy only if OOS performance ≥ 60% of in-sample

Rolling walk-forward

More rigorous: sliding window optimization

  • Window 1: optimize on 2020-2022, test on 2023 Jan-Mar
  • Window 2: optimize on 2020-Q1 2023, test on 2023 Apr-Jun
  • Window 3: optimize on 2020-Q2 2023, test on 2023 Jul-Sep
  • …

If OOS results across windows are consistent, strategy is robust.

Parameter stability check

Plot parameter values that optimize each window:

  • Stable across windows = real edge
  • Wildly varying = you’re fitting noise

The 50% haircut rule

Whatever your backtest returns, expect 50% in reality:

  • 20% CAGR backtest → expect ~10% live
  • 60% max drawdown → expect ~30% (or worse)

Sources of gap:

  • Slippage under-modeled
  • Market regime shifts
  • Broker fees higher than assumed
  • Emotional deviations from rules

The 100-trade rule

Before believing any backtest:

  • Minimum 100 trades in the sample
  • Ideally 500+ across multiple market regimes
  • Include at least one crash / one rally / one range period

Executable specification

Advanced Turning a strategy into code-ready pseudocode

Every good mechanical strategy fits on one page as pseudocode. Example:

STRATEGY: Nifty Weekly Iron Condor (v2.3)

CAPITAL: ₹5,00,000
RISK PER TRADE: 2% (₹10,000)

MARKET SCAN (Monday 10:00 AM):
  vix = get_india_vix()
  adx = get_nifty_adx(14)
  events_this_week = fetch_econ_calendar(days=5)

FILTERS:
  IF vix < 12 or vix > 22: SKIP  # extreme regimes
  IF adx > 30: SKIP  # trending market
  IF any_high_impact_event(events_this_week): SKIP

ENTRY (10:15 AM Monday):
  spot = get_nifty_spot()
  short_call = ceil((spot * 1.015) / 50) * 50
  long_call = short_call + 200
  short_put = floor((spot * 0.985) / 50) * 50
  long_put = short_put - 200
  
  premium = get_condor_premium(short_call, long_call, short_put, long_put)
  IF premium < 25 (per share): SKIP  # not enough premium
  
  max_loss = 200 - premium
  contracts = floor(10000 / (max_loss * 65))
  IF contracts < 1: SKIP
  
  PLACE_ORDER(condor, contracts)

MONITORING (every 15 min):
  current_pl = get_position_pl()
  IF current_pl >= 0.5 * (premium * 65 * contracts): CLOSE  # 50% profit
  IF current_pl <= -1.0 * (premium * 65 * contracts): CLOSE  # 200% loss
  
TIME EXIT (Tuesday 2:00 PM):
  IF still_open: CLOSE

POST-TRADE:
  log_trade_result()
  IF weekly_drawdown > 6%: PAUSE_NEXT_WEEK

This is trade-able as-is. Every rule is unambiguous.

Regime-aware strategies

Advanced Why one strategy can't work in all markets

The four market regimes

  1. Low vol, ranging — best for short strangle / iron condor
  2. Low vol, trending — best for directional spreads (bull/bear call spread)
  3. High vol, ranging — best for iron condor with wider wings + roll
  4. High vol, trending — best for backspreads / long options

Regime identification metrics

  • India VIX absolute level: under 14 low; 14-20 medium; above 20 high
  • ADX(14): under 20 ranging; above 25 trending
  • Realized vol / Implied vol ratio: above 1 IV cheap, below 1 IV expensive
  • VIX % change 5-day: above 20% = regime change happening

Regime switching strategy

Instead of one strategy always-on:

  1. Every Monday, classify regime
  2. Deploy the appropriate strategy for that regime
  3. Close previous strategy if regime changed

Backtest result (typical for US markets): regime-switching adds ~2-4% annualized vs. single strategy.

Implementation complexity

Simple: 2 regimes (high vol, low vol) with 2 strategies.

Intermediate: 4 regimes with 4 strategies.

Advanced: continuous regime detection with position sizing based on regime confidence.

Start simple; add complexity only after mastery.

Final rules for building your first mechanical strategy