The SahastaDirectionality book
SahastaDirectionality (SD) is a squeeze indicator. It watches for stretches where a market goes unusually quiet and tries to say what happens when the quiet ends: how big the move will be and which way it will go.
This book is written so you can open the code and change it even if you have never studied quantitative finance. Every chapter tells a story about a problem, a fix, and the measurement that showed whether the fix was real. Every number in the book comes from a command you can rerun.
Pick a journey
Each journey is an ordered path. Read its steps in order; each one assumes only the steps before it. Times are computed from word counts at 200 words a minute.
-
I'm new here
What a squeeze is, how SD reads one, what the backtests found, and what SD v2 changed.
-
I'm working on SD itself
How the SD number is built, end to end and file by file: the squeeze clock, the feature engine, the frozen model, and what direction it can honestly call.
-
I'm working on the backtester
How sd_backtest and sd_options work inside: data, noise, features, samples, purged splits, models, scorecards, the options simulator, and adding an experiment.
-
I want to change the indicator
The squeeze clock, the v2 feature engine, how ideas are judged, and where the code lives.
-
I want to change a trading strategy
What SD v2 outputs, the Strategy trait, pricing, costs, and adding a strategy.
-
I want to rerun the evidence
Every experiment, its command, and how to read its output.
The one-paragraph summary
We backtested SD on 125 symbols over 25 years: trained before 2014, tuned on 2014–2018, and graded once on 2019–2026. SD cannot reliably call direction. Classic SD's calls hit 50.9% while "always up" hit 56.9%, and no combination of squeeze and momentum features we tried did better than a coin flip once market drift is removed. SD can call size. SD v2's distance from 0.5 now tracks the size of the coming month's move (rank correlation +0.171, against +0.003 for classic SD), and it degrades gently under heavy Gaussian noise (+0.128 at one full day's volatility of noise on every print). So the recommended options strategy trades size, not direction: buy a one-month straddle when price is coiled and SD's expected move beats the implied move by 30%. Chapter 5 has the numbers and the caveats.
Looking for the code? The API reference is generated from the Rust crate's doc comments on every build.