Support Board
Date/Time: Fri, 01 Nov 2024 04:27:51 +0000
Post From: Hurst exponent study?
[2017-02-17 21:42:50] |
User71961 - Posts: 144 |
Is there a study in SC that displays the running estimated Hurst Exponent? (its kind of like RSI...but a little more complicated) Here is Python code to create the Hurst Exponent for the last value of a TimeSeries ts. If SC could call this function iteratively (including options for how many data points are in the rolling TimeSeries ts), then SC could output a study which shows the Hurst Exponent as it develops over time for any time series. from numpy import cumsum, log, polyfit, sqrt, std, subtract def hurst(ts): # Returns the Hurst Exponent of the time series vector ts # Create the range of lag values lags = range(2, 100) # Calculate the array of the variances of the lagged differences tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags] # Use a linear fit to estimate the Hurst Exponent poly = polyfit(log(lags), log(tau), 1) # Return the Hurst exponent from the polyfit output return poly[0]*2.0 If such a study does not exist, could it be added to SC? I suspect a lot of people would love to be able to see this study at the bottom of our charts... Date Time Of Last Edit: 2017-02-17 22:36:02
|