Does anyone have this indicator to share? I'm currently using w/ MT and find it quite useful.
Thx
Hurst Exponent
Have this in my library...
Hurst Coefficient
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 Jan 13 2010, edited 1 time in total.
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
- (3.35 KiB) Downloaded 1421 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)
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: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 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,
please see the 1st post in this thread:
http://forum.tssupport.com/viewtopic.php?t=6929
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
I am not sure what you mean.TJ - thanks, got the function to load. What am I missing for the indicator?
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
- (20.74 KiB) Downloaded 2932 times
I haev done a search on Hurst. There is a web here http://www.theswingmachine.com/index2.htmThe 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.
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
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 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.
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
I have just tested it on HSIH10,Mine doesn't update in a realtime chart on HSIH10 now...
Why is that?
it is updating ok.
TJ,I have just tested it on HSIH10,Mine doesn't update in a realtime chart on HSIH10 now...
Why is that?
it is updating ok.
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: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
I am using MC v6 b2.
I am using the code straight from the post.
I am using the code straight from the post.
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
how many data series do you have on the chart?
what are the resolutions?
do you have other indicators? are they updating?
what are the resolutions?
do you have other indicators? are they updating?
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
oops... mine is not updating either.
let me take a look at it tomorrow.
let me take a look at it tomorrow.
- TJ
- Posts: 7776
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
sorry, no time to study it yet.
-
- Posts: 742
- Joined: Apr 09 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
**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.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.