Hey. I'm TJT-Pro. A medic, short-term trader, self-taught developer, and somewhere along the way, a math enthusiast who couldn't leave it alone.
Medicine teaches you not to trust a symptom until you understand the mechanism underneath it. I got fascinated with patterns a few years ago, watching markets move and noticing they weren't random so much as structured, if you looked at the right timescale. That fascination turned into my own recursive time framework for tracking where big money is probably already moving before price confirms it. Somewhere in building that out, the trader in me turned into someone who wanted to understand markets as a mathematical object, not just a chart.
This repository is what that curiosity became, and it's my give-back for it: derive the mathematics myself, implement it from the definition, verify it against NumPy/SciPy/statsmodels so I can't fool myself, then run it against one real dataset -- daily EUR/USD exchange rates from the Federal Reserve, 1999-01-04 to 2026-08-21 -- and see what actually survives contact with real data.
No NumPy or SciPy inside any implementation here. They appear only as the check that the from-scratch version is right.
2,247 tests. 30 projects. One dataset.
Together, these 30 projects make up Quant From First Principles -- derive it, implement it, verify it, apply it to real data. All 30 live in the one repository of that name, organized into nine phases.
Yours: TJT_Pro on TradingView
Everything lives in quant-from-first-principles. Phases 1 through 5 are the foundational curriculum, 14 projects -- discrete math and probability, statistics and inference, decision theory and risk, calculus, linear algebra and optimization. 913 tests.
Phases 6 through 9: sixteen more advanced projects built on that foundation. Each folder is a complete project with its own README, tests, and verification command. 1,334 tests.
Stochastic calculus & derivatives (phase 6)
- stochastic-processes -- random walks, Markov chains, Poisson processes, Brownian motion, martingales, first-passage times
- stochastic-differential-equations -- Euler-Maruyama, Milstein scheme, Ito's lemma
- black-scholes -- closed-form pricing, Greeks, implied volatility, binomial trees, Monte Carlo pricing
Numerical & computational methods (phase 7)
- automatic-differentiation -- dual numbers, forward mode, reverse-mode autodiff, backpropagation
- ode-engine -- Euler methods, RK4, adaptive step-doubling
- fourier-analysis -- DFT, Cooley-Tukey FFT, convolution, periodograms
- numerical-pde -- finite differences, von Neumann stability, the Black-Scholes PDE
- quasi-monte-carlo -- van der Corput and Halton sequences, discrepancy measures
Inference & learning from data (phase 8)
- time-series-mathematics -- ACF/PACF, AR/MA/ARMA, Yule-Walker, ADF stationarity testing
- bayesian-inference -- conjugate priors, grid approximation, Metropolis-Hastings MCMC
- hidden-markov-models -- forward-backward algorithm, Viterbi, Baum-Welch
- information-theory -- entropy, KL divergence, mutual information, Huffman coding
- svd-from-scratch -- singular value decomposition, pseudoinverse, condition numbers
Quant finance engineering (phase 9)
- convex-optimization -- Newton's method, projected gradient descent, KKT/duality
- portfolio-mathematics -- Markowitz frontier, CAPM, Kelly criterion
- model-risk -- VaR backtesting, AIC/BIC, backtest overfitting demonstration (the capstone)
Most quantitative code hides its mathematics behind a library call. That's the right call in production. It's the wrong call if the goal is to understand what the library is actually computing. The goal was never to replace NumPy or SciPy -- it was to earn the right to use them.
ENJOY! (●'◡'●)