NexusFi: Find Your Edge


Home Menu

 





Hurst Exponent


Discussion in Sierra Chart

Updated
    1. trending_up 1,148 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Hurst Exponent

  #1 (permalink)
steven8601
New York, NY
 
Posts: 5 since Feb 2017
Thanks Given: 0
Thanks Received: 7

here is a code snippet that implements the Hurst Exponent in Mathematica with 2 different implementations

rets = Differences[Log[FinancialData["^GSPC",All,"Value"]]];

RescaledRange[List_,n_] :=
Mean[Map[Sqrt[n] (Max[Accumulate[#]]-Min[Accumulate[#]]) / Sqrt[Total[#^2]]&,
Map[#-Mean[#] &, Table[List[i,,i+n]], {i,1,Length[List]-n}]]]];

Hurst[data_,lag_] := h/.FindFit[Table[RescaledRange[data,n],{n,2,lag}], {c*x^h}, {c,h}, x];
Hurst[rets, 16]


Hursttq[data_,lag_] := Fit[Log@Table[RescaldRange[data,n], {n,2,lag}], {1,Log[x]}, x] [[2]] [[1]];
Hursttq[rets, 32]

anybody want to implement this code into C++ for SierraChart?

The idea is to calc Hust at every closing price for a range of lags (i think 16-->128 would be ideal), which yields 112 results of Hurst Exponents for each closing price. Then take the avg of those Hust exponents to give you an AvgHustStrength study.

Another option is to output all 112 results, each as a colored pixel on a vertical line. (so the study has a vertical line for every price bar...where each vertial line is a stack of colored pixels, based on the Hurst Exponents)
0 = Blue
0.5 =white
1 = Red
and in-between results are progressively lighter shades of blue or red.

So, a price series with high concentrations of Red = trend is becoming unstable and should be ending (signal to fade)...while a series with a high concentration of blue should be preparing to break out of the recent range (signal to go with a breakout).

Reply With Quote




Last Updated on February 20, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts