NexusFi: Find Your Edge


Home Menu

 





Hurst Exponent


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vegasfoster with 6 posts (0 thanks)
    2. looks_two fluxsmith with 5 posts (12 thanks)
    3. looks_3 Big Mike with 2 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (1 thanks)
    1. trending_up 18,584 views
    2. thumb_up 15 thanks given
    3. group 9 followers
    1. forum 20 posts
    2. attach_file 2 attachments




 
Search this Thread

Hurst Exponent

  #1 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

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.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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 dDataseries s) {
  
deviation d;
  
sum s; }
}
private 
Hurst_struct[] _H;
...

protected 
override void Initialize() {
 
_H = new Hurst_struct[Period];
...


protected 
override void OnBarUpdate() {
 
Mean.Set(SMAClose[0], Period));
  
_H[0].deviation Close[0– Mean[0];
  for (
int i=1;i<Period;i++) {
  
_H[i].deviation _H[i-1].deviation;
  
_H[i].sum         _H[i-1].deviation _H[i-1].deviation;
 }
... 

Not tested.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322


vegasfoster View Post
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 ;-)

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73

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

 
Code
if (CurrentBar<period)
    return;
            
double ma = SMA(Input,period)[0];
double[] deviation = new double[period];
double sum=0, min=double.MaxValue, max = double.MinValue;
for (int x=0;x<period;x++)
{
    deviation[x]=Input[x]-ma;
    sum+=deviation[x];
    max=Math.Max(max,sum);
    min=Math.Min(min,sum);
}
            
Difference.Set(max-min);

Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


fluxsmith View Post
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

Started this thread Reply With Quote
  #7 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322

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
Elite Membership required to download: jhlHurstMACD.zip
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322

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.)

Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


fluxsmith View Post
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,



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.

Started this thread Reply With Quote
  #10 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322


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
Elite Membership required to download: jhlHurstExponent.zip
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on September 20, 2018


© 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