Portrait of Vansh Dhawan

Vansh Dhawan

Quant. I teach the mathematics and code behind quantitative finance.

Abstract

I'm Vansh Dhawan, @quant.dhawan on Instagram. When I started in quantitative finance, I tuned indicator lookbacks until the Sharpe ratio on the whole dataset looked perfect. Failed paper trading accounts and a lot of reading showed me what I had actually done: overfitted. I learn by seeing, so that is how I teach: every idea starts as an equation and ends as an animation, and then I push the model until it breaks, because the failure is usually the lesson. The code behind the animations is on GitHub, in quant-dhawan-lab. I founded Thuztra: thuztra.com tests a strategy against costs, estimated tax and plain luck, and learn.thuztra.com teaches the mathematics underneath from the beginning. I'm currently studying for an MSc in Financial Engineering. §1 says the rest in three ways: a picture, a program and a riddle.

1How I think

1.1A picture

I talk about three things: AI, entrepreneurship and quantitative finance. They climb to one peak, which is where I work. The trench around it is overfitting, where a result lands once it has been tuned to the same data it is tested on. Getting across it honestly is the whole job.

z= (2r2) er2/2 , r2=x2+y2
AIEntrepreneurshipQuantitative financemeoverfitting
Figure 1. The surface above, which is minus the Laplacian of a bell curve and is known as the Mexican hat. AI, entrepreneurship and quantitative finance sit around the rim and climb to one peak. The shaded trench, where the surface dips below zero, is overfitting.

1.2A program

Run this in a terminal or any IDE. It is Python 3.6 or later with nothing to install, and all it does is print random letters. Look at the second line. Download it as whoami.py.

whoami.py

# whoami.py, from vanshdhawan.com
# Python 3.6 or later, nothing to install: python3 whoami.py
import random
import string

letters = string.ascii_lowercase


def noise(seed, n):
    """n random lowercase letters. Each seed gives its own."""
    rng = random.Random(seed)
    return "".join(rng.choice(letters) for _ in range(n))


print(noise(1, 5), noise(2, 6))  # noise
print(noise(23_012_116, 5), noise(78_700_836, 6))  # also noise

tries = 23_012_116 + 78_700_836 + 2  # each search from 0
print()
print("Noise doesn't know my name.")
print(f"I tried {tries:,} seeds until it did.")
print()
print("Search long enough and noise says whatever you want.")
print("Tune enough lookbacks and a backtest does too:")
print("same mistake, something called overfitting.")
print("When a result looks perfect,")
print("ask how many tries it took.")
What it prints
$ python3 whoami.py
eszyc bcclfx
vansh dhawan

Noise doesn't know my name.
I tried 101,712,954 seeds until it did.

Search long enough and noise says whatever you want.
Tune enough lookbacks and a backtest does too:
same mistake, something called overfitting.
When a result looks perfect,
ask how many tries it took.

1.3A riddle

Seven classic quant interview puzzles. None of them needs more than school maths, only the right way of looking at it. Solve each one, turn its answer into a letter (1 is A, 2 is B, and so on up to 26 for Z), and read the letters in order. They spell what I built after learning §1.2 the hard way.

  1. a1The number of paths through a six-step binomial tree that end at the level they started from.
  2. a2The expected number of fair coin flips until the pattern HHT first appears.
  3. a3The number of ways to climb 7 stairs taking one or two at a time (one then two, and two then one, count as different).
  4. a4The number of zeros at the end of 110! (110 factorial).
  5. a5The expected number of fair coin flips until HTHT first appears.
  6. a6The expected number of fair coin flips until HTTH first appears.
  7. a7The expected number of cards that end up exactly where they started when a 52-card deck is shuffled perfectly at random.
Answer

(a1,,a7)=(20,8,21,26,20,18,1), which spells THUZTRA, the business I founded (§2).

  1. a1Pick which 3 of the 6 steps go up: (63)=20.
  2. a2Add 2k for every k where the pattern's first k flips equal its last k. HHT only matches itself whole: 23=8.
  3. a3You reach a stair from one or two below it, so the counts go 1, 2, 3, 5, 8, 13, 21. Fibonacci, hiding in a staircase.
  4. a4Every zero at the end needs a factor of 5, and twos are plentiful. 22 numbers up to 110 are multiples of 5, and 4 of them (25, 50, 75, 100) give a second 5: 22 + 4 = 26.
  5. a5The same rule as a2. HTHT matches itself at k = 2 and 4: 4 + 16 = 20.
  6. a6HTTH matches itself at k = 1 and 4: 2 + 16 = 18.
  7. a7Each card stays put with probability 1/52, and expectations add even when the events depend on each other: 52 × 1/52 = 1. The deck size never mattered.

2Thuztra

I founded Thuztra, and it has two parts.

thuztra.com is a no-code backtester for strategies on NSE stocks and ETFs. It reports a result after costs and estimated tax, then runs a luck test: a block-bootstrap Monte Carlo test that asks whether the same result could have come from chance alone. The aim is to show where a backtest flatters a strategy, not to sugar-coat the result.

learn.thuztra.com is Thuztra Learn. It teaches the mathematics, statistics and programming that quantitative finance is built on, from the beginning, to people who are teaching themselves.

3Profiles

There are a lot of people called Vansh Dhawan. The profiles below are the ones that are me.

  1. Instagram, @quant.dhawan. instagram.com/quant.dhawan
  2. GitHub, quant-dhawan. github.com/quant-dhawan
  3. LinkedIn, vansh-dhawan7. linkedin.com/in/vansh-dhawan7
  4. X, @Vanshdhawan07. x.com/Vanshdhawan07
  5. Thuztra (my business).1 thuztra.com
  6. Thuztra Learn (my business).1 learn.thuztra.com