Skip to content
TE

Showing the latest week, Friday 18 September 2026.

Reference

As of Fri 18 Sep 2026 · W38 · latest weekSynthetic data, sample interface

Mathematics

Every model the terminal computes, in equations: the estimators, filters and tests behind each figure, their parameters as the engine uses them, where each appears, and the literature it comes from. Methodology says what each figure means; this page says exactly how it is computed.

19 sections68 models149 equations59 measures · 20 flag rules · 8 monitoring rules
NOTN

Notation and conventions

Symbols used throughout, and the conventions every model shares: the time index, returns, annualisation, point-in-time evaluation and missing data.

Prices and returns

Bars are indexed by trading session t. Log returns are used for volatility, regression and statistical models; simple returns for holding-period outcomes and relative performance.

Pt, Ot, Ht, Lt, Vt    close, open, high, low, volume;Bt    benchmark closeP_t,\ O_t,\ H_t,\ L_t,\ V_t \;\;\text{close, open, high, low, volume};\qquad B_t \;\;\text{benchmark close}
rt=ln⁡PtPt−1,Rt,h=PtPt−h−1,Rt,hrel=Rt,h−Rt,hBr_t = \ln\frac{P_t}{P_{t-1}}, \qquad R_{t,h} = \frac{P_t}{P_{t-h}} - 1, \qquad R^{\text{rel}}_{t,h} = R_{t,h} - R^{B}_{t,h}
(1.1)
σann=252 σdaily,μann=252 μdaily\sigma^{\text{ann}} = \sqrt{252}\,\sigma^{\text{daily}}, \qquad \mu^{\text{ann}} = 252\,\mu^{\text{daily}}
(1.2)

Returns, volatilities, drawdowns and distances are fractions; relative performance is a fractional difference shown in percentage points; RSI and ADX are on 0–100; percentiles and probabilities on 0–1.

Point-in-time evaluation

Every figure shown at an as-of session τ is a function of the information available at τ only. Rolling statistics are undefined until their full window exists; a shortened window is never substituted.

θ^τ=f({Ps,Os,Hs,Ls,Vs:s≤τ}),Fτ=σ(Xs:s≤τ)\hat\theta_\tau = f\big(\{P_s, O_s, H_s, L_s, V_s : s \le \tau\}\big), \qquad \mathcal{F}_\tau = \sigma\big(X_s : s\le\tau\big)
(1.3)
xt(n)={g(xt−n+1,…,xt)t≥n−1∅otherwisex^{(n)}_t = \begin{cases} g\big(x_{t-n+1},\dots,x_t\big) & t \ge n-1 \\ \varnothing & \text{otherwise}\end{cases}

Automated tests scramble every observation after τ and require every figure at τ to be unchanged.

Percentile ranks

A value's place in a reference set, with ties split, used for cross-sectional ranks within the coverage and for a reading against its own history.

p(x∣X)=#{v∈X:v<x}+12 #{v∈X:v=x}∣X∣∈[0,1]p(x \mid \mathcal{X}) = \frac{\#\{v\in\mathcal{X} : v < x\} + \tfrac12\,\#\{v\in\mathcal{X}: v = x\}}{|\mathcal{X}|} \in [0,1]
(1.4)
Gi=1∣M∣∑m∈Mp(±xi,m ∣ {±xj,m}j)G_{i} = \frac{1}{|M|}\sum_{m\in M} p\big(\pm x_{i,m} \,\big|\, \{\pm x_{j,m}\}_{j}\big)
(1.5)

Group percentiles (trend & momentum, relative strength, volatility & drawdown, volume & levels) average the member measures' cross-sectional percentiles; a member marked inverted enters with its sign reversed. They locate a company among the covered names; they are not scores.

DATA

Prices and corporate actions

Licensed prices are stored raw and adjusted once, by the terminal, for splits and cash dividends.

Back-adjustment for splits and dividends

Each ex-date contributes a factor; the adjusted price multiplies the raw price by every later factor, so the adjusted return on an ex-date is the total return to a holder and later corporate actions never change an earlier return.

fj=1sj(1−dj sjPj−1raw),Ft=∏j>tfj,P~t=Ft Ptrawf_j = \frac{1}{s_j}\left(1 - \frac{d_j\, s_j}{P^{\text{raw}}_{j-1}}\right), \qquad F_t = \prod_{j>t} f_j, \qquad \tilde P_t = F_t\, P^{\text{raw}}_t
(2.1)
V~t=Vtraw∏j>tsj,P~tP~t−1=stPtraw+dtstPt−1raw  (total return through t)\tilde V_t = V^{\text{raw}}_t \prod_{j>t} s_j, \qquad \frac{\tilde P_t}{\tilde P_{t-1}} = \frac{s_t P^{\text{raw}}_t + d_t s_t}{P^{\text{raw}}_{t-1}}\;\text{(total return through } t\text{)}
(2.2)
Δmax⁡=max⁡t∣P~tP~t−1−AtAt−1∣,“agrees” if Δmax⁡≤10−3\Delta_{\max} = \max_t\left|\frac{\tilde P_t}{\tilde P_{t-1}} - \frac{A_t}{A_{t-1}}\right|, \qquad \text{“agrees” if } \Delta_{\max} \le 10^{-3}
Parameters of Back-adjustment for splits and dividends
SymbolValueMeaning
sjs_jsplit factorshares after ÷ shares before on ex-date j
djd_jcash dividendper share, in pre-split units
AtA_tprovider adjusted closeused only as a check, never as data

Analyst price targets are restated on the same basis: a target T published at session t becomes F_t·T, so a later split does not move it against the adjusted closes.

TRND

Trend and momentum

Moving averages, oscillators and directional measures, with the original parameterisations (Wilder 1978 for RSI, ATR and ADX; Appel for MACD; Bollinger for bands).

Simple, exponential and Wilder averages

The exponential average is seeded with the simple mean of its first span, and Wilder smoothing is the exponential average with α = 1/n.

SMA⁡n(t)=1n∑i=0n−1Pt−i\SMA_n(t) = \frac{1}{n}\sum_{i=0}^{n-1} P_{t-i}
(3.1)
Et=α xt+(1−α) Et−1,En−1=1n∑i=0n−1xi,αEMA=2n+1,  αWilder=1nE_t = \alpha\,x_t + (1-\alpha)\,E_{t-1}, \qquad E_{n-1} = \frac1n\sum_{i=0}^{n-1}x_i, \qquad \alpha_{\text{EMA}} = \frac{2}{n+1},\ \ \alpha_{\text{Wilder}} = \frac1n
(3.2)

Trend classification and distance from averages

A company's trend is the ordering of its close and its 50- and 200-session averages.

Trendt={UptrendPt>SMA⁡50(t)>SMA⁡200(t)DowntrendPt<SMA⁡50(t)<SMA⁡200(t)Mixedotherwise\text{Trend}_t = \begin{cases}\text{Uptrend} & P_t > \SMA_{50}(t) > \SMA_{200}(t)\\ \text{Downtrend} & P_t < \SMA_{50}(t) < \SMA_{200}(t)\\ \text{Mixed} & \text{otherwise}\end{cases}
(3.3)
Dt200=PtSMA⁡200(t)−1D^{200}_t = \frac{P_t}{\SMA_{200}(t)} - 1
(3.4)

Momentum

Point-to-point returns over fixed horizons, and the 12–1 month momentum that skips the most recent month.

Momentum20t=100(PtPt−20−1),Mt12-1=Pt−21Pt−252−1\text{Momentum20}_t = 100\left(\frac{P_t}{P_{t-20}} - 1\right), \qquad M^{12\text{-}1}_t = \frac{P_{t-21}}{P_{t-252}} - 1
(3.5)
  • — Jegadeesh, N. & Titman, S. (1993). Returns to Buying Winners and Selling Losers. Journal of Finance, 48(1).

MACD

The difference of a fast and a slow exponential average of the close, its own signal line and the histogram between them.

MACDt=EMA⁡12(P)t−EMA⁡26(P)t,St=EMA⁡9(MACD)t,Ht=MACDt−St\text{MACD}_t = \EMA_{12}(P)_t - \EMA_{26}(P)_t, \qquad S_t = \EMA_{9}(\text{MACD})_t, \qquad H_t = \text{MACD}_t - S_t
(3.6)

Relative strength index (Wilder)

Wilder-smoothed average gains over average losses, seeded with the simple means of the first n changes.

Gt=(n−1) Gt−1+max⁡(ΔPt,0)n,Lt=(n−1) Lt−1+max⁡(−ΔPt,0)nG_t = \frac{(n-1)\,G_{t-1} + \max(\Delta P_t, 0)}{n}, \qquad L_t = \frac{(n-1)\,L_{t-1} + \max(-\Delta P_t, 0)}{n}
(3.7)
RSIt=100−1001+Gt/Lt(Lt=0: 100, or 50 when Gt=0)\text{RSI}_t = 100 - \frac{100}{1 + G_t/L_t} \quad (L_t = 0:\ 100,\ \text{or } 50 \text{ when } G_t = 0)
Parameters of Relative strength index (Wilder)
SymbolValueMeaning
nn14sessions
  • — Wilder, J. W. (1978). New Concepts in Technical Trading Systems.

Stochastic oscillator

Where the close sits in the recent high–low range, and its three-session average.

%Kt=100 Pt−min⁡14Lmax⁡14H−min⁡14L,%Dt=SMA⁡3(%K)t\%K_t = 100\,\frac{P_t - \min_{14} L}{\max_{14} H - \min_{14} L}, \qquad \%D_t = \SMA_3(\%K)_t
(3.8)

Directional movement, ATR and ADX

Directional movements and the true range, Wilder-summed, give the directional indicators; the average directional index is the Wilder average of their normalised gap.

TRt=max⁡(Ht−Lt, ∣Ht−Pt−1∣, ∣Lt−Pt−1∣),ATRt=Wilder14(TR)t\text{TR}_t = \max\big(H_t - L_t,\ |H_t - P_{t-1}|,\ |L_t - P_{t-1}|\big), \qquad \text{ATR}_t = \text{Wilder}_{14}(\text{TR})_t
(3.9)
ut=Ht−Ht−1,  dt=Lt−1−Lt,+DMt=ut 1[ut>dt, ut>0],−DMt=dt 1[dt>ut, dt>0]u_t = H_t - H_{t-1},\ \ d_t = L_{t-1} - L_t, \qquad +\text{DM}_t = u_t\,\mathbb{1}[u_t > d_t,\ u_t > 0], \quad -\text{DM}_t = d_t\,\mathbb{1}[d_t > u_t,\ d_t > 0]
StX=St−1X−St−1Xn+Xt,±DIt=100 St±DMStTR,DXt=100 ∣+DIt−−DIt∣+DIt+−DItS^{X}_t = S^{X}_{t-1} - \frac{S^{X}_{t-1}}{n} + X_t, \qquad \pm\text{DI}_t = 100\,\frac{S^{\pm\text{DM}}_t}{S^{\text{TR}}_t}, \qquad \text{DX}_t = 100\,\frac{|{+\text{DI}_t} - {-\text{DI}_t}|}{{+\text{DI}_t} + {-\text{DI}_t}}
ADXt=Wildern(DX)t\text{ADX}_t = \text{Wilder}_{n}(\text{DX})_t
(3.10)
Parameters of Directional movement, ATR and ADX
SymbolValueMeaning
nn14sessions
  • — Wilder, J. W. (1978). New Concepts in Technical Trading Systems.

Bollinger bands

A moving average with bands two population standard deviations away, the close's position within them, and their width.

mt=SMA⁡20(P)t,st=120∑i=019(Pt−i−mt)2,Ut,Lt=mt±2stm_t = \SMA_{20}(P)_t, \quad s_t = \sqrt{\tfrac{1}{20}\textstyle\sum_{i=0}^{19}(P_{t-i} - m_t)^2}, \quad U_t, L_t = m_t \pm 2 s_t
(3.11)
%Bt=Pt−LtUt−Lt,BWt=Ut−Ltmt\%B_t = \frac{P_t - L_t}{U_t - L_t}, \qquad \text{BW}_t = \frac{U_t - L_t}{m_t}

Trend regression

Ordinary least squares of the log close on time over the last 63 sessions: the slope, annualised, its t-statistic and the fit.

ln⁡Pt−k=a+b (−k)+ek,k=0,…,62;slopeann=252 b^,tb=b^se^(b^)\ln P_{t-k} = a + b\,(-k) + e_k, \quad k = 0,\dots,62; \qquad \text{slope}^{\text{ann}} = 252\,\hat b, \qquad t_b = \frac{\hat b}{\widehat{\text{se}}(\hat b)}
(3.12)

A close that did not change over the 63 sessions has no trend to test (t is 0/0): the slope, t-statistic and R² are shown as unavailable.

Donchian channels

The highest high and lowest low over a window.

DCt↑=max⁡0≤i<nHt−i,DCt↓=min⁡0≤i<nLt−i\text{DC}^{\uparrow}_t = \max_{0\le i<n} H_{t-i}, \qquad \text{DC}^{\downarrow}_t = \min_{0\le i<n} L_{t-i}
RS

Relative strength

Performance against the benchmark and the coverage: differences of returns, the log price ratio's level against its own history, and its change.

Relative performance by horizon

The company's return less the benchmark's over the same sessions, at each horizon, ranked within the coverage.

RSt(h)=Rt,h−Rt,hB,RS20t=Momentum20t−Momentum20tB  (pp)\text{RS}^{(h)}_t = R_{t,h} - R^{B}_{t,h}, \qquad \text{RS20}_t = \text{Momentum20}_t - \text{Momentum20}^{B}_t\ \ \text{(pp)}
(4.1)

Rotation map: relative-strength level and momentum

The log price ratio's z-score against its own trailing 126 sessions (level), and its change over ten sessions (momentum); weekly trails show the path.

ℓt=ln⁡PtBt,zt=ℓt−ℓˉt,126sd⁡126(ℓ)t,z˙t=zt−zt−10\ell_t = \ln\frac{P_t}{B_t}, \qquad z_t = \frac{\ell_t - \bar\ell_{t,126}}{\sd_{126}(\ell)_t}, \qquad \dot z_t = z_t - z_{t-10}
(4.2)
Parameters of Rotation map: relative-strength level and momentum
SymbolValueMeaning
126126sessionslevel window
1010sessionsmomentum lag
88weekstrail length
VOL

Volatility

Five realised estimators that use different parts of the daily bar, the RiskMetrics exponentially weighted estimator, GARCH(1,1) by maximum likelihood, and volatility cones. All annualised with √252.

Realised volatility estimators

Over a window of n sessions. Range estimators use the high and low; Rogers–Satchell allows drift; Yang–Zhang adds the overnight gap and is unbiased under both.

σ^CC2=1n−1∑t(rt−rˉ)2\hat\sigma^2_{\text{CC}} = \frac{1}{n-1}\sum_{t}(r_t - \bar r)^2
(5.1)
σ^P2=14nln⁡2∑tln⁡2 ⁣HtLt\hat\sigma^2_{\text{P}} = \frac{1}{4n\ln 2}\sum_t \ln^2\!\frac{H_t}{L_t}
(5.2)
σ^GK2=1n∑t[12ln⁡2 ⁣HtLt−(2ln⁡2−1)ln⁡2 ⁣PtOt]\hat\sigma^2_{\text{GK}} = \frac1n\sum_t\left[\tfrac12\ln^2\!\frac{H_t}{L_t} - (2\ln2 - 1)\ln^2\!\frac{P_t}{O_t}\right]
(5.3)
σ^RS2=1n∑t[ln⁡HtPtln⁡HtOt+ln⁡LtPtln⁡LtOt]\hat\sigma^2_{\text{RS}} = \frac1n\sum_t\left[\ln\frac{H_t}{P_t}\ln\frac{H_t}{O_t} + \ln\frac{L_t}{P_t}\ln\frac{L_t}{O_t}\right]
(5.4)
σ^YZ2=σ^o2+k σ^c2+(1−k) σ^RS2,k=0.341.34+n+1n−1,σ^o2=Var⁡ ⁣(ln⁡OtPt−1), σ^c2=Var⁡ ⁣(ln⁡PtOt)\hat\sigma^2_{\text{YZ}} = \hat\sigma^2_{o} + k\,\hat\sigma^2_{c} + (1-k)\,\hat\sigma^2_{\text{RS}}, \qquad k = \frac{0.34}{1.34 + \frac{n+1}{n-1}}, \quad \hat\sigma^2_o = \Var\!\left(\ln\tfrac{O_t}{P_{t-1}}\right),\ \hat\sigma^2_c = \Var\!\left(\ln\tfrac{P_t}{O_t}\right)
(5.5)
Parameters of Realised volatility estimators
SymbolValueMeaning
nn20sessions (screener and company page)
  • — Parkinson, M. (1980). Journal of Business, 53(1).
  • — Garman, M. B. & Klass, M. J. (1980). Journal of Business, 53(1).
  • — Rogers, L. C. G. & Satchell, S. E. (1991). Annals of Applied Probability, 1(4).
  • — Yang, D. & Zhang, Q. (2000). Journal of Business, 73(3).

Exponentially weighted volatility (RiskMetrics)

Element t is the forecast for the next session from returns through t.

σt+1∣t2=λ σt∣t−12+(1−λ) rt2,σ20∣192=120∑t<20rt2\sigma^2_{t+1\mid t} = \lambda\,\sigma^2_{t\mid t-1} + (1-\lambda)\,r_t^2, \qquad \sigma^2_{20\mid 19} = \frac{1}{20}\sum_{t<20} r_t^2
(5.6)
Parameters of Exponentially weighted volatility (RiskMetrics)
SymbolValueMeaning
λ\lambda0.94decay
  • — J.P. Morgan/Reuters (1996). RiskMetrics — Technical Document, 4th ed.

GARCH(1,1) by maximum likelihood with variance targeting

Conditional variance driven by the last shock and the last variance; the constant is tied to the sample variance so the long-run level is the sample's. Fitted on the latest 504 returns (at least 250) by Nelder–Mead over a reparameterisation that keeps α, β ≥ 0 and α + β < 1, from three starts.

rt=μ+εt,εt=ht zt, zt∼N(0,1),ht=ω+α εt−12+β ht−1r_t = \mu + \varepsilon_t,\quad \varepsilon_t = \sqrt{h_t}\,z_t,\ z_t\sim\mathcal N(0,1), \qquad h_t = \omega + \alpha\,\varepsilon^2_{t-1} + \beta\,h_{t-1}
(5.7)
σˉ2=1n∑tεt2,ω=σˉ2(1−α−β),h1=σˉ2\bar\sigma^2 = \frac1n\sum_t\varepsilon_t^2, \qquad \omega = \bar\sigma^2(1-\alpha-\beta), \qquad h_1 = \bar\sigma^2
L(α,β)=−12∑t=1n[ln⁡2π+ln⁡ht+εt2ht]\mathcal{L}(\alpha,\beta) = -\frac12\sum_{t=1}^{n}\left[\ln 2\pi + \ln h_t + \frac{\varepsilon_t^2}{h_t}\right]
(5.8)
p=0.9995 Λ(x1),α=p Λ(x2),β=p−α,Λ(x)=11+e−xp = 0.9995\,\Lambda(x_1), \quad \alpha = p\,\Lambda(x_2), \quad \beta = p - \alpha, \qquad \Lambda(x) = \frac{1}{1+e^{-x}}
E[hT+k]=σˉ2+p k−1(hT+1−σˉ2),σann(H)=252H∑k=1HE[hT+k],t1/2=ln⁡12ln⁡p\E\big[h_{T+k}\big] = \bar\sigma^2 + p^{\,k-1}\big(h_{T+1} - \bar\sigma^2\big), \qquad \sigma^{\text{ann}}(H) = \sqrt{\frac{252}{H}\sum_{k=1}^{H}\E[h_{T+k}]}, \qquad t_{1/2} = \frac{\ln\frac12}{\ln p}
(5.9)
Parameters of GARCH(1,1) by maximum likelihood with variance targeting
SymbolValueMeaning
nn504 (≥ 250)daily returns in the fit
p=α+βp = \alpha+\beta< 0.9995persistence

Symmetric in the sign of the shock (no leverage term); Gaussian innovations understate the tails; re-estimated at each as-of date.

  • — Bollerslev, T. (1986). Journal of Econometrics, 31(3).
  • — Engle, R. F. & Mezrich, J. (1996). GARCH for Groups. Risk, 9(8) — variance targeting.
  • — Nelder, J. A. & Mead, R. (1965). The Computer Journal, 7(4).

Volatility cone

For each horizon, the distribution of every overlapping close-to-close volatility in the history, and where the current one sits in it.

σ^h(t)=252 sd⁡(rt−h+1,…,rt),Qq(h)=quantileq{σ^h(t)}t,q∈{0.1,0.25,0.5,0.75,0.9}\hat\sigma_h(t) = \sqrt{252}\,\sd\big(r_{t-h+1},\dots,r_t\big), \qquad Q_q(h) = \text{quantile}_q\{\hat\sigma_h(t)\}_t, \quad q\in\{0.1, 0.25, 0.5, 0.75, 0.9\}
(5.10)
Parameters of Volatility cone
SymbolValueMeaning
hh10, 21, 42, 63, 126sessions
  • — Burghardt, G. & Lane, M. (1990). How to Tell if Options Are Cheap. Journal of Portfolio Management, 16(2).
RISK

Loss and drawdown

One-session loss measures reported as positive fractions, drawdowns and risk-adjusted ratios. The risk-free rate is taken as zero, and said so.

Value at risk and expected shortfall

Historical (interpolated sample quantile), Gaussian and Cornish–Fisher value at risk; historical and Gaussian expected shortfall, at confidence c (95% by default).

VaRchist=−[r(⌊h⌋+1)+(h−⌊h⌋)(r(⌊h⌋+2)−r(⌊h⌋+1))],h=(n−1)(1−c)\text{VaR}^{\text{hist}}_c = -\left[r_{(\lfloor h\rfloor+1)} + (h - \lfloor h\rfloor)\big(r_{(\lfloor h\rfloor+2)} - r_{(\lfloor h\rfloor+1)}\big)\right], \qquad h = (n-1)(1-c)
(6.1)
VaRcN=−(μ^+σ^z1−c),VaRcCF=−(μ^+σ^z~),z~=z+(z2−1)S6+(z3−3z)K24−(2z3−5z)S236\text{VaR}^{\mathcal N}_c = -(\hat\mu + \hat\sigma z_{1-c}), \qquad \text{VaR}^{\text{CF}}_c = -(\hat\mu + \hat\sigma \tilde z), \quad \tilde z = z + \frac{(z^2-1)S}{6} + \frac{(z^3-3z)K}{24} - \frac{(2z^3 - 5z)S^2}{36}
(6.2)
ESchist=−1m∑i=1mr(i),  m=⌈n(1−c)⌉,EScN=−μ^+σ^ φ(z1−c)1−c\text{ES}^{\text{hist}}_c = -\frac{1}{m}\sum_{i=1}^{m} r_{(i)},\ \ m = \lceil n(1-c)\rceil, \qquad \text{ES}^{\mathcal N}_c = -\hat\mu + \hat\sigma\,\frac{\varphi(z_{1-c})}{1-c}
(6.3)
Parameters of Value at risk and expected shortfall
SymbolValueMeaning
S,KS, Ksampleskewness and excess kurtosis
cc0.95, 0.99confidence
  • — Cornish, E. A. & Fisher, R. A. (1938). Revue de l'Institut International de Statistique, 5(4).
  • — Artzner, P., Delbaen, F., Eber, J.-M. & Heath, D. (1999). Coherent Measures of Risk. Mathematical Finance, 9(3).

Drawdowns and the Ulcer index

Distance below the running peak, its worst value, non-overlapping peak-to-recovery episodes, and the root-mean-square of percentage drawdowns.

DDt=Ptmax⁡s≤tPs−1,MDD=min⁡tDDt,DDt252=Ptmax⁡t−251≤s≤tPs−1\text{DD}_t = \frac{P_t}{\max_{s\le t} P_s} - 1, \qquad \text{MDD} = \min_t \text{DD}_t, \qquad \text{DD}^{252}_t = \frac{P_t}{\max_{t-251\le s\le t} P_s} - 1
(6.4)
UI=1n∑t(100 DDt)2\text{UI} = \sqrt{\frac1n\sum_t \big(100\,\text{DD}_t\big)^2}
(6.5)
  • — Martin, P. & McCann, B. (1989). The Investor's Guide to Fidelity Funds.

Downside deviation and risk-adjusted ratios

Annualised, with a zero risk-free rate.

σ−=252n∑tmin⁡(rt−τ,0)2,252 rˉ252 σ^,252 rˉσ−\sigma^{-} = \sqrt{\frac{252}{n}\sum_t \min(r_t - \tau, 0)^2}, \qquad \frac{252\,\bar r}{\sqrt{252}\,\hat\sigma}, \qquad \frac{252\,\bar r}{\sigma^{-}}
(6.6)
  • — Sortino, F. & van der Meer, R. (1991). Downside Risk. Journal of Portfolio Management, 17(4).
BETA

Market model and time-varying beta

Single-index regressions on the benchmark, rolling and state-space betas, and asymmetric sensitivity.

Market model by ordinary least squares

The company's daily return on the benchmark's, with classical standard errors.

rt=α+β rtB+εt,θ^=(X⊤X)−1X⊤r,Var⁡^(θ^)=s^2(X⊤X)−1,  s^2=∑ε^t2n−2r_t = \alpha + \beta\,r^B_t + \varepsilon_t, \qquad \hat{\boldsymbol\theta} = (X^\top X)^{-1}X^\top r, \qquad \widehat{\Var}(\hat{\boldsymbol\theta}) = \hat s^2 (X^\top X)^{-1},\ \ \hat s^2 = \frac{\sum\hat\varepsilon_t^2}{n-2}
(7.1)
R2=1−∑ε^t2∑(rt−rˉ)2,σεann=252 s^,TE=252 sd⁡(rt−rtB)R^2 = 1 - \frac{\sum\hat\varepsilon_t^2}{\sum(r_t - \bar r)^2}, \qquad \sigma_\varepsilon^{\text{ann}} = \sqrt{252}\,\hat s, \qquad \text{TE} = \sqrt{252}\,\sd(r_t - r^B_t)
(7.2)
βt(w)=Cov⁡w(r,rB)Var⁡w(rB)\beta^{(w)}_t = \frac{\Cov_w(r, r^B)}{\Var_w(r^B)}
  • — Sharpe, W. F. (1963). A Simplified Model for Portfolio Analysis. Management Science, 9(2).

Kalman-filter beta

Alpha and beta follow random walks; the observation noise and the prior come from OLS on the first 60 sessions only, so no later observation leaks backwards.

xt=(αtβt)=xt−1+wt,  wt∼N(0,Q);rt=ht⊤xt+vt,  ht=(1rtB), vt∼N(0,R)\mathbf x_t = \begin{pmatrix}\alpha_t\\ \beta_t\end{pmatrix} = \mathbf x_{t-1} + \mathbf w_t,\ \ \mathbf w_t\sim\mathcal N(0, Q); \qquad r_t = \mathbf h_t^\top\mathbf x_t + v_t,\ \ \mathbf h_t = \begin{pmatrix}1\\ r^B_t\end{pmatrix},\ v_t\sim\mathcal N(0, R)
(7.3)
P−=P+Q,S=h⊤P−h+R,K=P−hS,x←x+K(rt−h⊤x),P←P−−K h⊤P−P^- = P + Q, \quad S = \mathbf h^\top P^- \mathbf h + R, \quad K = \frac{P^-\mathbf h}{S}, \quad \mathbf x \leftarrow \mathbf x + K\big(r_t - \mathbf h^\top\mathbf x\big), \quad P \leftarrow P^- - K\,\mathbf h^\top P^-
(7.4)
Parameters of Kalman-filter beta
SymbolValueMeaning
QQdiag(1e−9, 1e−4)state drift (alpha, beta)
RROLS residual variancefirst 60 sessions
x0,P0\mathbf x_0, P_0OLS estimates, squared SEsfirst 60 sessions
  • — Kalman, R. E. (1960). Journal of Basic Engineering, 82(1).

Up- and down-market beta and capture

Betas and average-return ratios on sessions where the benchmark rose and where it fell (each needs 20 sessions).

β±=Cov⁡(rt,rtB∣rtB≷0)Var⁡(rtB∣rtB≷0),Capture±=E[rt∣rtB≷0]E[rtB∣rtB≷0]\beta^{\pm} = \frac{\Cov(r_t, r^B_t \mid r^B_t \gtrless 0)}{\Var(r^B_t\mid r^B_t \gtrless 0)}, \qquad \text{Capture}^{\pm} = \frac{\E[r_t\mid r^B_t\gtrless0]}{\E[r^B_t\mid r^B_t\gtrless0]}
(7.5)
COV

Correlation structure and coverage risk

How the covered companies move together: shrinkage covariance, principal components, clustering, a risk decomposition of the equal-weight basket, breadth and dispersion.

Ledoit–Wolf shrinkage

The sample covariance (denominator T) shrunk towards a scaled identity with the data-driven optimal intensity. Squared Frobenius norms are divided by n, as in the paper.

S=1TX⊤X,m=tr⁡Sn,d2=1n∥S−mI∥F2S = \frac1T X^\top X, \qquad m = \frac{\operatorname{tr} S}{n}, \qquad d^2 = \frac1n\big\lVert S - mI\big\rVert_F^2
(8.1)
bˉ2=1T2∑k=1T1n∥xkxk⊤−S∥F2,b2=min⁡(bˉ2,d2),δ=b2d2\bar b^2 = \frac{1}{T^2}\sum_{k=1}^{T}\frac1n\big\lVert \mathbf x_k\mathbf x_k^\top - S\big\rVert_F^2, \qquad b^2 = \min(\bar b^2, d^2), \qquad \delta = \frac{b^2}{d^2}
Σ^∗=δ m I+(1−δ) S\hat\Sigma^{*} = \delta\, m\, I + (1-\delta)\,S
(8.2)

Using ‖xxᵀ − S‖²_F = (xᵀx)² − 2xᵀSx + ‖S‖²_F, the estimator is computed without forming T outer products.

Correlations are ρᵢⱼ = Sᵢⱼ / √(SᵢᵢSⱼⱼ). A company whose price did not move over the window has no defined correlation and is treated as uncorrelated (ρ = 0) in averages, components and clustering.

  • — Ledoit, O. & Wolf, M. (2004). A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices. Journal of Multivariate Analysis, 88(2).

Principal components and the absorption ratio

Eigen-decomposition of the correlation matrix by cyclic Jacobi rotations (sign fixed so each vector's largest entry is positive); the absorption ratio is the share of variance in the first k components.

C=VΛV⊤,  λ1≥⋯≥λn,ARk=∑i=1kλi∑i=1nλi,k=⌈n5⌉C = V\Lambda V^\top,\ \ \lambda_1\ge\dots\ge\lambda_n, \qquad \text{AR}_k = \frac{\sum_{i=1}^{k}\lambda_i}{\sum_{i=1}^{n}\lambda_i}, \qquad k = \left\lceil \tfrac{n}{5}\right\rceil
(8.3)
  • — Kritzman, M., Li, Y., Page, S. & Rigobon, R. (2011). Principal Components as a Measure of Systemic Risk. Journal of Portfolio Management, 37(4).

Correlation distance and average-linkage clustering

A metric on correlations, merged agglomeratively by average distance; the leaf order places companies that move together next to each other.

dij=12 (1−ρij)∈[0,1],D(A,B)=1∣A∣ ∣B∣∑i∈A∑j∈Bdijd_{ij} = \sqrt{\tfrac12\,(1 - \rho_{ij})} \in [0,1], \qquad D(\mathcal A, \mathcal B) = \frac{1}{|\mathcal A|\,|\mathcal B|}\sum_{i\in\mathcal A}\sum_{j\in\mathcal B} d_{ij}
(8.4)
  • — Mantegna, R. N. (1999). Hierarchical Structure in Financial Markets. European Physical Journal B, 11(1).

Euler risk decomposition and diversification ratio

Portfolio volatility is homogeneous of degree one in the weights, so it splits exactly into each holding's contribution.

σp=w⊤Σw,MCi=∂σp∂wi=(Σw)iσp,CCi=wi MCi,∑iCCi=σp\sigma_p = \sqrt{\mathbf w^\top\Sigma\mathbf w}, \qquad \text{MC}_i = \frac{\partial\sigma_p}{\partial w_i} = \frac{(\Sigma\mathbf w)_i}{\sigma_p}, \qquad \text{CC}_i = w_i\,\text{MC}_i, \qquad \sum_i \text{CC}_i = \sigma_p
(8.5)
DR=∑iwiσiσp\text{DR} = \frac{\sum_i w_i\sigma_i}{\sigma_p}
(8.6)
  • — Choueifaty, Y. & Coignard, Y. (2008). Toward Maximum Diversification. Journal of Portfolio Management, 35(1).

Breadth, average correlation and dispersion

How many companies are above their averages and at new highs or lows, how correlated they are on average, and how far apart their daily returns are.

Bt50=1n∑i1[Pi,t>SMA⁡50(Pi)t],ADt=ADt−1+∑isgn⁡(ri,t)\text{B}^{50}_t = \frac1n\sum_i \mathbb 1\big[P_{i,t} > \SMA_{50}(P_i)_t\big], \qquad \text{AD}_t = \text{AD}_{t-1} + \sum_i \sgn(r_{i,t})
(8.7)
ρˉ=2n(n−1)∑i<jρij,Dispt=252  121∑s=t−20tsd⁡i(ri,s)\bar\rho = \frac{2}{n(n-1)}\sum_{i<j}\rho_{ij}, \qquad \text{Disp}_t = \sqrt{252}\;\frac{1}{21}\sum_{s=t-20}^{t}\sd_i\big(r_{i,s}\big)
(8.8)
REGM

Regimes: the hidden Markov model

A two-state Gaussian hidden Markov model for daily returns, fitted by expectation–maximisation with scaled forward–backward recursions. State 1 is always the higher-volatility state.

Two-state Gaussian HMM

A Markov chain of states with Gaussian returns in each. Filtered probabilities use returns up to each session only; smoothed ones also use later returns inside the fitted window, never beyond the as-of date.

Pr⁡(st=j∣st−1=i)=aij,rt∣st=k∼N(μk,σk2),bk(r)=1σkφ ⁣(r−μkσk)\Pr(s_t = j \mid s_{t-1} = i) = a_{ij}, \qquad r_t \mid s_t = k \sim \mathcal N(\mu_k, \sigma_k^2), \qquad b_k(r) = \frac{1}{\sigma_k}\varphi\!\left(\frac{r - \mu_k}{\sigma_k}\right)
(9.1)
α^t(j)=bj(rt)∑iα^t−1(i) aijct,β^t(i)=∑jaij bj(rt+1) β^t+1(j)ct+1,ln⁡L=∑tln⁡ct\hat\alpha_t(j) = \frac{b_j(r_t)\sum_i\hat\alpha_{t-1}(i)\,a_{ij}}{c_t}, \qquad \hat\beta_t(i) = \frac{\sum_j a_{ij}\,b_j(r_{t+1})\,\hat\beta_{t+1}(j)}{c_{t+1}}, \qquad \ln L = \sum_t \ln c_t
(9.2)
γt(i)∝α^t(i)β^t(i),ξt(i,j)∝α^t(i) aij bj(rt+1) β^t+1(j)\gamma_t(i) \propto \hat\alpha_t(i)\hat\beta_t(i), \qquad \xi_t(i,j) \propto \hat\alpha_t(i)\,a_{ij}\,b_j(r_{t+1})\,\hat\beta_{t+1}(j)
a^ij=∑tξt(i,j)∑tγt(i),μ^k=∑tγt(k) rt∑tγt(k),σ^k2=max⁡ ⁣(∑tγt(k)(rt−μ^k)2∑tγt(k), (0.05 σ^)2)\hat a_{ij} = \frac{\sum_t\xi_t(i,j)}{\sum_t\gamma_t(i)}, \qquad \hat\mu_k = \frac{\sum_t\gamma_t(k)\,r_t}{\sum_t\gamma_t(k)}, \qquad \hat\sigma_k^2 = \max\!\left(\frac{\sum_t\gamma_t(k)(r_t - \hat\mu_k)^2}{\sum_t\gamma_t(k)},\ (0.05\,\hat\sigma)^2\right)
(9.3)
Pr⁡(st=1∣r1:t)=α^t(1),Pr⁡(st=1∣r1:T)=γt(1),E[durationk]=11−akk,π1=a01a01+a10\Pr(s_t = 1 \mid r_{1:t}) = \hat\alpha_t(1), \qquad \Pr(s_t = 1\mid r_{1:T}) = \gamma_t(1), \qquad \E[\text{duration}_k] = \frac{1}{1 - a_{kk}}, \qquad \pi_1 = \frac{a_{01}}{a_{01}+a_{10}}
(9.4)
δt(j)=max⁡i[δt−1(i)+ln⁡aij]+ln⁡bj(rt)(Viterbi path)\delta_t(j) = \max_i\big[\delta_{t-1}(i) + \ln a_{ij}\big] + \ln b_j(r_t) \quad\text{(Viterbi path)}
Parameters of Two-state Gaussian HMM
SymbolValueMeaning
A(0)A^{(0)}[[0.97, 0.03], [0.10, 0.90]]initial transitions
split\text{split}80th percentile of |r|initial calm / stressed returns
tolerance\text{tolerance}1e−8 in ln L, ≤ 300 iterationsconvergence

The benchmark regime refits on every benchmark return to the as-of date. The backtest lab's market-regime measure refits every 21 sessions on the latest 504 returns and filters daily, so no session uses a later return.

  • — Hamilton, J. D. (1989). Econometrica, 57(2).
  • — Rabiner, L. R. (1989). Proceedings of the IEEE, 77(2).
  • — Baum, L. E., Petrie, T., Soules, G. & Weiss, N. (1970). Annals of Mathematical Statistics, 41(1).
STAT

Serial dependence and stationarity

Tests of whether returns are independent and whether a series wanders or reverts, with their small-sample corrections.

Autocorrelation and the Ljung–Box test

ρ^k=∑t=k+1n(xt−xˉ)(xt−k−xˉ)∑t=1n(xt−xˉ)2,Q=n(n+2)∑k=1mρ^k2n−k  ∼H0  χm2\hat\rho_k = \frac{\sum_{t=k+1}^{n}(x_t-\bar x)(x_{t-k}-\bar x)}{\sum_{t=1}^{n}(x_t-\bar x)^2}, \qquad Q = n(n+2)\sum_{k=1}^{m}\frac{\hat\rho_k^2}{n-k} \;\overset{H_0}{\sim}\; \chi^2_m
(10.1)
  • — Ljung, G. M. & Box, G. E. P. (1978). Biometrika, 65(2).

Augmented Dickey–Fuller test with MacKinnon critical values

The t-ratio of the lagged level in a regression of differences; critical values from MacKinnon's response surfaces at the sample size.

Δyt=a+b t+γ yt−1+∑i=1pϕi Δyt−i+et,τ=γ^se^(γ^)\Delta y_t = a + b\,t + \gamma\,y_{t-1} + \sum_{i=1}^{p}\phi_i\,\Delta y_{t-i} + e_t, \qquad \tau = \frac{\hat\gamma}{\widehat{\text{se}}(\hat\gamma)}
(10.2)
cvα(T)=τ∞+β1T+β2T2,e.g. constant, 5%: −2.86154−2.8903T−4.234T2\text{cv}_\alpha(T) = \tau_\infty + \frac{\beta_1}{T} + \frac{\beta_2}{T^2}, \qquad \text{e.g. constant, 5\%: } -2.86154 - \frac{2.8903}{T} - \frac{4.234}{T^2}
(10.3)
Parameters of Augmented Dickey–Fuller test with MacKinnon critical values
SymbolValueMeaning
pp1augmenting lags
deterministic\text{deterministic}constant (unit-root test); none (Engle–Granger residuals)
  • — Dickey, D. A. & Fuller, W. A. (1979). Journal of the American Statistical Association, 74(366).
  • — MacKinnon, J. G. (2010). Critical Values for Cointegration Tests. Queen's Economics Department Working Paper 1227.

Hurst exponent by rescaled range, Anis–Lloyd corrected

The rescaled range grows like n^H; the raw slope is biased upward in small samples, so it is measured against the expected R/S of independent data.

(R/S)n=1c∑chunksmax⁡k∑i≤k(xi−xˉ)−min⁡k∑i≤k(xi−xˉ)s,n=8,16,32,⋯≤N4(R/S)_n = \frac{1}{c}\sum_{\text{chunks}}\frac{\max_k\sum_{i\le k}(x_i - \bar x) - \min_k\sum_{i\le k}(x_i-\bar x)}{s}, \qquad n = 8, 16, 32, \dots \le \tfrac{N}{4}
(10.4)
E[(R/S)n]=n−12n Γ ⁣(n−12)π  Γ ⁣(n2)∑i=1n−1n−ii\E[(R/S)_n] = \frac{n-\frac12}{n}\,\frac{\Gamma\!\left(\frac{n-1}{2}\right)}{\sqrt\pi\;\Gamma\!\left(\frac n2\right)}\sum_{i=1}^{n-1}\sqrt{\frac{n-i}{i}}
(10.5)
H=12+κ^,ln⁡(R/S)n−ln⁡E[(R/S)n]=c+κln⁡n+enH = \tfrac12 + \hat\kappa, \qquad \ln(R/S)_n - \ln\E[(R/S)_n] = c + \kappa\ln n + e_n
  • — Hurst, H. E. (1951). Transactions of the ASCE, 116.
  • — Anis, A. A. & Lloyd, E. H. (1976). Biometrika, 63(1).
  • — Peters, E. E. (1994). Fractal Market Analysis.

Lo–MacKinlay variance ratio

Overlapping q-period variance against q times the one-period variance, with the heteroskedasticity-consistent statistic.

μ^=ln⁡PT−ln⁡P0T,σ^a2=1T−1∑t(dt)2, dt=Δln⁡Pt−μ^,σ^c2=1m∑t=qT(ln⁡Pt−ln⁡Pt−q−qμ^)2\hat\mu = \frac{\ln P_T - \ln P_0}{T},\quad \hat\sigma^2_a = \frac{1}{T-1}\sum_{t}(d_t)^2,\ d_t = \Delta\ln P_t - \hat\mu, \qquad \hat\sigma^2_c = \frac{1}{m}\sum_{t=q}^{T}\big(\ln P_t - \ln P_{t-q} - q\hat\mu\big)^2
(10.6)
m=q (T−q+1)(1−qT),VR(q)=σ^c2σ^a2m = q\,(T-q+1)\left(1 - \frac qT\right), \qquad \text{VR}(q) = \frac{\hat\sigma^2_c}{\hat\sigma^2_a}
z∗=VR(q)−1θ^/T,θ^=∑j=1q−1(2(q−j)q)2δ^j,δ^j=T∑tdt2 dt−j2(∑tdt2)2z^* = \frac{\text{VR}(q) - 1}{\sqrt{\hat\theta/T}}, \qquad \hat\theta = \sum_{j=1}^{q-1}\left(\frac{2(q-j)}{q}\right)^2\hat\delta_j, \qquad \hat\delta_j = \frac{T\sum_t d_t^2\,d_{t-j}^2}{\big(\sum_t d_t^2\big)^2}
(10.7)
  • — Lo, A. W. & MacKinlay, A. C. (1988). Review of Financial Studies, 1(1).

AR(1) mean-reversion half-life

Δyt=a+b yt−1+et,ϕ=1+b^,t1/2=−ln⁡2ln⁡ϕ(0<ϕ<1)\Delta y_t = a + b\,y_{t-1} + e_t, \qquad \phi = 1 + \hat b, \qquad t_{1/2} = -\frac{\ln 2}{\ln\phi}\quad (0<\phi<1)
(10.8)

Moments and the Jarque–Bera test

S=1n∑(x−xˉ)3(1n∑(x−xˉ)2)3/2,K=1n∑(x−xˉ)4(1n∑(x−xˉ)2)2−3,JB=n6(S2+K24)∼H0χ22S = \frac{\frac1n\sum(x-\bar x)^3}{\left(\frac1n\sum(x-\bar x)^2\right)^{3/2}}, \qquad K = \frac{\frac1n\sum(x-\bar x)^4}{\left(\frac1n\sum(x-\bar x)^2\right)^{2}} - 3, \qquad \text{JB} = \frac n6\left(S^2 + \frac{K^2}{4}\right)\overset{H_0}{\sim}\chi^2_2
(10.9)
  • — Jarque, C. M. & Bera, A. K. (1980). Economics Letters, 6(3).
PAIR

Co-movement and cointegration

Same-sector pairs whose log prices share a stationary combination.

Engle–Granger two-step test

A levels regression of one log price on the other, then a unit-root test on its residual against the two-variable critical values. Each leg is also tested for a unit root, since a stationary leg makes the test meaningless.

ln⁡Yt=c+h ln⁡Xt+ut,Δu^t=γ u^t−1+ϕ Δu^t−1+et,τEG vs cvα(2,c)(T)\ln Y_t = c + h\,\ln X_t + u_t, \qquad \Delta\hat u_t = \gamma\,\hat u_{t-1} + \phi\,\Delta\hat u_{t-1} + e_t, \qquad \tau_{\text{EG}} \text{ vs } \text{cv}^{(2,c)}_\alpha(T)
(11.1)
zTspread=u^T−u^ˉsd⁡(u^)z^{\text{spread}}_T = \frac{\hat u_T - \bar{\hat u}}{\sd(\hat u)}
(11.2)
Parameters of Engle–Granger two-step test
SymbolValueMeaning
cv5%(2,c)\text{cv}^{(2,c)}_{5\%}−3.33613 − 6.1101/T − 6.823/T²MacKinnon (2010), two variables, constant
  • — Engle, R. F. & Granger, C. W. J. (1987). Econometrica, 55(2).
LVL

Volume, liquidity and levels

Participation, price impact and the levels price has traded at.

Volume measures

OBVt=OBVt−1+sgn⁡(Pt−Pt−1) Vt,ztV=ln⁡Vt−ln⁡V‾[t−60, t−1]sd⁡[t−60, t−1](ln⁡V)\text{OBV}_t = \text{OBV}_{t-1} + \sgn(P_t - P_{t-1})\,V_t, \qquad z^{V}_t = \frac{\ln V_t - \overline{\ln V}_{[t-60,\,t-1]}}{\sd_{[t-60,\,t-1]}(\ln V)}
(12.1)
Vt120∑i=019Vt−i−1,UD20=∑ΔP>0V∑ΔP<0V,ADV20=120∑PtVt\frac{V_t}{\frac1{20}\sum_{i=0}^{19}V_{t-i}} - 1, \qquad \text{UD}_{20} = \frac{\sum_{\Delta P>0}V}{\sum_{\Delta P<0}V}, \qquad \text{ADV}_{20} = \frac1{20}\sum P_tV_t
(12.2)

A session with no volume (a halt) has no logarithm: it is left out of the z-score's baseline, which then needs at least 54 of its 60 sessions, and has no z-score of its own.

  • — Granville, J. (1963). Granville's New Key to Stock Market Profits.

Amihud illiquidity

Average absolute return per unit of dollar volume, in basis points per USD 1 million traded.

ILLIQ=120∑t104 ∣rt∣PtVt/106\text{ILLIQ} = \frac{1}{20}\sum_{t}\frac{10^4\,|r_t|}{P_tV_t/10^6}
(12.3)
  • — Amihud, Y. (2002). Illiquidity and Stock Returns. Journal of Financial Markets, 5(1).

VWAP, range position, volume profile and pivots

The volume profile spreads each session's volume evenly over its low–high range; the value area grows from the point of control towards the heavier neighbour until it holds 70% of the volume.

VWAP20=∑Ht+Lt+Pt3 Vt∑Vt,RP252=Pt−min⁡252Pmax⁡252P−min⁡252P\text{VWAP}_{20} = \frac{\sum \frac{H_t+L_t+P_t}{3}\,V_t}{\sum V_t}, \qquad \text{RP}_{252} = \frac{P_t - \min_{252}P}{\max_{252}P - \min_{252}P}
(12.4)
v(b)=∑tVt ∣[Lt,Ht]∩b∣Ht−Lt,POC=arg max⁡bv(b)v(b) = \sum_t V_t\,\frac{\big|[L_t, H_t]\cap b\big|}{H_t - L_t}, \qquad \text{POC} = \argmax_b v(b)
PP=H+L+C3,R1=2 PP−L,S1=2 PP−H,R2=PP+(H−L),S2=PP−(H−L)\text{PP} = \frac{H+L+C}{3},\quad R_1 = 2\,\text{PP} - L,\quad S_1 = 2\,\text{PP} - H,\quad R_2 = \text{PP} + (H-L),\quad S_2 = \text{PP} - (H-L)
(12.5)
MON

Monitoring, attribution and ranking

How the research workflow turns measurements into changes for review: a severity for each rule, where a move sits, and a ranking that learns from the team's decisions without hiding large changes.

Rule severity

Each monitoring rule measures how far past its threshold a change is, on a 1–3 scale.

sev=clamp⁡[1,3] ⁣(∣magnitude∣threshold)(rule-specific magnitude and threshold; see the rules below)\text{sev} = \clamp_{[1,3]}\!\left(\frac{|\text{magnitude}|}{\text{threshold}}\right) \quad\text{(rule-specific magnitude and threshold; see the rules below)}
(13.1)

Where a move sits

Over a change's window, the company's log return c is compared with its sector peers' average s and the benchmark's b. A description of where the move sits, not a claim about its cause.

class={mixed∣c∣<0.015 ∧ ∣c−b∣<0.015marketsgn⁡b=sgn⁡c ∧ ∣c−b∣≤0.35 ∣c∣companyω≥0.65sectorω≤0.35mixedotherwiseω=∣c−s∣∣c−s∣+∣s−b∣\text{class} = \begin{cases} \text{mixed} & |c| < 0.015 \ \wedge\ |c-b| < 0.015\\ \text{market} & \sgn b = \sgn c \ \wedge\ |c-b| \le 0.35\,|c|\\ \text{company} & \omega \ge 0.65\\ \text{sector} & \omega \le 0.35\\ \text{mixed} & \text{otherwise}\end{cases} \qquad \omega = \frac{|c-s|}{|c-s| + |s-b|}
(13.2)

Learned weights and ranking

Each decision counts for or against its kind of change, smoothed as if three neutral decisions had already been made. Learned weights reorder but never hide, and a change well past its rule keeps at least its own severity.

wk=∑d∈Dkω(d)∣Dk∣+3w_k = \frac{\sum_{d\in\mathcal D_k}\omega(d)}{|\mathcal D_k| + 3}
(13.3)
score=sev (1+0.35 wk)⋅(1.25 if a stated priority)⋅{1.3, 1, 0.75}Titan priority,score≥sev if sev≥1.8\text{score} = \text{sev}\,\big(1 + 0.35\,w_k\big)\cdot\big(1.25\ \text{if a stated priority}\big)\cdot\{1.3,\,1,\,0.75\}_{\text{Titan priority}}, \qquad \text{score} \ge \text{sev}\ \text{if } \text{sev}\ge 1.8
(13.4)
Parameters of Learned weights and ranking
SymbolValueMeaning
ω(important)\omega(\text{important})1decision weight
ω(investigate)\omega(\text{investigate})0.75decision weight
ω(relevant)\omega(\text{relevant})0.5decision weight
ω(watch)\omega(\text{watch})0.5decision weight
ω(dismissed)\omega(\text{dismissed})-0.25decision weight
ω(noise)\omega(\text{noise})-1decision weight

An undecided change older than 13 weeks becomes history ("not reviewed") rather than a to-do.

LQ

Liquid Quant

Whether a company's recent relative strength remains positive after accounting for market and sector movements, across a declared grid of estimation choices.

Factor-adjusted relative strength over a grid

For each evaluation day d and estimation length L, the company's daily log return is regressed on the factor returns over the L sessions ending at d − 1; the day's adjusted return subtracts the factor exposure only (the intercept carries the stock-specific drift the claim is about). The measure sums W of them.

rs=ad+bd⊤fs+es,s∈[d−L, d−1],fs={rsMmarket(rsM, rsS)⊤market and sectorr_s = a_d + \mathbf b_d^\top \mathbf f_s + e_s,\quad s \in [d-L,\ d-1], \qquad \mathbf f_s = \begin{cases} r^{M}_s & \text{market}\\ (r^M_s,\ r^{S}_s)^\top & \text{market and sector}\end{cases}
(14.1)
ud=rd−b^d−1⊤fd,M(L,W)=100∑d=τ−W+1τud(log-pp)u_d = r_d - \hat{\mathbf b}_{d-1}^\top\mathbf f_d, \qquad \mathcal M(L, W) = 100\sum_{d = \tau - W + 1}^{\tau} u_d \quad\text{(log-pp)}
(14.2)
X~=XD−1, D=diag⁡∥xj∥,X~=UΣV⊤,θ^=D−1VΣ+U⊤y,κ=σmax⁡σmin⁡≤30\tilde X = X D^{-1},\ D = \operatorname{diag}\lVert\mathbf x_j\rVert, \quad \tilde X = U\Sigma V^\top, \quad \hat{\boldsymbol\theta} = D^{-1}V\Sigma^{+}U^\top y, \qquad \kappa = \frac{\sigma_{\max}}{\sigma_{\min}} \le 30
(14.3)
supports(L,W)  ⟺  M(L,W)>10−9,small  ⟺  ∣M∣≤0.1\text{supports}(L,W) \iff \mathcal M(L,W) > 10^{-9}, \qquad \text{small} \iff |\mathcal M| \le 0.1
Parameters of Factor-adjusted relative strength over a grid
SymbolValueMeaning
LL60, 90, 120, 160, 200, 252estimation sessions
WW20, 40, 60, 80, 100, 120assessment sessions
κ\kappa≤ 30Belsley condition index; above it the cell is collinear and left empty

Every window sits on calendar positions: a missing price makes the cell unavailable with the series and date named; nothing is filled. Only the market-and-sector layer can establish the claim; the market layer is shown for comparison. Counts of supporting settings are never turned into a probability.

  • — Belsley, D. A., Kuh, E. & Welsch, R. E. (1980). Regression Diagnostics.
  • — Demmel, J. & Veselić, K. (1992). Jacobi's Method Is More Accurate than QR. SIAM J. Matrix Anal. Appl., 13(4).
LAB

Backtest lab

Event studies, measure studies, model correlations and rule backtests on up to ten years, with the statistics that say how much weight a result can bear.

Event studies

An occurrence is a session on which a condition becomes true (or a flag fires). Outcomes are measured from the occurrence close over each horizon, against ordinary sessions, with moving-block bootstrap intervals over calendar weeks.

yo,h=Rto→to+h−Rto→to+hB,yˉh=1∣O∣∑oyo,h,Δh=yˉh−yˉhordinaryy_{o,h} = R_{t_o\to t_o+h} - R^{B}_{t_o\to t_o+h}, \qquad \bar y_h = \frac{1}{|\mathcal O|}\sum_{o}y_{o,h}, \qquad \Delta_h = \bar y_h - \bar y^{\text{ordinary}}_h
(15.1)
θ^∗=∑g∈G∗Sg∑g∈G∗Ng,G∗=blocks of ⌈h/5⌉ consecutive weeks,CI95=[θ^(2.5%)∗, θ^(97.5%)∗]\hat\theta^{*} = \frac{\sum_{g\in\mathcal G^*}S_g}{\sum_{g\in\mathcal G^*}N_g}, \quad \mathcal G^* = \text{blocks of } \lceil h/5\rceil \text{ consecutive weeks}, \qquad \text{CI}_{95} = \big[\hat\theta^{*}_{(2.5\%)},\ \hat\theta^{*}_{(97.5\%)}\big]
(15.2)
  • — Künsch, H. R. (1989). The Jackknife and the Bootstrap for General Stationary Observations. Annals of Statistics, 17(3).
  • — MacKinlay, A. C. (1997). Event Studies in Economics and Finance. Journal of Economic Literature, 35(1).

Measure studies: information coefficient

At each rebalance, companies are sorted by the measure into groups; the information coefficient is the rank correlation between the measure and what followed. Overlapping horizons use Newey–West with a matching lag.

ICt=ρS(xi,t, Ri,t→t+h),ρS=1−6∑di2n(n2−1)  (average ranks for ties)\text{IC}_t = \rho_S\big(x_{i,t},\ R_{i,t\to t+h}\big), \qquad \rho_S = 1 - \frac{6\sum d_i^2}{n(n^2-1)}\ \ (\text{average ranks for ties})
(15.3)
s^2=γ^0+2∑k=1ℓ(1−kℓ+1)γ^k,t=IC‾s^2/n,ℓ=⌈hΔ⌉−1\hat s^2 = \hat\gamma_0 + 2\sum_{k=1}^{\ell}\left(1 - \frac{k}{\ell+1}\right)\hat\gamma_k, \qquad t = \frac{\overline{\text{IC}}}{\sqrt{\hat s^2/n}}, \qquad \ell = \left\lceil\frac{h}{\Delta}\right\rceil - 1
(15.4)
  • — Newey, W. K. & West, K. D. (1987). Econometrica, 55(3).
  • — Grinold, R. C. & Kahn, R. N. (2000). Active Portfolio Management.

Rule backtests and performance

Decisions at a close, fills at the next open; long only, no leverage, units drift between trades, cash earns nothing, and every trade pays the stated cost on each side.

NAVt=casht+∑iqi,tPi,t,cash←cash−∑iΔqi Oi,t+1−c∑i∣Δqi∣ Oi,t+1\text{NAV}_{t} = \text{cash}_t + \sum_i q_{i,t}P_{i,t}, \qquad \text{cash} \leftarrow \text{cash} - \sum_i \Delta q_i\,O_{i,t+1} - c\sum_i|\Delta q_i|\,O_{i,t+1}
(15.5)
CAGR=(NAVTNAV0)252/n−1,SR^=252 rˉσ^,Calmar=CAGR∣MDD∣\text{CAGR} = \left(\frac{\text{NAV}_T}{\text{NAV}_0}\right)^{252/n} - 1, \qquad \widehat{\text{SR}} = \sqrt{252}\,\frac{\bar r}{\hat\sigma}, \qquad \text{Calmar} = \frac{\text{CAGR}}{|\text{MDD}|}
(15.6)
Parameters of Rule backtests and performance
SymbolValueMeaning
cc10 bpdefault cost per side

Sharpe ratio inference: standard error, PSR and deflated Sharpe

The Sharpe ratio's sampling error under non-normal returns, the probability that the true ratio exceeds a benchmark, and that probability against the best a set of variants would show by luck.

se^(SR^)=1+12SR^2−γ^3SR^+κ^4SR^2n\widehat{\text{se}}(\widehat{\text{SR}}) = \sqrt{\frac{1 + \frac12\widehat{\text{SR}}^2 - \hat\gamma_3\widehat{\text{SR}} + \frac{\hat\kappa}{4}\widehat{\text{SR}}^2}{n}}
(15.7)
PSR(SR∗)=Φ ⁣((SR^−SR∗)n−11−γ^3SR^+γ^4−14SR^2),γ^4=κ^+3\text{PSR}(\text{SR}^*) = \Phi\!\left(\frac{(\widehat{\text{SR}} - \text{SR}^*)\sqrt{n-1}}{\sqrt{1 - \hat\gamma_3\widehat{\text{SR}} + \frac{\hat\gamma_4 - 1}{4}\widehat{\text{SR}}^2}}\right), \qquad \hat\gamma_4 = \hat\kappa + 3
(15.8)
E[max⁡NSR^]≈Var⁡[SR^n][(1−γ) Φ−1 ⁣(1−1N)+γ Φ−1 ⁣(1−1Ne)],DSR=PSR(E[max⁡NSR^])\E\big[\max_N \widehat{\text{SR}}\big] \approx \sqrt{\Var[\widehat{\text{SR}}_n]}\left[(1-\gamma)\,\Phi^{-1}\!\left(1 - \frac1N\right) + \gamma\,\Phi^{-1}\!\left(1 - \frac{1}{Ne}\right)\right], \qquad \text{DSR} = \text{PSR}\big(\E[\max_N\widehat{\text{SR}}]\big)
(15.9)
Parameters of Sharpe ratio inference: standard error, PSR and deflated Sharpe
SymbolValueMeaning
γ^3,κ^\hat\gamma_3, \hat\kappasampleskewness and excess kurtosis of daily returns
γ\gamma0.5772…Euler–Mascheroni constant
NNvariants triedin the conversation
  • — Lo, A. W. (2002). The Statistics of Sharpe Ratios. Financial Analysts Journal, 58(4).
  • — Mertens, E. (2002). Comments on Variance of the IID Estimator in Lo (2002).
  • — Bailey, D. H. & López de Prado, M. (2012). The Sharpe Ratio Efficient Frontier. Journal of Risk, 15(2).
  • — Bailey, D. H. & López de Prado, M. (2014). The Deflated Sharpe Ratio. Journal of Portfolio Management, 40(5).

Graded assessment

Every study and record is graded by named checks with stated thresholds: the core check (an interval, or the information coefficient's t-statistic) gates any evidence; the rest decide strong, moderate or weak.

grade={nonecore failsweakcore cautions, or any other check failsmoderateothers only cautionstrongall pass\text{grade} = \begin{cases}\text{none} & \text{core fails}\\ \text{weak} & \text{core cautions, or any other check fails}\\ \text{moderate} & \text{others only caution}\\ \text{strong} & \text{all pass}\end{cases}
(15.10)
ANR

Analyst ratings

Third-party ratings, measured: when a rating counts, the unit a record measures, what followed in the rated direction, and rankings that do not reward short lucky records.

Stance, timing and consensus

Each firm's words map to a stance; a rating counts from the first close after it was published; the consensus averages current ratings on a 1–5 scale.

s(rating)∈{+1,0,−1},teff={tpubpublished on a session before 16:00 ETnext sessionotherwises(\text{rating}) \in \{+1, 0, -1\}, \qquad t^{\text{eff}} = \begin{cases} t_{\text{pub}} & \text{published on a session before 16:00 ET}\\ \text{next session} & \text{otherwise}\end{cases}
(16.1)
cˉ=5N++3N0+N−N,balance=N+−N−N,dispersion=sd⁡(Tj)T‾,gap=T‾Pτ−1\bar c = \frac{5N_{+} + 3N_{0} + N_{-}}{N}, \qquad \text{balance} = \frac{N_+ - N_-}{N}, \qquad \text{dispersion} = \frac{\sd(T_j)}{\overline T}, \qquad \text{gap} = \frac{\overline T}{P_\tau} - 1
(16.2)
Parameters of Stance, timing and consensus
SymbolValueMeaning
current\text{current}365 daysa rating counts for this long after the analyst's latest action
recent\text{recent}28 dayswindow for rating changes

Spells and directional excess

A spell is one analyst's continuous stance on one company, ended by a change, the end of coverage, a firm move or a year. Its outcome is the company's return less a benchmark, signed by the stance.

spell=[te, tx],tx=min⁡(tchange, tend, tmove, te+252)\text{spell} = [t_e,\ t_x],\quad t_x = \min\big(t_{\text{change}},\ t_{\text{end}},\ t_{\text{move}},\ t_e + 252\big)
(16.3)
x=s⋅[PtxPte−YtxYte],Y∈{market, sector, coverage average},hit=1[x>0]x = s\cdot\left[\frac{P_{t_x}}{P_{t_e}} - \frac{Y_{t_x}}{Y_{t_e}}\right], \qquad Y \in \{\text{market},\ \text{sector},\ \text{coverage average}\}, \qquad \text{hit} = \mathbb 1[x > 0]
(16.4)
Ct=Ct−1(1+1nt∑i(Pi,tPi,t−1−1))(coverage average, rebalanced daily)C_t = C_{t-1}\left(1 + \frac1{n_t}\sum_{i}\left(\frac{P_{i,t}}{P_{i,t-1}} - 1\right)\right) \quad\text{(coverage average, rebalanced daily)}
1Y signed=∏t=τ−252+1τ(1+st−1(Rt−RtY))−1\text{1Y signed} = \prod_{t=\tau-252+1}^{\tau}\Big(1 + s_{t-1}\big(R_{t} - R^{Y}_{t}\big)\Big) - 1
(16.5)

Records, intervals and empirical-Bayes rankings

A record averages directional excess with a moving-block bootstrap interval over the weeks spells took effect. Rankings shrink each record towards the average of everyone ranked by the one-way random-effects estimate of how much records truly differ.

xˉi=1ni∑kxik,μ=∑inixˉi∑ini,σ^w2=∑i(ni−1)si2∑i(ni−1)\bar x_i = \frac{1}{n_i}\sum_{k}x_{ik}, \qquad \mu = \frac{\sum_i n_i\bar x_i}{\sum_i n_i}, \qquad \hat\sigma^2_w = \frac{\sum_i (n_i - 1)s_i^2}{\sum_i(n_i - 1)}
(16.6)
n0=N−∑ini2/Nk−1,τ^2=max⁡ ⁣(0, 1k−1∑ini(xˉi−μ)2−σ^w2n0)n_0 = \frac{N - \sum_i n_i^2/N}{k-1}, \qquad \hat\tau^2 = \max\!\left(0,\ \frac{\frac{1}{k-1}\sum_i n_i(\bar x_i - \mu)^2 - \hat\sigma^2_w}{n_0}\right)
(16.7)
x~i=μ+Bi (xˉi−μ),Bi=niτ^2niτ^2+σ^w2\tilde x_i = \mu + B_i\,(\bar x_i - \mu), \qquad B_i = \frac{n_i\hat\tau^2}{n_i\hat\tau^2 + \hat\sigma^2_w}
(16.8)
Parameters of Records, intervals and empirical-Bayes rankings
SymbolValueMeaning
ni≥10n_i \ge 10completed spellsto be ranked
blocks\text{blocks}4 weeksbootstrap block length, 1,000 draws

With k records ranked, about 0.05·k would show an interval clear of zero by chance alone; the ranking says so.

  • — Efron, B. & Morris, C. (1975). Data Analysis Using Stein's Estimator and Its Generalizations. JASA, 70(350).
  • — Searle, S. R., Casella, G. & McCulloch, C. E. (1992). Variance Components.

Price targets and what followed rating actions

A target is reached when a close within a year is at or beyond it; actions are studied as events from the close before they became known.

reached(Tj)=1[∃ t∈(te, te+252]:sgn⁡(Tj−Pte) (Pt−Tj)≥0]\text{reached}(T_j) = \mathbb 1\Big[\exists\, t\in(t_e,\, t_e + 252] : \sgn(T_j - P_{t_e})\,(P_t - T_j) \ge 0\Big]
(16.9)
CARk=Pte+kPte−1−Yte+kYte−1,k=−10,…,60\text{CAR}_k = \frac{P_{t_e+k}}{P_{t_e-1}} - \frac{Y_{t_e+k}}{Y_{t_e-1}}, \qquad k = -10,\dots,60
(16.10)
Parameters of Price targets and what followed rating actions
SymbolValueMeaning
hh5, 20, 60 (graded at 20)sessions after day 0
SYN

The synthetic universe

The labelled demonstration data: 26 fictional companies, a generated benchmark and ten years (2610 sessions) from one seed (20260918). Its structure plants answers the models can be checked against.

Regimes, factors, GARCH shocks, jumps and trends

A two-state Markov regime drives the market factor; each sector has its own factor; each company adds GARCH(1,1) idiosyncratic shocks, rare jumps and a slow trend wave. Each component draws from its own seeded stream.

Pr⁡(calm→stressed)=0.012,Pr⁡(stressed→calm)=0.055,mt=μst+σstzt\Pr(\text{calm}\to\text{stressed}) = 0.012, \quad \Pr(\text{stressed}\to\text{calm}) = 0.055, \qquad m_t = \mu_{s_t} + \sigma_{s_t}z_t
(17.1)
ri,t=μi+wisin⁡ ⁣(ϕi+2πcitn)⏟trend wave+βimt+λiftS(i)+κst εi,t+Ji,tr_{i,t} = \mu_i + \underbrace{w_i\sin\!\left(\phi_i + \frac{2\pi c_i t}{n}\right)}_{\text{trend wave}} + \beta_i m_t + \lambda_i f^{S(i)}_t + \kappa_{s_t}\,\varepsilon_{i,t} + J_{i,t}
(17.2)
hi,t=ωi+αiεi,t−12+βihi,t−1,  ωi=σi2(1−αi−βi),Ji,t=1[Ut<λiJ/252] σiJ ηth_{i,t} = \omega_i + \alpha_i\varepsilon^2_{i,t-1} + \beta_i h_{i,t-1},\ \ \omega_i = \sigma^2_i(1-\alpha_i-\beta_i), \qquad J_{i,t} = \mathbb 1[U_t < \lambda^J_i/252]\,\sigma^J_i\,\eta_t
(17.3)
Parameters of Regimes, factors, GARCH shocks, jumps and trends
SymbolValueMeaning
(μ,σ)calm(\mu, \sigma)_{\text{calm}}(0.00052, 0.0066)market factor, daily
(μ,σ)stressed(\mu, \sigma)_{\text{stressed}}(−0.0011, 0.0158)market factor, daily
σS\sigma^{S}0.0042 / 0.0072sector factor, calm / stressed
κstressed\kappa_{\text{stressed}}1.35idiosyncratic multiplier

Cointegrated pairs, the backward regime and the Gaussian bridge

A follower's log price is the leader's times a hedge ratio plus a stationary AR(1) spread. The ten-year history runs the regime backwards (a two-state chain is reversible) and bridges each spread exactly to the value the workspace starts from.

ln⁡Ft=hln⁡Lt+ut,ut=ϕ ut−1+σuηt, ∣ϕ∣<1\ln F_t = h\ln L_t + u_t, \qquad u_t = \phi\,u_{t-1} + \sigma_u\eta_t,\ |\phi|<1
(17.4)
π0 p01=π1 p10  ⇒  Pr⁡(st−1=j∣st=i)=pij\pi_0\,p_{01} = \pi_1\,p_{10} \;\Rightarrow\; \Pr(s_{t-1}=j\mid s_t=i) = p_{ij}
(17.5)
u~t=ut+(u⋆−uN) ϕ N−t,Cov⁡(ut,uN)Var⁡(uN)=ϕ N−t\tilde u_t = u_t + (u^{\star} - u_N)\,\phi^{\,N-t}, \qquad \frac{\Cov(u_t, u_N)}{\Var(u_N)} = \phi^{\,N-t}
(17.6)

Synthetic analysts with planted skill

Each fictional analyst's view of a company mixes a noisy version of the company's next six months against the benchmark (the planted skill ρ) with persistent noise, past-move chasing and the firm's house leaning. Thresholds give about 55% positive, 35% neutral and 10% negative ratings before the leaning.

vt=ρ z126fut(t)+1−ρ2 et+c z63past(t)+ℓfirm,et=0.75 et−1+1−0.752 ηtv_t = \rho\,z^{\text{fut}}_{126}(t) + \sqrt{1-\rho^2}\,e_t + c\,z^{\text{past}}_{63}(t) + \ell_{\text{firm}}, \qquad e_t = 0.75\,e_{t-1} + \sqrt{1-0.75^2}\,\eta_t
(17.7)
stance={+vt>Φ−1(0.45)−vt<Φ−1(0.10)0otherwise,zhfut(t)=ℓt+h−ℓtσ^ℓh,  ℓ=ln⁡PB\text{stance} = \begin{cases}+ & v_t > \Phi^{-1}(0.45)\\ - & v_t < \Phi^{-1}(0.10)\\ 0 & \text{otherwise}\end{cases}, \qquad z^{\text{fut}}_{h}(t) = \frac{\ell_{t+h} - \ell_t}{\hat\sigma_\ell\sqrt h},\ \ \ell = \ln\frac{P}{B}
(17.8)

The future is used only here, to plant the answer. Tests require the engine to recover it: skilled analysts rank high, reliably wrong ones low, specialists in their home sector.

NUM

Numerical methods

The algorithms underneath, all implemented in the terminal and tested against closed forms and known answers.

Least squares, inverses and decompositions

Ordinary regressions solve the normal equations with a Gauss–Jordan inverse (partial pivoting); collinearity-sensitive regressions go through a one-sided Jacobi SVD so XᵀX is never formed; symmetric eigenproblems use cyclic Jacobi rotations.

β^=(X⊤X)−1X⊤y,κ(X⊤X)=κ(X)2  ⇒  SVD for ill-conditioned designs\hat{\boldsymbol\beta} = (X^\top X)^{-1}X^\top y, \qquad \kappa(X^\top X) = \kappa(X)^2 \;\Rightarrow\; \text{SVD for ill-conditioned designs}
(18.1)
A(k+1)=Jpq⊤A(k)Jpq,tan⁡2θ=2apqaqq−app(cyclic Jacobi)A^{(k+1)} = J_{pq}^\top A^{(k)} J_{pq},\quad \tan 2\theta = \frac{2a_{pq}}{a_{qq} - a_{pp}} \quad\text{(cyclic Jacobi)}
  • — Golub, G. H. & Van Loan, C. F. (2013). Matrix Computations, 4th ed.

Nelder–Mead simplex

Derivative-free minimisation for the GARCH likelihood, with the standard coefficients.

xr=xˉ+1⋅(xˉ−xh),  xe=xˉ+2(xr−xˉ),  xc=xˉ+12(xh−xˉ),  xi←xℓ+12(xi−xℓ)\mathbf x_r = \bar{\mathbf x} + 1\cdot(\bar{\mathbf x} - \mathbf x_h),\ \ \mathbf x_e = \bar{\mathbf x} + 2(\mathbf x_r - \bar{\mathbf x}),\ \ \mathbf x_c = \bar{\mathbf x} + \tfrac12(\mathbf x_h - \bar{\mathbf x}),\ \ \mathbf x_i \leftarrow \mathbf x_\ell + \tfrac12(\mathbf x_i - \mathbf x_\ell)
(18.2)
  • — Nelder, J. A. & Mead, R. (1965). The Computer Journal, 7(4).

Distribution functions

The normal CDF by a Chebyshev fit of the complementary error function; its inverse by Acklam's rational approximation with one Halley step; chi-square and Student-t tails by regularised incomplete gamma and beta functions.

Φ(x)=12erfc⁡ ⁣(−x2),xn+1=xn−e1+xne2,  e=Φ(xn)−pφ(xn)\Phi(x) = \tfrac12\operatorname{erfc}\!\left(-\tfrac{x}{\sqrt2}\right), \qquad x_{n+1} = x_n - \frac{e}{1 + \frac{x_n e}{2}},\ \ e = \frac{\Phi(x_n) - p}{\varphi(x_n)}
(18.3)
Pr⁡(χk2>q)=Q ⁣(k2,q2),Pr⁡(∣tν∣>t)=Iν/(ν+t2) ⁣(ν2,12)\Pr(\chi^2_k > q) = Q\!\left(\tfrac k2, \tfrac q2\right), \qquad \Pr(|t_\nu| > t) = I_{\nu/(\nu + t^2)}\!\left(\tfrac\nu2, \tfrac12\right)
(18.4)
  • — Press, W. H. et al. (2007). Numerical Recipes, 3rd ed.
  • — Acklam, P. J. (2003). An algorithm for computing the inverse normal cumulative distribution function.
OUT

What followed

Each rule's record of what followed its occurrences on the coverage, by a protocol fixed on 2026-10-26 (outcomes-protocol-1.1.0) after the history it scores, so the historical records are in-sample: when an occurrence could first be acted on, what it is compared with, the one quantity its record averages, how repeats and overlap are handled, and how a record is graded among the others.

Entry and the same-date comparison

An occurrence at session t is entered at the close of the session after the one at which the weekly report containing it existed: the week-end, or the next session for a week cut short by a holiday. Its return over h sessions is compared with the average return of the other covered companies over exactly the same sessions.

e=k(w(t))+1,w(t)=min⁡{w∈W:w≥t},k(w)={ww is a Fridayw+1otherwise (a week cut short)e = k\big(w(t)\big) + 1, \qquad w(t) = \min\{w \in \mathcal W : w \ge t\}, \qquad k(w) = \begin{cases} w & w \text{ is a Friday} \\ w + 1 & \text{otherwise (a week cut short)}\end{cases}
(19.1)
Ri,e,h=Pi,e+hPi,e−1,Rˉ−i,e,h=1∣J∣−1∑j∈J, j≠iRj,e,h,ai,e,h=Ri,e,h−Rˉ−i,e,hR_{i,e,h} = \frac{P_{i,e+h}}{P_{i,e}} - 1, \qquad \bar R_{-i,e,h} = \frac{1}{|J|-1}\sum_{j \in J,\, j \ne i} R_{j,e,h}, \qquad a_{i,e,h} = R_{i,e,h} - \bar R_{-i,e,h}
(19.2)
complete  ⟺  e+h≤τ(pending otherwise; never in a record)\text{complete} \iff e + h \le \tau \qquad (\text{pending otherwise; never in a record})
Parameters of Entry and the same-date comparison
SymbolValueMeaning
hh5, 20, 60 sessions (records graded at 20)horizons
∣J∣−1|J| - 1≥ 3other companies with prices over the window
W\mathcal Wcomplete week-endsreport dates; a monitoring change fires at one
k(w)k(w)the session the report exists ata week ending before Friday is known complete only once the next session arrives

The return from the flag's own close (e = t) and the return between t and e (the cost of the weekly delivery) are shown beside each record. The market-benchmark version replaces the others' average with B.

Sizes and falls in expected standard deviations

Size and depth records divide by the company's volatility expected beforehand (RiskMetrics EWMA at the entry close, scaled to the horizon), subtract the other companies' same quantity, and subtract what companies in the same volatility state showed — an EWMA forecast does not revert, so it overstates what follows a spike and understates what follows a lull, and only the state comparison removes that.

σi,t2=λ σi,t−12+(1−λ) ri,t2,  λ=0.94,si,e,h=σi,eh\sigma^2_{i,t} = \lambda\,\sigma^2_{i,t-1} + (1-\lambda)\,r_{i,t}^2,\ \ \lambda = 0.94, \qquad s_{i,e,h} = \sigma_{i,e}\sqrt h
(19.3)
qi=∣ai,e,h∣si,e,h,di=min⁡ ⁣(0, min⁡1≤k≤hPi,e+kPi,e−1),δi=disi,e,hq_{i} = \frac{\lvert a_{i,e,h} \rvert}{s_{i,e,h}}, \qquad d_{i} = \min\!\Big(0,\ \min_{1 \le k \le h} \frac{P_{i,e+k}}{P_{i,e}} - 1\Big), \qquad \delta_i = \frac{d_i}{s_{i,e,h}}
(19.4)
mi=(qi−qˉ−i)−μs(i,e)q,fi=(δi−δˉ−i)−μs(i,e)δ,vi=sd⁡(ri,e+1,…,ri,e+h)σi,em_i = (q_i - \bar q_{-i}) - \mu^{q}_{s(i,e)}, \qquad f_i = (\delta_i - \bar\delta_{-i}) - \mu^{\delta}_{s(i,e)}, \qquad v_i = \frac{\operatorname{sd}(r_{i,e+1},\dots,r_{i,e+h})}{\sigma_{i,e}}
(19.5)
s(i,e)=⌊10 p(σi,e ∣ {σi,e−251,…,σi,e})⌋,μkx=mean⁡{xj,e′−xˉ−j,e′:s(j,e′)=k, e′+h≤τ}s(i,e) = \Big\lfloor 10\,p\big(\sigma_{i,e} \,\big|\, \{\sigma_{i,e-251},\dots,\sigma_{i,e}\}\big)\Big\rfloor, \qquad \mu^{x}_{k} = \operatorname{mean}\big\{x_{j,e'} - \bar x_{-j,e'} : s(j,e') = k,\ e' + h \le \tau\big\}
(19.5a)
  • — J.P. Morgan / Reuters (1996). RiskMetrics — Technical Document, 4th ed.

Records by question, and episodes

Each rule's record averages one fixed quantity: the signed same-date return for a one-sided direction rule, the balanced contrast for a two-sided one, the unsigned return for drift, the state-compared size or depth for magnitude and downside. Occurrences on a company entered at the same session count as one, in the direction of the latest (the state the weekly report showed); it joins the current episode when it is in the same direction and within a horizon of that episode's start, and otherwise starts a new one.

one-sided: 1n∑ksk ak,two-sided: 12(aˉ↑−aˉ↓),drift: aˉ,magnitude: mˉ,downside: fˉ\text{one-sided: } \frac1n\sum_k s_k\,a_k, \qquad \text{two-sided: } \tfrac12\big(\bar a^{\uparrow} - \bar a^{\downarrow}\big), \qquad \text{drift: } \bar a, \qquad \text{magnitude: } \bar m, \qquad \text{downside: } \bar f
(19.6)
same entry⇒one occurrence, sign of the latest;a new episode  ⟺  ek−estart≥h ∨ sk≠sstart, otherwise it joins\text{same entry} \Rightarrow \text{one occurrence, sign of the latest}; \qquad \text{a new episode} \iff e_k - e_{\text{start}} \ge h \ \lor\ s_k \ne s_{\text{start}}, \ \text{otherwise it joins}
(19.7)
side=1n∑k1[skRk>sk med⁡j≠iRj](one half when the occurrences carry no information)\text{side} = \frac1n\sum_k \mathbb 1\big[s_k R_k > s_k\,\operatorname{med}_{j\ne i}R_{j}\big] \quad(\text{one half when the occurrences carry no information})
(19.8)

The sign s comes from the occurrence's own direction (up +1, down −1), never from the outcome. Every test is two-sided: a direction record can show continuation (positive) or reversal (negative).

For a two-sided rule the side share is the average of the two sides' shares. Size and depth records carry no side share.

Overlap-aware intervals and the family

Episodes are summed by the calendar week they were entered, over every week of the period including empty ones; a circular block bootstrap draws runs of three times the horizon in weeks. The standard error is the replicates' spread; the interval, z, p and the smallest detectable effect all come from it, so the interval clears zero exactly when p < 0.05; q-values hold across the family under any dependence.

θ^b∗=g(∑w∈Bb∗Sw),ℓ=max⁡(2, 3⌈h/5⌉) weeks,se^=sd⁡b θ^b∗\hat\theta^{*}_b = g\Big(\sum_{w \in \mathcal B^{*}_b} S_w\Big), \qquad \ell = \max\big(2,\ 3\lceil h/5 \rceil\big) \text{ weeks}, \qquad \widehat{\mathrm{se}} = \operatorname{sd}_b\,\hat\theta^{*}_b
(19.9)
CI=θ^±1.96 se^,z=θ^se^,p=2(1−Φ(∣z∣))=Q ⁣(12,z22),MDE=2.8 se^\text{CI} = \hat\theta \pm 1.96\,\widehat{\mathrm{se}}, \qquad z = \frac{\hat\theta}{\widehat{\mathrm{se}}}, \qquad p = 2\big(1 - \Phi(|z|)\big) = Q\!\left(\tfrac12, \tfrac{z^2}{2}\right), \qquad \text{MDE} = 2.8\,\widehat{\mathrm{se}}
(19.10)
q(k)=min⁡j≥k min⁡ ⁣(1, m c(m)j p(j)),c(m)=∑i=1m1i(Benjamini–Yekutieli)q_{(k)} = \min_{j \ge k}\ \min\!\Big(1,\ \frac{m\,c(m)}{j}\,p_{(j)}\Big), \qquad c(m) = \sum_{i=1}^{m}\frac1i \quad\text{(Benjamini–Yekutieli)}
(19.11)
Parameters of Overlap-aware intervals and the family
SymbolValueMeaning
BB1000 at 20 sessions, 400 otherwisebootstrap replications
weeks\text{weeks}≥ 8for an interval
mmup to 26company rules with an interval at 20 sessions: at least 10 episodes over at least 8 weeks, with at least 95% of resampled histories measurable (the two rules about the whole coverage are described, not tested)
∣z∣|z|≥ 3the multiple-testing hurdle marked beside a record
  • — Politis, D. N. & Romano, J. P. (1992). A Circular Block-Resampling Procedure for Stationary Data. In Exploring the Limits of Bootstrap.
  • — Benjamini, Y. & Yekutieli, D. (2001). The Control of the False Discovery Rate in Multiple Testing under Dependency. Annals of Statistics, 29(4).
  • — Harvey, C. R., Liu, Y. & Zhu, H. (2016). … and the Cross-Section of Expected Returns. Review of Financial Studies, 29(1).

Grading a record

On licensed data a company rule's record at the primary horizon is graded by the Backtest lab's rule from named checks; nothing is graded on synthetic demonstration data.

core={pass0∉CI ∧ q≤0.1faila CI, otherwise (no evidence)not gradedno CI (value only, outside the family)\text{core} = \begin{cases}\text{pass} & 0 \notin \text{CI} \ \land\ q \le 0.1 \\ \text{fail} & \text{a CI, otherwise (no evidence)} \\ \text{not graded} & \text{no CI (value only, outside the family)}\end{cases}
(19.12)
sample: n≥30, weeks≥20 (caution n≥10);concentration: max⁡inin≤0.25 (caution≤0.5)\text{sample: } n \ge 30,\ \text{weeks} \ge 20\ (\text{caution } n \ge 10); \qquad \text{concentration: } \max_i \frac{n_i}{n} \le 0.25\ (\text{caution} \le 0.5)
(19.13)
sgn⁡θ^earlier half=sgn⁡θ^later half=sgn⁡θ^,sgn⁡θ^(0,5]=sgn⁡θ^(5,20]=sgn⁡θ^  (return records)\operatorname{sgn}\hat\theta_{\text{earlier half}} = \operatorname{sgn}\hat\theta_{\text{later half}} = \operatorname{sgn}\hat\theta, \qquad \operatorname{sgn}\hat\theta_{(0,5]} = \operatorname{sgn}\hat\theta_{(5,20]} = \operatorname{sgn}\hat\theta \ \ (\text{return records})

The halves split a record's episodes in two by entry date. The parts of the horizon do not overlap, unlike neighbouring horizons, so their agreement is informative; that check applies to return records (direction and drift) only, since the depth of a fall over sessions 6–20 is not part of the fall over 1–20. The out-of-sample record (occurrences on or after the protocol's date) is counted separately and never joined to the history.

Replay: a rule's record as returns over time

Each session, every company the rule flagged within the holding period is held at an equal share, in the rule's direction for a direction rule, against the rest of the coverage over that session; the sessions compound into the curve. Each session uses only closes up to itself, so the curve up to any date is what could have been drawn on that date. The funnel is how far a curve with no effect could have wandered by then.

Hs={ i:ei<s≤ei+ℓ },ps=1∣Hs∣∑i∈Hsσi(ri,s−rˉ−i,s),Ct=∏s≤t(1+ps)−1H_s = \{\, i : e_i < s \le e_i + \ell \,\}, \qquad p_s = \frac{1}{|H_s|}\sum_{i \in H_s} \sigma_i \big(r_{i,s} - \bar r_{-i,s}\big), \qquad C_t = \prod_{s \le t}(1 + p_s) - 1
(19.14)
funnelt=exp⁡ ⁣(±1.96 sd⁡(log⁡(1+ps))s≤tnt)−1\text{funnel}_t = \exp\!\Big(\pm 1.96\, \operatorname{sd}\big(\log(1+p_s)\big)_{s \le t} \sqrt{n_t}\Big) - 1
(19.15)
Parameters of Replay: a rule's record as returns over time
SymbolValueMeaning
ℓ\ell5, 20, 60 sessionsholding period, chosen by the reader
σi\sigma_i+1 or −1the flag's direction for a direction rule; +1 otherwise
ntn_tsessions with a holdingup to t

A later flag on a company replaces the earlier one. Before costs; a description of this history, not a return anyone earned.

Strategy studio: a hypothetical simulation

A strategy the reader defines from the rules is applied to a base (the coverage at equal weights, or the reader's own book) and compared with the same base without it, after the costs the reader sets. Titan Edge supplies no preset strategy.

w~i,s=wi,s∏k∈Ki,smk,mk={1−aktrim1+akadd,rest scaled by Us−ΔsUs or Δs held in cash\tilde w_{i,s} = w_{i,s}\prod_{k \in K_{i,s}} m_k, \qquad m_k = \begin{cases} 1 - a_k & \text{trim} \\ 1 + a_k & \text{add} \end{cases}, \qquad \text{rest scaled by } \frac{U_s - \Delta_s}{U_s} \text{ or } \Delta_s \text{ held in cash}
(19.16)
Rsstrategy=∑iw~i,s ri,s−c∑i∣ di,s−di,s−1∣,di,s=w~i,s−wi,s,Rsbase=∑iwi,s ri,sR^{\text{strategy}}_s = \sum_i \tilde w_{i,s}\, r_{i,s} - c \sum_i \big|\, d_{i,s} - d_{i,s-1} \big|, \qquad d_{i,s} = \tilde w_{i,s} - w_{i,s}, \qquad R^{\text{base}}_s = \sum_i w_{i,s}\, r_{i,s}
(19.17)
Parameters of Strategy studio: a hypothetical simulation
SymbolValueMeaning
cc0 to 100 bpthe reader's cost per unit of weight changed
Ki,sK_{i,s}legs acting on iflags entered within each leg's period before s
blocks\text{blocks}20 sessions, 400 drawsthe bootstrap of the session differences for the chance interval

Hypothetical: nobody ran the strategy. A flag acts from the first session after its weekly report existed. Financing, borrowing and market impact are not modelled.

A

Measure index · 59

Every measure and its formula
MeasureGroupFormula
CloseClosePrice & returnsFinal price of the session
1-day return1DPrice & returnsclose[t] / close[t−1] − 1
1-week return1WPrice & returnsclose[t] / close[t−5] − 1
1-month return1MPrice & returnsclose[t] / close[t−21] − 1
3-month return3MPrice & returnsclose[t] / close[t−63] − 1
6-month return6MPrice & returnsclose[t] / close[t−126] − 1
12-month return12MPrice & returnsclose[t] / close[t−252] − 1
Trend classificationTrendTrend & momentumUptrend: close > SMA50 > SMA200 · Downtrend: close < SMA50 < SMA200 · otherwise Mixed
Distance from SMA50vs SMA50Trend & momentumclose / SMA50 − 1
Distance from SMA200vs SMA200Trend & momentumclose / SMA200 − 1
Momentum20Mom20Trend & momentumclose[t] / close[t−20] − 1
12-1 month momentum12-1MTrend & momentumclose[t−21] / close[t−252] − 1
Trend t-statistic (63d)Trend tTrend & momentumt-ratio of b in ln(close) = a + b·time, OLS over 63 sessions
Trend slope (63d, annualized)SlopeTrend & momentum252 × b from the same regression
Trend fit R²R²Trend & momentumR² of the 63-session log-price regression
RSI(14)RSITrend & momentum100 − 100 / (1 + avg gain / avg loss), Wilder smoothing, 14 sessions
MACD histogram (% of price)MACD hTrend & momentum(MACD − signal) / close; MACD = EMA12 − EMA26, signal = EMA9 of MACD
ADX(14)ADXTrend & momentumWilder average of DX = 100 × |+DI − −DI| / (+DI + −DI)
20-day relative performanceRS20Relative strengthMomentum20(company) − Momentum20(BENCH)
63-day relative performanceRS63Relative strength3-month return − BENCH 3-month return
126-day relative performanceRS126Relative strength6-month return − BENCH 6-month return
Relative-strength level (z)RS lvl zRelative strength(ln(close/BENCH)[t] − mean) / sd over the trailing 126 sessions
Relative-strength momentum (Δz, 10d)RS momRelative strengthRS level z[t] − RS level z[t−10]
Volatility20Vol20Volatility, drawdown & losssd(20 log returns, denominator 19) × √252
Volatility60Vol60Volatility, drawdown & losssd(60 log returns) × √252
Yang-Zhang volatility (20d)YZ20Volatility, drawdown & lossσ²_overnight + k·σ²_open-close + (1−k)·σ²_RS, k = 0.34 / (1.34 + (n+1)/(n−1))
Parkinson volatility (20d)Park20Volatility, drawdown & loss√( mean(ln(H/L)²) / (4 ln 2) × 252 )
EWMA volatilityEWMAVolatility, drawdown & lossσ²[t+1] = 0.94·σ²[t] + 0.06·r²[t]
GARCH(1,1) next-session volatilityGARCHVolatility, drawdown & lossh[t+1] = ω + α·ε²[t] + β·h[t], Gaussian MLE on 504 returns, variance targeting
GARCH persistence (α + β)α+βVolatility, drawdown & lossα + β from the fitted GARCH(1,1)
Volatility20 percentile (1y)Vol pctlVolatility, drawdown & lossPercentile of Volatility20 within its own trailing 252 readings
ATR(14) % of priceATR %Volatility, drawdown & lossWilder average true range / close
Below 252-day closing highDD252Volatility, drawdown & lossclose / max(closes t−251…t) − 1
Maximum drawdown (1y)MaxDDVolatility, drawdown & lossmin over the year of close / running peak − 1
Ulcer index (126d)UlcerVolatility, drawdown & loss√ mean(drawdown%²) over 126 sessions
1-day 95% VaR (historical)VaR95Volatility, drawdown & loss−5th percentile of the latest 252 daily log returns
1-day 97.5% expected shortfallES97.5Volatility, drawdown & loss−mean of the worst 2.5% of the latest 252 daily log returns
Volume vs 20-day averageVol vs 20dVolume & levelsvolume[t] / mean(volume t−19…t) − 1
Volume z-score (60d)Vol zVolume & levels(ln V[t] − mean ln V) / sd ln V over the prior 60 sessions
Average dollar volume (20d)ADVVolume & levelsmean(close × volume) over 20 sessions
Amihud illiquidity (20d)AmihudVolume & levelsmean(|r| × 10⁴ / (dollar volume / 10⁶))
Up/down volume ratio (20d)U/D volVolume & levelsΣ volume on up closes / Σ volume on down closes
Position in 52-week rangeRange posVolume & levels(close − 52w low) / (52w high − 52w low)
Distance from 52-week highvs 52w HVolume & levelsclose / max(high, 252) − 1
Distance from 20-day VWAPvs VWAPVolume & levelsclose / (Σ typical × volume / Σ volume) − 1, typical = (H+L+C)/3
Bollinger %B%BVolume & levels(close − lower) / (upper − lower), 20 sessions, 2 population sd
Bandwidth percentile (126d)BW pctlVolume & levelsPercentile of (upper − lower) / middle within 126 sessions
Beta to benchmark (252d)BetaMarket & regime modelsOLS slope of r on r_BENCH over 252 sessions
Alpha (annualized, 252d)AlphaMarket & regime models252 × intercept of the market-model regression
Market-model R²R² mktMarket & regime modelsR² of r on r_BENCH
Residual volatilityResid σMarket & regime modelssd(regression residual) × √252
Downside betaβ downMarket & regime modelscov / var on sessions where BENCH fell
Upside betaβ upMarket & regime modelscov / var on sessions where BENCH rose
High-volatility regime probabilityP(hi-vol)Market & regime modelsFiltered P(state 2 | returns to t), two-state Gaussian HMM on 504 returns
Hurst exponent (R/S, corrected)HurstStatistical diagnostics0.5 + slope of ln(R/S) − ln E[R/S] on ln n, n = 8, 16, 32, 64 over 504 returns
Variance ratio VR(5)VR(5)Statistical diagnosticsVar(5-day returns) / (5 × Var(1-day returns)), overlapping
VR(5) robust zVR zStatistical diagnostics(VR − 1) / √(θ̂ / T), heteroskedasticity-consistent
ADF statistic (log price, 1y)ADFStatistical diagnosticst-ratio of γ in Δy = a + γ·y[t−1] + φ·Δy[t−1] + e
Lag-1 autocorrelationAC(1)Statistical diagnosticscorr(r[t], r[t−1]) over 252 sessions
B

Technical flag rules · 20

Close crossed SMA50 Trend & momentum
Sign change of close − SMA50 between consecutive sessions; touching the average is not a crossing.
SMA50 crossed SMA200 Trend & momentum
Sign change of SMA50 − SMA200 between consecutive sessions.
Trend classification changed Trend & momentum
Uptrend (close > SMA50 > SMA200), Downtrend (close < SMA50 < SMA200) or Mixed changed from the prior session. Repeats within three sessions are suppressed.
RSI(14) left the 30-70 band Trend & momentum
Wilder RSI(14) crossed above 70 or below 30.
MACD line crossed zero Trend & momentum
EMA12 − EMA26 changed sign.
ADX(14) rose above 25 Trend & momentum
Wilder ADX(14) crossed above 25, the conventional threshold for a directional move.
20-day relative performance crossed zero Relative strength
Momentum20 minus the benchmark's Momentum20 changed sign (the report-sample definition).
Entered a relative-strength quintile extreme Relative strength
Cross-sectional percentile of 63-day relative performance entered the top (≥ 80th) or bottom (≤ 20th) quintile of coverage.
Volatility20 above its 90th percentile Volatility & drawdown
Close-to-close Volatility20 crossed above the 90th percentile of its own trailing 252 readings.
Volatility20 below its 10th percentile Volatility & drawdown
Volatility20 crossed below the 10th percentile of its own trailing 252 readings.
Session move beyond 3 EWMA standard deviations Volatility & drawdown
|log return| exceeded 3 × the prior session's RiskMetrics EWMA daily volatility (λ = 0.94).
Crossed 20% below the 252-day high Volatility & drawdown
Close / max(closes, 252 sessions) − 1 crossed −20% in either direction.
Bollinger bandwidth at a 126-session low Volatility & drawdown
Bandwidth (upper − lower) / middle of the 20-session, 2σ bands set a 126-session low. Repeats within five sessions are suppressed.
New 252-session closing high Volume & levels
Close at or above every close of the prior 251 sessions, first occurrence in five sessions.
New 252-session closing low Volume & levels
Close at or below every close of the prior 251 sessions, first occurrence in five sessions.
Volume anomaly Volume & levels
z-score of ln(volume) against the prior 60 sessions reached 2.5 or more.
Close outside the Bollinger bands Volume & levels
Close moved from inside to outside the 20-session, 2σ Bollinger bands.
Kalman beta shift Market model
State-space (Kalman) beta to the benchmark moved by more than 0.25 over 20 sessions.
Benchmark regime change Coverage & benchmark
Filtered probability of the high-volatility state in the benchmark's two-state HMM (refitted each week-end on data to that date) crossed 50%.
Breadth crossed 50% Coverage & benchmark
Share of covered companies closing above their SMA50 crossed 50%.
C

Monitoring rules · 8

Relative-strength deterioration
30-session relative performance = the company's 30-session log return less the benchmark's. Its percentile rank among covered companies at the week-end is compared with the rank 4 weeks earlier; the rule fires when it has fallen by at least 45 points and ends in the bottom third of coverage.
Relative-strength improvement
The same measure as relative-strength deterioration; the rule fires when the percentile rank has risen by at least 50 points over 4 weeks and ends in the top third of coverage.
Unusually high volatility
Annualised close-to-close volatility over 20 sessions is ranked against its own trailing 252 readings. The rule fires when the rank at the week-end is at or above the 95th percentile and was below it at the previous week-end.
Drawdown beyond a set level
Drawdown = close divided by the highest close of the last 252 sessions, less one. The rule fires when the drawdown at the week-end is deeper than 20% and was not at the previous week-end.
Unusual volume
z-score of the natural log of volume against the mean and standard deviation of the prior 60 sessions. The rule fires when any session of the week reaches 2.8σ.
Trend change
Uptrend: close above its 50-session average, which is above its 200-session average; downtrend: the reverse; otherwise mixed. The rule fires when the classification at the week-end is an uptrend or downtrend, the previous week-end's was not, and the last defined trend before it was the opposite one. A move out of a mixed period in the same direction as before is not a change.
Company-specific return anomaly
A market model (the company's daily log return on the benchmark's) is fitted on the 126 sessions before each session. The rule fires when a session of the week has a residual of at least 3.8σ residual standard deviations.
Benchmark and sector disagree
30-session relative performance against the benchmark and against the equal-weight mean of same-sector peers have opposite signs, each at least 5% in size, at the week-end but not at the previous week-end. The two comparisons tell different stories about the same company.

Synthetic demonstration data: fictional companies and a generated benchmark, not market data and not a record of performance. Titan Edge publishes technical research for informational purposes only. Nothing on this site is investment advice or a recommendation to buy or sell any security.