Skip to main content

Module model

Module model 

Source
Expand description

§Model: how much is each measurement worth?

Classic SD hard-coded its opinions: Group A + is worth 1.0, (+) is worth 0.75, every * adds 0.05. Those numbers were sensible guesses, but nobody had checked them against what prices actually did next.

SD v2 keeps the structure (the features in features.rs are all squeeze and momentum ideas from the paper) but lets history set the weights. Two tiny, transparent models do this:

  • Logistic: “given these measurements, what is the chance the next h bars close higher?” Its output is the SD number, in [0, 1].
  • Ridge: “how big will the move be, in units of normal daily noise?” This is the expected movement that SD’s conviction is scaled by.

Both are linear, so every weight can be printed, read, argued with and copied into ThinkScript. Both use an L2 (“ridge”) penalty, which pulls weights toward zero unless the data insists, the cheapest defence there is against fitting noise.

Structs§

Logistic
Logistic regression p = σ(b₀ + w·z) on standardized inputs z.
Ridge
Ridge regression y = b₀ + w·z.
Scaler
Per-column mean and standard deviation, so weights are comparable.

Functions§

sigmoid