Under construction This website is currently being rebuilt. Content is provisional — messages are welcome at any time. kontakt@jkhd.de

// Mathematics

What we calculate with.

This page names the methods our systems stand on — and for each one it says what it is good for and where it misleads. All of it is in the textbooks. What we build out of it is in none of them.

// Foundation

Statistics: the language in which everything is measured.

Without these quantities there is no statement about a strategy — only opinions about a curve.

Expected value & variance
Var(X) = E[X²] − E[X]²

The expected value is the probability-weighted average; the variance measures the dispersion around it. The square root of the variance is the standard deviation — in trading called volatility.

What for: the foundation for everything that follows: the expected value of a trade, risk measurement, every metric.

Covariance & correlation
ρ(X,Y) = Cov(X,Y) / (σX · σY)

Measures whether two quantities move together, normalised to −1 to +1.

What for: two signals that in truth bet on the same thing are not a portfolio. Careful: correlation captures only linear relationships and is unstable over time — which is why it is computed on a rolling basis, never once across the whole history.

Autocorrelation
ρk = Cov(rt, rt−k) / Var(rt)

The correlation of a time series with itself, shifted by k periods.

What for: the most direct test for predictability. Positive means momentum at that frequency, negative means mean reversion. Trap: at tick level it is almost always negative — that is not a signal but the bouncing between bid and ask.

Log returns
rt = ln( Pt / Pt−1 )

Logarithmic returns add up over time; simple returns add up across positions.

What for: for time-series analysis and volatility estimation you take log returns, for portfolio arithmetic the simple ones. Whoever swaps them is quietly calculating the wrong thing.

// Volatility

How much does it move — and is it moving differently than usual?

Volatility is not a constant. It comes in waves, and anyone treating it as a fixed number is measuring their risk wrongly.

Square-root-of-time rule
σannual = σ · √N

Volatility scales with the square root of time; N is the number of periods per year.

Careful: strictly it holds only for uncorrelated returns. Within a trading day, with autocorrelation and quieter midday hours, it becomes inaccurate — you may know it, but not apply it blindly.

Realised volatility
RVt = Σ r²t,i

The sum of squared returns within a day, as an estimator of the daily variance.

What for: the best assumption-light estimator from high-frequency data. Limit: the finer you sample, the more accurate — until microstructure noise dominates and the accuracy tips back the other way.

EWMA
σ²t = λ·σ²t−1 + (1−λ)·r²t−1

Exponentially weighted volatility: new movements count for more, old ones fade away.

What for: recursive, a single state value per instrument, constant effort per bar. That is exactly why it suits a guard that has to run alongside live operation.

GARCH(1,1)
σ²t = ω + α·ε²t−1 + β·σ²t−1

Like EWMA, but with reversion to a long-run volatility. α is the reaction to shocks, β the inertia.

What for: it describes what every trader knows: quiet phases stay quiet, wild ones stay wild. The basis for forecasts over several periods and for regime detection.

// Evaluation & risk

What a result is worth — and what it may cost.

Sharpe and Sortino ratio
SR = ( E[R] − Rf ) / σ

Excess return per unit of risk. Sortino counts only downside deviations as risk — upside swings are not penalised.

Careful: a Sharpe ratio taken from hindsight is almost always too high. Why, is in the next section.

Drawdown & Calmar
DDt = ( Pt − maxs≤t Ps ) / maxs≤t Ps

The distance from the previous high of the equity curve; the worst of them is the maximum drawdown.

What for: on accounts with a loss limit, the remaining drawdown buffer is the real risk budget — not the account size. Position sizes follow that, not the nominal capital.

Expected loss in the worst case
ESα = −E[ R | R ≤ −VaRα ]

Value at Risk says which loss threshold is rarely exceeded. Expected shortfall says how bad it gets when it is exceeded.

What for: the second figure is the more honest one. A limit that knows only the threshold says nothing about the day it falls.

Kelly criterion
f* = ( p·b − (1−p) ) / b

The fraction of capital that maximises long-run logarithmic growth.

What for: as a theoretical upper bound — and only that. Full Kelly is never staked: the parameters are estimates, the tails of the distribution are fatter than assumed, and where there is a loss limit it is not Kelly that binds but the limit.

Covariance matrix & allocation
σ²p = wᵀ Σ w

The risk of several positions is not the sum of the individual risks — the relationships decide.

Careful: inverting an estimated covariance matrix amplifies estimation error massively. In practice one uses shrinkage methods, risk parity, or simply a volatility target per signal instead of a full optimisation.

// The most important part

Mathematics against your own self-deception.

Test a hundred variants and you are guaranteed to find good ones — by chance alone. This section is the reason why most candidates die here.

Correction for multiple testing
pcorrected = f( p, number of trials )

Every additional test raises the probability of finding something good purely by chance. The correction charges the number of trials against the result.

Condition: the trials have to be counted honestly — the discarded ones too, and last week's as well. Whoever cheats here only cheats themselves.

Deflated Sharpe ratio
PSR(SR*) = Φ( … n, skewness, kurtosis … )

The probability that the true Sharpe ratio lies above a benchmark — corrected for sample length, skewness and kurtosis of the distribution. That benchmark is the Sharpe ratio one would expect by chance simply from testing many variants.

What for: after Bailey and López de Prado. It answers the only correct question: is the result better than what chance delivers anyway across that many trials?

Reality Check
H0: maxk E[fk] ≤ 0

A test after White that examines the entire search as a whole: is the best candidate found better than the best from pure noise would be?

What for: the difference between “this signal looks good” and “this signal is better than chance”.

Separate periods
Searching ≠ confirming

The search runs on one period, the confirmation on another that stays untouched during the search.

Limit: this protection wears out too. The same confirmation period loses meaning with every test — which is why we count how often it has already been used.

// Processes & simulation

Models for randomness — as a yardstick, not as truth.

No model describes the market. But a model gives a yardstick against which you can measure whether a result is remarkable.

Geometric Brownian motion
dS = μ·S·dt + σ·S·dW

The standard model for price paths: constant drift, constant volatility, randomness via the Wiener process.

What for: as a benchmark and for generating synthetic paths. Limit: reality has jumps, volatility clusters and fatter tails — the model is a ruler, not a map.

Ornstein-Uhlenbeck
dX = θ·(μ − X)·dt + σ·dW

A process with a restoring force: the further the value is from the mean, the more strongly it is pulled back. θ determines how quickly.

What for: the clean mathematical picture behind the term “mean reversion” — and the basis for testing whether a series really does revert or only looks as though it does.

Itô's lemma
(dW)² = dt

The chain rule for random paths. The extra term with the second derivative exists because random paths are so rough that quadratic terms do not vanish.

What for: among other things it explains why fluctuation itself costs return — the same calculation from which option pricing follows.

Monte Carlo
Error ~ 1/√N

Many generated paths instead of a closed-form formula. Accuracy grows only with the square root of their number.

What for: distributions of outcomes instead of a single number — in particular for the question of how deep a drawdown can get by chance alone.

// Microstructure & execution

Between signal and market is where the return is lost.

These quantities decide whether an idea survives in operation — and they are missing from most backtests.

Bid-ask spread
Spread = ask − bid

The gap between buying and selling price. Whoever wants to trade immediately pays it.

What for: on fine time scales the spread is often larger than the expected edge. The idea is then mathematically right and economically dead.

Execution deviation
Slippage = fill − signal price

The difference between the price at which the decision was made and the price at which the trade actually happened.

What for: it belongs in the calculation, not in the footnote. A system tested without it has not been tested.

Market impact
Impact ~ √( order size / volume )

Your own order moves the price. The relationship is not linear but flattens off — typically as a square root.

What for: it caps the capacity of a strategy. A method that works with a small stake need not work with a large one.

Conditional probability
P(A|B) = P(B|A) · P(A) / P(B)

Bayes' theorem: how an assessment must change when a new observation arrives.

What for: the clean form of the question everyone asks: how much weight may I give this one observation, knowing how rare it is anyway?

What is deliberately not here: everything on this page is textbook knowledge — you will find it in any good library. What is not here is the actual work: which of these methods we combine, in which order, with which parameters, on which time scales and with which thresholds. That is precisely where an edge lives — and it is why we gladly explain the how of our approach, but not the what of our signals.

Questions about the methodology?

We talk openly about methods — including the ones that failed here.

Get in touch How a system is built