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.

Final rules for building your first mechanical strategy