Skip to main content

Module research

Module research 

Source
Expand description

Research universe and shared helpers for the backtesters.

Structs§

Market
Market context from SPY, joined by date.
Rng
Small, fast, seedable PRNG (SplitMix64) with Gaussian draws.
Sample
One (symbol, bar) observation.
Scorecard
Directional scorecard for a set of (signed call strength, realized return).
Series
A loaded symbol: name plus dated bars.

Enums§

Split
Which slice of history a sample belongs to.

Constants§

BARRIER_ATR
Triple-barrier settings: which of ±BARRIER_ATR·ATR is touched first within BARRIER_BARS bars. This is the cleanest form of the question “which way does the squeeze break?”.
BARRIER_BARS
HORIZONS
Forecast horizons in trading days: one week, two weeks, one month.
MAGNITUDE_BASELINE
How many leading MAGNITUDE_NAMES form the volatility-only baseline.
MAGNITUDE_NAMES
Names of the expected-movement inputs, in magnitude_inputs order.
MARKET_FEATURES
UNIVERSE
A deliberately mixed research universe: index and sector ETFs, mega caps, cyclicals, defensives, laggards and a few high-volatility names. It is not the investable portfolio; it exists so the indicator is judged on many kinds of price behaviour, including stocks that went nowhere.

Functions§

add_noise
Add Gaussian measurement noise to a price history.
auc
Area under the ROC curve: the chance a random “up” row scores higher than a random “down” row. 0.5 = no skill, regardless of base rate.
barrier_label
First-touch label. Uses the real future highs and lows.
build_samples
Build samples for one symbol. signal_bars is what the indicator sees (maybe noisy); truth is the real history used for outcomes.
load_universe
magnitude_inputs
Direction-free inputs for the expected-movement model.
pearson
scorecard
Grade calls. strength[i] > 0 is an up call, < 0 a down call, 0 no call. Only rows with |strength| >= threshold are graded.
spearman
Spearman rank correlation.
train_end
valid_end