Hurst Exponent
 Updated: February 20th, 2017 (12:13 PM) Views / Replies: 10,450 / 19 Created: August 14th, 2010 (03:48 AM) by vegasfoster Attachments: 2

 Welcome to futures io.

2

# Hurst Exponent

 August 14th, 2010, 03:48 AM #1 (permalink) Elite Member las vegas   Futures Experience: Intermediate Platform: Sierra Chart Broker/Data: Velocity/IB Favorite Futures: 6E   Posts: 1,147 since Feb 2010 Thanks: 304 given, 836 received Hurst Exponent For grits and shins I am trying to replicate Richard’s HurstMacd, but the programming is beyond my skills. I need to do the following, with Close[0] simply representing whatever data series that is to be fed into it:Mean.Set( SMA( Close[0], Period) ); Deviation1.Set( Close[0] – Mean[0] ); Deviation2.Set( Close[1] – Mean[0] ); Deviation3.Set( Close[2] – Mean[0] ); Etc. from 4 to Period Sum1.Set( Deviation1[0] ); Sum2.Set( Deviation1[0] + Deviation2[0] ); Sum3.Set( Deviation1[0] + Deviation2[0] + Deviation3[0] ); Etc. from 4 to Period Difference.Set( Max(Sum data series) – Min(Sum data series) ); As you can see I need the Deviation and Sum data series to be self replicating based upon how many periods there are and then calculate the min and max of those figures. Anyone know how to do that? Thanks.

 August 14th, 2010, 03:48 AM #2 (permalink) Quick Summary Quick Summary Post Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

Rennes France

Broker/Data: IB/Kinetick
Favorite Futures: Futures

Posts: 3,366 since Jun 2009

Maybe an array of a structure which will contains all "Period" elements ?

Code
 ``` ``` #region variables private struct Hurst_struct {  public DataSeries deviation;  public DataSeries sum;  public Hurst_struct(DataSeries d, Dataseries s) {   deviation = d;   sum = s; } } private Hurst_struct[] _H; ... protected override void Initialize() {  _H = new Hurst_struct[Period]; ... protected override void OnBarUpdate() {  Mean.Set(SMA( Close[0], Period));   _H[0].deviation = Close[0] – Mean[0];   for (int i=1;i

Not tested.

 Success requires no deodorant! (Sun Tzu)
 The following user says Thank You to sam028 for this post:

Elite Member
Santa Maria

Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES

Posts: 295 since May 2010

vegasfoster
 For grits and shins I am trying to replicate Richard’s HurstMacd, but the programming is beyond my skills.....

Never heard of it, but I'll have what you describe programmed and posted for you today, just so I can see what it looks like ;-)

 The following 3 users say Thank You to fluxsmith for this post:

Elite Member
Orlando, Florida

Favorite Futures: ES

Posts: 56 since Aug 2010

I've never heard of it either, but based on what you provided, I think this should do the trick.

Code
 ```if (CurrentBar

 The following 2 users say Thank You to MooreTech for this post:

Elite Member
las vegas

Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E

Posts: 1,147 since Feb 2010

fluxsmith
 Never heard of it, but I'll have what you describe programmed and posted for you today, just so I can see what it looks like ;-)

Sorry, that's not the complete calculation, just the part I was having trouble with, here is the link to an explanation of the whole thing. Thanks for everyone's help.

Hurst Exponent

Elite Member
Santa Maria

Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES

Posts: 295 since May 2010

I'm very interested in this, please post more information. Using google I've learned about the Hurst Exponent, which this does not appear to be, but I haven't been able to find anything about a Hurst MACD. If I haven't made an error then the attached implements the code you asked for, but it doesn't appear to be a useful plot. Was that a fragment of the calculation?

(Thanks for the link above, your post beat mine ;-), I'll look at that and work on it some more)

Attached Files
 The following user says Thank You to fluxsmith for this post:

 August 14th, 2010, 11:52 AM #8 (permalink) Elite Member Santa Maria   Futures Experience: Advanced Platform: NinjaTrader, ThinkOrSwim Broker/Data: Mirus/Zen-Fire Favorite Futures: ES   Posts: 295 since May 2010 Thanks: 101 given, 320 received Is your end goal the Hurst Exponent, where < .5 => mean reverting, == .5 => random, > .5 => trending? Or is the Hurst Exponent just a component of some kind of MACD plot that's the end goal? (I guess 'Hurst MACD' in the first post still has me confused.)

Elite Member
las vegas

Futures Experience: Intermediate
Platform: Sierra Chart
Broker/Data: Velocity/IB
Favorite Futures: 6E

Posts: 1,147 since Feb 2010

fluxsmith
 Is your end goal the Hurst Exponent, where < .5 => mean reverting, == .5 => random, > .5 => trending? Or is the Hurst Exponent just a component of some kind of MACD plot that's the end goal? (I guess 'Hurst MACD' in the first post still has me confused.)

Wow, that was fast. Look at post 6 and this is my end goal,

https://futures.io/platforms-indicators/2698-multicharts-multicharts-multicharts-16.html#post32978

I am assuming that he is feeding the MACD into the filter and plotting the result with an offset to eliminate the lag and line it up with the prior data, then projecting the future plot in his mind. But I won't know until it is fully programmed. I am slow, so I was figuring the programming part would take me a couple weeks. Now it should only take me a week or so to finish using what you have given me, unless...

Thanks a bunch.

Elite Member
Santa Maria

Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES

Posts: 295 since May 2010

I reviewed the video and have to admit that I still don't know what a Hurst MA or a Hurst MACD is, but I think I've correctly come up with a Hurst Exponent indicator. I found it easier to first come up with a Fractal Dimension indicator and the infer the Hurst Exponent from that.

Revised: Solved a divide by 0 error when min(Close, n) == max(Close, n)

Attached Files

Last edited by fluxsmith; August 14th, 2010 at 07:57 PM.
 The following 4 users say Thank You to fluxsmith for this post:

Upcoming Webinars and Events (4:30PM ET unless noted)

Elite only

Elite only

Jan 18

Jan 23

Elite only