Moments describe the shape features of a distribution. There are four essential Moments: Mean, Variance, Skewness, Kurtosis . The Moments of returns can provide a comprehensive view of the tendency, volatility , and risk of the market . It's important for traders to know these statistical properties of the instrument before trading them.
Library to calculate Hurst Exponent refactored from Hurst Exponent - Detrended Fluctuation Analysis
demean(src) Calculates a series subtracted from the series mean.
src : The series used to calculate the difference from the mean (e.g. log returns).
Returns: The series subtracted from the series mean
Based on Moments (Mean,Variance,Skewness,Kurtosis) . Rewritten for Pinescript v5.
logReturns(src) Calculates log returns of a series (e.g log percentage change)
src : Source to use for the returns calculation (e.g. close).
Returns: Log percentage returns of a series
mean(src, length) Calculates the mean of a...