Nilay Toshniwal Contact
Project Aug 2025 to Dec 2025

NSE backtesting and volatility research

4real defects the adversarial audit found in my own backtester

Why

A strategy that looks profitable before costs is not a strategy. Indian markets have a long list of charges, and most backtests ignore them. I also wanted to know when equity and currency risk stack up together instead of cancelling out.

For engineers

How

I built a backtester for four systematic strategies across a basket of NSE stocks, with every real cost modelled, and wrote down five pass or fail thresholds before running anything. Then I audited the engine adversarially, looking for the ways it could flatter a result. Separately I modelled how volatility travels between the equity and currency markets, to find the periods where the two risks amplify each other.

What came out

Four defects in the engine, found before any result was trusted, and a map of the regimes where equity and currency risk move together.

What broke

The worst defect: stop-losses were filling at the open of the bar instead of at the stop price, which quietly made every losing trade look smaller than it was. Three more like it. The audit was the most useful part of the project.

Mind the gap

The code lived on a machine I no longer have access to. The method and the results are on my CV; the repository is not recoverable.

CV · one general versionDownload