DinexSpace Return Skewness and Kurtosis
- Indicatori
- Versione: 1.0
DinexSpace Return Skewness and Kurtosis is an indicator for MetaTrader 5 (MT5) that describes the shape of the recent returns. For the last N closed bars it shows the skewness (is one side heavier?) and the excess kurtosis (are the tails fatter than a normal curve?). It describes a window of the past; it does not forecast.
The formulas
- Returns: r = ln(Close / previous Close), for the last N closed bars (100 by default).
- With mean m and central moments m2, m3, m4 of the window:
- Skewness = m3 / m2^1.5. Above 0 the larger moves in the window were up; below 0 they were down.
- Excess kurtosis = m4 / m2^2 − 3. Above 0 the tails are fatter than a normal curve; below 0 they are thinner. A normal curve gives 0.
- The moments are those of the window itself, with no small-sample correction. If the returns of the window do not vary, the value is left empty.
What you get
- A choice of display: skewness (the default), excess kurtosis, or both divided by their noise size so they share one scale. Dotted lines at zero and at the size of the noise.
- Panel on the chart: both values, the window length and the rough size of the noise of a window this long (2 × √(6/N) for skewness, 2 × √(24/N) for kurtosis). The panel text changes colour when a value is outside that noise.
- Two windows if you want them: attach the indicator twice, once set to skewness and once to excess kurtosis. Each gets its own scale.
- Closed bars only. The number of bars calculated is an input. No alerts and no objects other than the panel.
How to use it
- Copy DinexReturnMoments.ex5 to MQL5\Indicators, or find it in the Navigator under Indicators > Market.
- Drag it onto a chart and choose the window length.
- Read the lines and the panel.
Checked
A test Expert Advisor reads the indicator buffers on every new bar in the Strategy Tester and compares each value with a separate calculation from power sums, on EURUSD H1 and GBPUSD M15 with the three display settings and with different window lengths. It prints the number of checks and the number of failed checks.
Notes
- Short windows are noisy: with 30 returns, skewness and kurtosis of a normal sample often move by about ±0.9 and ±1.8. Use the panel noise figures.
- Skewness and kurtosis describe the window that has just passed. They do not tell you what the next bars will do, and they give no entries or exits.
Requirements
- MetaTrader 5, any symbol and timeframe.
