← drwnn.ai projects

Money_Hedge runs a market-neutral pair-trading book. The terms below are the building blocks of the strategy. Each definition links to the corresponding Wikipedia article for a deeper treatment.

Strategy & instruments

Pair trade (statistical arbitrage)

Long one asset and short another whose prices tend to move together, profiting from temporary divergences.

A pair trade simultaneously goes long one asset and short another whose prices historically move together. When their price relationship temporarily diverges, the trade bets the spread will revert to its long-run mean. Profit is the difference between the long leg gaining and the short leg falling (or both moving in the predicted direction).

Statistical arbitrage

A family of trading strategies that exploit short-term price inefficiencies using statistical models.

Statistical arbitrage groups dozens to hundreds of pair-like positions together so that idiosyncratic risk diversifies and only a small residual market exposure remains. The strategy depends on the statistical relationships continuing to hold, which is why ongoing cointegration testing matters.

Short selling

Selling borrowed shares now to buy them back later, profiting if the price falls.

The short leg of every pair trade. In paper trading there's no borrow fee or locate constraint, but a live broker (Alpaca, IBKR) charges interest and may refuse to locate hard-to-borrow names.

Statistical foundations

Cointegration

Two non-stationary price series whose linear combination is stationary (mean-reverting).

Individual stock prices generally trend (non-stationary). A cointegrated pair is one where some fixed combination of the two prices stays bounded around a constant — a property called stationarity. That stationary combination is the trade-able spread.

Engle-Granger test

A two-step statistical test for cointegration; the p-value measures how unlikely the relationship is by chance.

The Engle-Granger procedure regresses one price series on another, then tests whether the residuals are stationary using an augmented Dickey-Fuller test. A low p-value (typically < 0.05) gives evidence that the pair is genuinely cointegrated rather than spuriously correlated.

Mean reversion

The tendency of a series to return toward its long-run average.

The fundamental statistical bet of pair trading. If a pair is cointegrated, deviations from its mean spread are temporary. Trade decisions depend on z-score thresholds derived from the spread's historical mean and standard deviation.

z-score

Number of standard deviations a value is from its long-run mean.

Entry signals fire when |z| crosses 1.5; exits when |z| drops below 0.5 (mean reversion); stop-outs when |z| exceeds 3.0 (spread broke). The z-score normalizes across different spread scales so the same thresholds apply to any pair.

Half-life of mean reversion

How many days a spread takes to revert halfway to its mean after deviating.

Fit an AR(1) model to the spread: shorter half-life means faster reversion. Money_Hedge filters candidates to half-lives between 5 and 60 days — long enough that mean reversion is signal, short enough that the trade closes within a useful window.

Ordinary least squares (OLS)

Regression technique that minimizes squared residuals to fit a linear model.

Used twice in Money_Hedge: (1) computing each pair's hedge ratio from price-on-price regression, (2) computing each stock's market beta from returns-on-SPY-returns regression.

Risk and exposure

Market beta (β)

Sensitivity of a security's returns to the broad market's returns.

Computed via OLS regression of the asset's daily returns against the market index (SPY) returns. β = 1 means the asset moves 1-for-1 with the market; β = 0 means uncorrelated; β > 1 means amplified market exposure. A market-neutral portfolio targets |β| close to 0.

Volatility (annualized)

Standard deviation of daily returns, scaled to an annual horizon.

Volatility = std(daily_returns) × √252. The √252 scaling assumes returns are independent and identically distributed across the 252 trading days in a year. An 8% target means we expect the portfolio's annual return path to typically stay within ±8% of trend.

Drawdown

Peak-to-trough decline in portfolio value.

Measured as the percentage drop from the highest NAV ever observed to the current NAV. Money_Hedge reviews trading when drawdown crosses the soft limit (12% default) and auto-halts new opens entirely when it crosses the hard limit (18% default).

Gross and net exposure

Gross = total dollars at risk. Net = directional dollar exposure (long minus short).

Gross exposure is the sum of all long positions plus the absolute value of all short positions, as a percentage of NAV. Net exposure is long minus short. Stat-arb books typically have large gross (150-300% of NAV) but tight net (under ±10%) — exactly the regime Money_Hedge enforces.

Hedge ratio (β from OLS)

How many shares of the short leg neutralize one share of the long leg.

The hedge ratio is the slope from regressing leg A's price on leg B's. To get unit exposure to the spread, you hold 1 share of A long and β shares of B short (or vice versa). Money_Hedge sizes every pair in this β-neutral way so the position has minimal market exposure.

Portfolio accounting

Net asset value (NAV)

Current market value of all positions plus uninvested cash.

Computed daily as: starting AUM + realized P&L from closed trades + unrealized P&L from open positions marked to current prices. The NAV history drives the drawdown calculation and the realized-volatility metric.