SD book

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.

  1. I'm new here

    What a squeeze is, how SD reads one, what the backtests found, and what SD v2 changed.

    1. 1. Squeezes from zero 6m
    2. 2. What v1 got wrong 5m
    3. 3. SD v2 5m
    4. 8. Direction: how far can SD honestly go? 1m
    5. Glossary 4m

    5 steps · about 21 min

  2. 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.

    1. 1. Squeezes from zero 6m
    2. 3. SD v2 5m
    3. 10. One bar through SD, end to end 6m
    4. 8. Direction: how far can SD honestly go? 1m
    5. 7. Working here 3m

    5 steps · about 21 min

  3. 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.

    1. 4. The steady backtester 6m
    2. 9. Inside the backtester 9m
    3. 8. Direction: how far can SD honestly go? 1m
    4. 5. Options strategies 6m
    5. 7. Working here 3m

    5 steps · about 25 min

  4. I want to change the indicator

    The squeeze clock, the v2 feature engine, how ideas are judged, and where the code lives.

    1. 1. Squeezes from zero 6m
    2. 3. SD v2 5m
    3. 4. The steady backtester 6m
    4. 7. Working here 3m

    4 steps · about 20 min

  5. I want to change a trading strategy

    What SD v2 outputs, the Strategy trait, pricing, costs, and adding a strategy.

    1. 3. SD v2 5m
    2. 5. Options strategies 6m
    3. 7. Working here 3m

    3 steps · about 14 min

  6. I want to rerun the evidence

    Every experiment, its command, and how to read its output.

    1. 4. The steady backtester 6m
    2. 8. Direction: how far can SD honestly go? 1m
    3. 5. Options strategies 6m
    4. 7. Working here 3m

    4 steps · about 16 min

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.