Skewness

Windowed · default period 20Statistics

The Skewness node computes the Fisher skewness coefficient (3rd standardized moment) of the rolling window. Positive skew means a longer right tail (occasional large gains relative to the center); negative skew means a longer left tail (occasional large losses). Negative skewness in returns is a warning sign — many momentum strategies suffer from left-skewed distributions. Requires at least 3 non-null values.

Algorithm

  • μ = mean(vals), σ = population_std(vals)
  • skewness = Σ ((v − μ) / σ)³ / n
  • Returns 0 when σ = 0
  • Requires ≥ 3 non-null values; returns null otherwise

Parameters

NameTypeDefaultDescription
periodnumber20Rolling window size. Minimum 3.

Inputs & Outputs

PortTypeDescription
Inputs
inputnumber[]Source numeric array
Outputs
valuesnumber | nullComputed value at each bar; null before the warmup period completes
timestampsnumber[]Bar timestamps (UNIX ms), aligned 1-to-1 with values
Live mode: In live streaming mode the node updates only the last bar in-place rather than recalculating the full array, keeping CPU usage minimal during real-time data feeds.

Use Cases

Return Distribution Quality

Monitor rolling skewness on returns. Negative and worsening skewness warns that strategy returns are developing a crash-prone profile even if Sharpe appears stable.

Mean vs. Median Divergence

Large positive skewness means mean > median (right-skewed); large negative means mean < median. Use this to decide whether Average or Median is the better central tendency measure.

Options Bias

Assets with negative skew in returns tend to be systematically overpriced for out-of-the-money puts (crash insurance). Use rolling skewness to time entry into long-put positions.