Loading…

Rolling Skewness And Kurtosis

Volatility indicators answer "how big are moves lately". They do not answer "are moves lately lopsided" or "are moves lately fat-tailed compared with normal". Those are the two questions this indicator answers directly: rolling skewness (asymmetry - is the distribution of recent returns stretched further to the upside or the downside) and rolling excess kurtosis (tail weight - how much more likely are large moves in either direction than a normal distribution with the same standard deviation would predict). A market that turns sharply negative-skewed is one where the downside tail has become fatter than the upside - the classic pre-drawdown signature in many instruments. A rise in excess kurtosis on its own, independent of skew, says large surprises of either sign have become more likely than the recent standard deviation alone would suggest, which matters directly for stop placement and position sizing even when the mean and variance both look ordinary. The formulas used are the plain population third and fourth standardised moments, not the small-sample bias-corrected estimators found in statistics textbooks. That difference only matters materially on very short windows; this indicator is meant as a live shape gauge traders can glance at, not a publishable academic estimate, and the simpler formula is stated here rather than left for the user to discover by comparing numbers against a spreadsheet. Notes and limitations - Uses population moments, not bias-corrected sample estimators; on short windows (well under InpPeriod = 30) the readings will run somewhat noisier than a textbook sample-corrected formula. - A near-zero variance window (a dead-flat run of closes) is left blank rather than dividing by a near-zero standard deviation. - High kurtosis flags that large moves are more likely than a normal distribution predicts; it does not say which direction the next large move will be. - This does not size a position, place a stop, or generate trade signals.

Indicator · MT5 · v1.0 · Free

About Rolling Skewness And Kurtosis

Rolling Skewness And Kurtosis is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Period, Skew alert level and Kurt alert level. MQL source code included.

Files in the download: RollingSkewKurtosis.ex5, RollingSkewKurtosis.mq5, RollingSkewKurtosis.txt.

Settings

SettingDefaultWhat it does
Period60Returns in the rolling window
Skew alert level1.0|Skew| beyond this fires an alert
Kurt alert level3.0Excess kurtosis beyond this fires an alert (fat tails)
AlertstrueAlert once per closed bar when a level is newly crossed

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria