Rule-based investing and trading, tested honestly, automated safely.
Algo simply means rules, followed every time. Rules keep you consistent; automation keeps emotion out of
the decision. Here I share backtests, lessons and real-life experience from my own fully automated setup, including
what didn't work. New to algo? Start here. Want to explore investing and trading
strategies? See the strategies.
Sharpe ratios and return-to-drawdown ratios don't change with position size. On a strategy that makes a few points a trade, they can look excellent while the profit in rupees is too small to cover the real costs of trading.
Leaving out the 'event days' after you have seen which days hurt makes any backtest look safer. A fair blocklist uses only dates that were announced in advance, and even then it can get lucky.
Holding the NIFTY 50 only while its 20-day EMA was above its 50-day EMA, and keeping the money in a liquid fund the rest of the time (assumed to earn 6% a year), made 9.9% a year over 18½ years against 7.7% for buying and holding the index, with a worst fall of −25% instead of −60%. The smaller drawdown held from every start date, with returns comparable to buy and hold.
Selling far out-of-the-money NIFTY weekly options four sessions before expiry won 83% of its trades over five years. But the average loss was nearly four times the average win, one weekend gap in April 2025 cost about 40% of the five-year profit, and after costs it earned about 4% a year on capital.
Selling the NIFTY at-the-money straddle at 9:20 am on every weekly expiry, with a 30% stop on the pair, made a small profit over five years after costs, about 6.6% a year on capital. But it lost on six trades in ten, the result is not distinguishable from luck, and 2022 and 2023 made almost nothing.
Selling a ₹30 SENSEX call and put the day before expiry and holding them overnight won 90% of 156 trades over three years, comfortably beyond luck, and survived double costs. But losses are uncapped and there is no stop: a 5% gap on a calm week would cost about 1.7 years of average profit, and the sample never contained one.