Kurtosis
תוכן זה אינו זמין עדיין בשפה שלך.
Tail weight of the return distribution, as excess kurtosis: 0 is Gaussian, positive means fatter tails than normal. Financial returns are almost always positive here, which is precisely why volatility alone understates risk.
Signature
Kurtosis(period, on=<source>)| Argument | Type | Required | Notes |
|---|---|---|---|
period |
int Param or literal | Yes | Return window. Default 60, bounds 4–400. |
on= |
symbol, OHLCV field, or indicator | No | Source. Defaults to the trade symbol’s close. |
Formula
$$ \text{kurt} = \frac{m_4}{m_2^2} - 3 $$
on log returns; the −3 makes a normal distribution read 0.
Warmup
period + 1 bars; 0 until then.
Reading the value
ku.valueku.value > 3Example
class TailRiskGate(Strategy): """Size down when the tails are unusually heavy.""" trade = Symbol() sizing = FixedCapital()
def execute(self): ku = Kurtosis(60, on=self.trade) sma = SMA(50, on=self.trade) if ku.value < 3 and self.trade.close > sma.value and self.trade.is_flat: self.buy(self.trade, reason=f"Kurtosis {ku.value:.2f}") if ku.value > 6 and self.trade.is_long: self.sell(self.trade, self.trade.position, reason="Fat tails")Notes
- Proven by an assert-via-trade run on SPY daily (matched a strategy-side moment computation to 1e-3 on every bar; zero alarm trades).
- Excess kurtosis, population moments. Very sensitive to single outliers — one big day can dominate a 60-bar window.
- The moments are taken over log returns and are uncorrected (divided by
n); pandas_ta’skurtosis()applies the sample correction to the price series, so the two never agree.