Hurst Exponent - NinjaTrader Programming | futures io social day trading
futures io futures trading


Hurst Exponent
Updated: Views / Replies:10,450 / 19
Created: by vegasfoster Attachments:2

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 2  
 
Thread Tools Search this Thread
 

Hurst Exponent

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

Reply With Quote
 
  #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.

 
  #3 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received


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)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #4 (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


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

Reply With Quote
The following 3 users say Thank You to fluxsmith for this post:
 
  #5 (permalink)
Elite Member
Orlando, Florida
 
Futures Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Favorite Futures: ES
 
Posts: 56 since Aug 2010
Thanks: 3 given, 66 received

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

Reply With Quote
The following 2 users say Thank You to MooreTech for this post:
 
  #6 (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


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

Reply With Quote
 
  #7 (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

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
Register to download File Type: zip jhlHurstMACD.zip (10.4 KB, 130 views)
Reply With Quote
The following user says Thank You to fluxsmith for this post:
 
  #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.)

Reply With Quote
 
  #9 (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


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,

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.

Reply With Quote
 
  #10 (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


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
Register to download File Type: zip jhlHurstExponent.zip (8.3 KB, 198 views)

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

Reply



futures io > > > > > Hurst Exponent

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     


All times are GMT -4. The time now is 06:59 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.13 seconds with 19 queries on phoenix via your IP 54.90.92.204