Page 1 of 1

Hurst Exponent

Posted: Jan 13 2010
by LTG
Does anyone have this indicator to share? I'm currently using w/ MT and find it quite useful.

Thx

Posted: Jan 13 2010
by PioTrek
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);

Posted: Jan 13 2010
by PioTrek
Attached a Hurst Channel indicator as well. Not sure if either are what you are in search of. Good luck.

Posted: Jan 13 2010
by LTG
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)

Posted: Jan 13 2010
by TJ
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,
please see the 1st post in this thread:
http://forum.tssupport.com/viewtopic.php?t=6929

Posted: Jan 13 2010
by LTG
TJ - thanks, got the function to load. What am I missing for the indicator?

Posted: Jan 13 2010
by TJ
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.



Image

Posted: Jan 13 2010
by LTG
Never mind - got it. Thanks all.

Posted: Jan 14 2010
by PioTrek
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.

Posted: Jan 15 2010
by Spaceant
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

Posted: Mar 09 2010
by Spaceant
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

Posted: Mar 09 2010
by TJ
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.

Posted: Mar 09 2010
by Spaceant
Mine doesn't update in a realtime chart on HSIH10 now...

Why is that?

Posted: Mar 09 2010
by TJ
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.

Posted: Mar 10 2010
by Spaceant
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

Posted: Mar 10 2010
by TJ
I am using MC v6 b2.

I am using the code straight from the post.

Posted: Mar 10 2010
by Spaceant
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?

Posted: Mar 10 2010
by TJ
how many data series do you have on the chart?

what are the resolutions?

do you have other indicators? are they updating?

Posted: Mar 10 2010
by TJ
oops... mine is not updating either.
let me take a look at it tomorrow.

Posted: Mar 11 2010
by Spaceant
TJ,

Do you have time to have a look at this?

Posted: Mar 11 2010
by TJ
sorry, no time to study it yet.

Posted: Mar 27 2010
by Spaceant
Anyone whocan help resolving why the indicator doesn't update in realtime chart?

Sa

Re: Hurst Exponent

Posted: Aug 12 2010
by FHTrader
Hi TJ or anyone,

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

Thanks!

Re:

Posted: Aug 12 2010
by sptrader
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.
**Yes, Clyde was an expert in cycle analysis, unfortunately, Clyde passed away a few months ago, Clyde and his research, will be greatly missed by traders around the World.