code: def hurst_exponent(px, lags=range(2, 100)):
      
      ts = px.reset_index(drop=True).dropna()
      # Calculate the array of the variances of the lagged differences
      tau = [np.sqrt(ts.diff(lag).std()) for lag in lags]
      # Use a linear fit to estimate the Hurst Exponent
      poly = np.polyfit(np.log(lags), np.log(tau), 1)
      # Return the Hurst exponent from the polyfit output
      return poly[0] * 2.0
docs: describe the prices
      http://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing
      H = the hurts exponent
      H < 0.5 - mean reverting
      H = 0.5 - geometric brownian motion (aka random)
      H > 0.5 - trending series