Skip to content

Latest commit

 

History

History
209 lines (144 loc) · 3.95 KB

File metadata and controls

209 lines (144 loc) · 3.95 KB

Methodology equations

This page records the main formulas used or assumed by the project. Symbols are written in portfolio/backtesting notation so the equations can be cited from the README, experiment logs, or presentation material.

Price and Return Accounting

Single-period simple return:

$$R_{i,t} = \frac{P_{i,t}}{P_{i,t-1}} - 1$$

Log return:

$$r_{i,t} = \log(P_{i,t}) - \log(P_{i,t-1})$$

Five-session next-open holding return used by the weekly target:

$$r^{(5)}_{i,t} = \log\left(\frac{O_{i,t+6}}{O_{i,t+1}}\right)$$

Delisting-adjusted total return:

$$R_{total} = (1 + R_{regular})(1 + R_{delisting}) - 1$$

This equation is included for the future CRSP/WRDS or equivalent licensed-data upgrade. The current public-data pipeline does not have complete delisting returns, so missing delisting effects remain a stated limitation.

Residual Rank Target

Sector residual return:

$$\epsilon_{i,t} = r^{(5)}_{i,t} - \bar{r}^{(5)}_{s(i),t}$$

where (s(i)) is the sector assigned to ticker (i), and (\bar{r}^{(5)}_{s(i),t}) is the same-period average forward return of that sector.

Cross-sectional residual rank target:

$$y_{i,t} = \operatorname{rank}_{i \in U_t}(\epsilon_{i,t})$$

The implementation uses cross-sectional ranks so the model learns relative winner selection rather than unconstrained expected returns.

Rank Model Diagnostics

Daily Spearman rank information coefficient:

$$IC_t = \rho_{Spearman}(\hat{y}_{i,t}, y_{i,t})$$

Mean rank IC:

$$\overline{IC} = \frac{1}{T}\sum_{t=1}^{T} IC_t$$

Positive IC rate:

$$\text{Positive IC Rate} = \frac{1}{T}\sum_{t=1}^{T}\mathbf{1}(IC_t > 0)$$

Top-(K) excess forward return:

$$\Delta R^{topK}_t = \frac{1}{K}\sum_{i \in TopK_t} R_{i,t+1} - \frac{1}{|U_t|}\sum_{i \in U_t} R_{i,t+1}$$

Top-minus-bottom spread:

$$S^{K}_t = \frac{1}{K}\sum_{i \in TopK_t} R_{i,t+1} - \frac{1}{K}\sum_{i \in BottomK_t} R_{i,t+1}$$

Portfolio Return

Gross portfolio return:

$$R^{gross}_{p,t} = \sum_{i \in H_t} w_{i,t} R_{i,t}$$

Net portfolio return after costs:

$$R^{net}_{p,t} = R^{gross}_{p,t} - C_t$$

Turnover:

$$TO_t = \frac{1}{2}\sum_i |w_{i,t} - w_{i,t-1}|$$

Transaction-cost approximation:

$$C_t = \sum_i |\Delta w_{i,t}| \cdot c^{variable} + \frac{N^{trades}_t \cdot c^{fixed}}{AUM_t}$$

where (c^{variable}) includes spread and slippage assumptions, and (c^{fixed}) is the per-order fixed fee.

Performance Metrics

Cumulative return:

$$R^{cum}_{p,T} = \prod_{t=1}^{T}(1 + R^{net}_{p,t}) - 1$$

Annualized CAGR:

$$CAGR = \left(1 + R^{cum}_{p,T}\right)^{\frac{N_{year}}{T}} - 1$$

Annualized volatility:

$$\sigma_{ann} = \sqrt{N_{year}} \cdot \operatorname{std}(R^{net}_{p,t})$$

Sharpe ratio:

$$Sharpe = \frac{N_{year}\cdot \operatorname{mean}(R^{net}_{p,t} - R_{f,t})} {\sqrt{N_{year}}\cdot \operatorname{std}(R^{net}_{p,t} - R_{f,t})}$$

Maximum drawdown:

$$MDD = \min_t\left(\frac{V_t}{\max_{\tau \le t} V_\tau} - 1\right)$$

Active return versus benchmark:

$$A_t = R^{net}_{strategy,t} - R^{net}_{benchmark,t}$$

Information ratio:

$$IR = \frac{N_{year}\cdot \operatorname{mean}(A_t)} {\sqrt{N_{year}}\cdot \operatorname{std}(A_t)}$$

Fama-French Attribution

Three-factor excess-return regression:

$$R_{p,t} - R_{f,t} = \alpha + \beta_m (R_{m,t} - R_{f,t}) + \beta_s SMB_t + \beta_v HML_t + \varepsilon_t$$

The project uses this for attribution and diagnostics. The FF3 target replacement experiment improved point estimates but failed its replacement gates, so FF3 remains an attribution tool rather than the active target.

Pair Trading

Spread with hedge ratio (\beta):

$$z_t = P^A_t - \beta P^B_t$$

Rolling spread z-score:

$$Z_t = \frac{z_t - \mu_{z,t}}{\sigma_{z,t}}$$

The pair sleeve remains disabled unless cointegration, stability, confidence-bound, random-pair, and execution gates pass under a frozen contract.