# Hurst Exponent

Questions about MultiCharts and user contributed studies.
LTG
Posts: 30
Joined: 08 Sep 2009

### Hurst Exponent

Does anyone have this indicator to share? I'm currently using w/ MT and find it quite useful.

Thx

PioTrek
Posts: 11
Joined: 01 Dec 2009
Has thanked: 1 time
Have this in my library...
Hurst Coefficient

Code: Select all

```Inputs: Len(Numeric); Vars: Mean(0), j(0), k(1.253314), SumSqr(0), Scale(0), MaxY(0), MinY(0), Rng(0); Arrays: X[100](0), Y[100](0); Mean = Average(C, Len); SumSqr = 0; for j = 0 to Len - 1 begin X[j] = C[j] - Mean; SumSqr = SumSqr + X[j] * X[j]; end; Scale = SquareRoot(SumSqr / Len); Y[0] = X[0]; MaxY = X[0]; MinY = X[0]; for j = 1 to Len - 1 begin Y[j] = Y[j - 1] + X[j]; if Y[j] > MaxY then MaxY = Y[j]; if Y[j] < MinY then MinY = Y[j]; end; Rng = MaxY - MinY; Hurst = Log(Rng/(k * Scale)) / Log(Len);```
Last edited by PioTrek on 13 Jan 2010, edited 1 time in total.

PioTrek
Posts: 11
Joined: 01 Dec 2009
Has thanked: 1 time
Attached a Hurst Channel indicator as well. Not sure if either are what you are in search of. Good luck.
Attachments
Hurst Channel - Clyde Lee.txt

LTG
Posts: 30
Joined: 08 Sep 2009
Piotrek - thanks. I was able to find the same code but no luck in getting it to compile. Hopefully someone has a compiled version or can help with the code.

When trying to compile, the follow errors appear:

Commentary end is expected before end of file
errLine 29, errColumn 33, errLineEnd 29, errColumnEnd 33
causal study: (Function)

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
Piotrek - thanks. I was able to find the same code but no luck in getting it to compile. Hopefully someone has a compiled version or can help with the code.

When trying to compile, the follow errors appear:

Commentary end is expected before end of file
errLine 29, errColumn 33, errLineEnd 29, errColumnEnd 33
causal study: (Function)

the first code is a function, not an indicator.

you have to compile it as a function, using "hurst" as the function name.

for further explanation of Functions,
http://forum.tssupport.com/viewtopic.php?t=6929

LTG
Posts: 30
Joined: 08 Sep 2009
TJ - thanks, got the function to load. What am I missing for the indicator?

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
TJ - thanks, got the function to load. What am I missing for the indicator?
I am not sure what you mean.

The Hurst indicator (2nd code posted by PioTrek) compiles and works ok.

p.s. the 1st function code is not needed for the 2nd indicator code.

Attachments
Hurst.gif
Hurst Channel

LTG
Posts: 30
Joined: 08 Sep 2009
Never mind - got it. Thanks all.

PioTrek
Posts: 11
Joined: 01 Dec 2009
Has thanked: 1 time
The 2nd Hurst code I posted is work from Clyde Lee. He is considered by many an expert in this particular space. Recommend you examine his work. Another would be Brian Millard and his channel analysis techniques.

Best of luck.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
The 2nd Hurst code I posted is work from Clyde Lee. He is considered by many an expert in this particular space. Recommend you examine his work. Another would be Brian Millard and his channel analysis techniques.

Best of luck.
I haev done a search on Hurst. There is a web here http://www.theswingmachine.com/index2.htm

The Hurst Band or the "Edge Band Trading Opportunities" looks interesting.

Is there any manual to use the indicators or reference that we can look at apart from the book mentioned in the front part of the indicator?

Sa

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
TJ,

Why the second indicator doesn't update in a realtime chart (MC6.0 beta2)? Your chart seems updating in a realtime chart.

Did I do anything wrong?

Sa

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
TJ,

Why the second indicator doesn't update in a realtime chart (MC6.0 beta2)? Your chart seems updating in a realtime chart.

Did I do anything wrong?

Sa

I think it updates at the end of bar.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
Mine doesn't update in a realtime chart on HSIH10 now...

Why is that?
Attachments
HSIH10.png

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
Mine doesn't update in a realtime chart on HSIH10 now...

Why is that?
I have just tested it on HSIH10,
it is updating ok.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
Mine doesn't update in a realtime chart on HSIH10 now...

Why is that?
I have just tested it on HSIH10,
it is updating ok.
TJ,

Strange, mine doesn't update. I have checked that the Format Study \ Properties in which "Update on every tick is checked.

Did you make any change on the Inputs? What version of MC are you using?

Sa

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
I am using MC v6 b2.

I am using the code straight from the post.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
I am using MC v6 b2.

I am using the code straight from the post.
Same as what I am using.... strange!!

Do you know what could cause this happening to me?

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
how many data series do you have on the chart?

what are the resolutions?

do you have other indicators? are they updating?

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
oops... mine is not updating either.
let me take a look at it tomorrow.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
TJ,

Do you have time to have a look at this?

TJ
Posts: 7459
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2138 times
sorry, no time to study it yet.

Spaceant
Posts: 253
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times
Anyone whocan help resolving why the indicator doesn't update in realtime chart?

Sa

Posts: 38
Joined: 24 Feb 2010

### Re: Hurst Exponent

Hi TJ or anyone,

So would someone please post the complete code for this indicator?

Thanks!

Posts: 719
Joined: 09 Apr 2010