[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Re: Hurst Constant



PureBytes Links

Trading Reference Links

I had been looking at the code and here it is one that it works. However, the LIM is just a horizontal line.
 
Does anyone knows how to use it? Rather than searching the web, I will appreciate a brief explanation.
 
Bars:=600;
FR1:=Log(Sum(Abs(C-Ref(C,-1)),Bars));
FR2:=Log(Sum(If((Cum(1)/2-Int(Cum(1)/2))=0,Abs(C-Ref(C,-2)),0),Bars));
FR3:=Log(Sum(If((Cum(1)/3-Int(Cum(1)/3))=0,Abs(C-Ref(C,-3)),0),Bars));
FR4:=Log(Sum(If((Cum(1)/4-Int(Cum(1)/4))=0,Abs(C-Ref(C,-4)),0),Bars));
FR5:=Log(Sum(If((Cum(1)/5-Int(Cum(1)/5))=0,Abs(C-Ref(C,-5)),0),Bars));
FR6:=Log(Sum(If((Cum(1)/6-Int(Cum(1)/6))=0,Abs(C-Ref(C,-6)),0),Bars));
FR10:=Log(Sum(If((Cum(1)/10-Int(Cum(1)/10))=0,Abs(C-Ref(C,-10)),0),Bars));
FR20:=Log(Sum(If((Cum(1)/20-Int(Cum(1)/20))=0,Abs(C-Ref(C,-20)),0),Bars));
FR30:=Log(Sum(If((Cum(1)/30-Int(Cum(1)/30))=0,Abs(C-Ref(C,-30)),0),Bars));
FR40:=Log(Sum(If((Cum(1)/40-Int(Cum(1)/40))=0,Abs(C-Ref(C,-40)),0),Bars));
FR50:=Log(Sum(If((Cum(1)/50-Int(Cum(1)/50))=0,Abs(C-Ref(C,-50)),0),Bars));
FR60:=Log(Sum(If((Cum(1)/60-Int(Cum(1)/60))=0,Abs(C-Ref(C,-60)),0),Bars));
SOMXY:=FR2*Log(2)+FR3*Log(3)+FR4*Log(4)+FR5*Log(5)+FR6*Log(6)+FR10*Log(10)+FR20*Log(20)+FR30*Log(30) +FR40*Log(40)+FR50*Log(50)+FR60*Log(60);
SOMX:=Log(2)+Log(3)+Log(4)+Log(5)+Log(6)+Log(10)+Log(20)+Log(30)+Log(40)+Log(50)+Log(60);
SOMY:=FR1+FR2+FR3+FR4+FR5+FR6+FR10+FR20+FR30+FR40+FR50+FR60;
SOMX2:=(Power(Log(2),2))+(Power(Log(3),2))+(Power(Log(4),2))+(Power(Log(5),2))+(Power(Log(6),2))+(Power(Log(10),2))+(Power(Log(20),2))+(Power(Log(30),2))+(Power(Log(40),2))+(Power(Log(50),2))+(Power(Log(60),2));
HURST:=1+((12*SOMXY-SOMX*SOMY)/(12*SOMX2-Power(SOMX,2)));
LIM:=LastValue(Cum(HURST)/(Cum(1)-Bars-60));
HURST;
LIM;

mgf_za_1999 <no_reply@xxxxxxxxxxxxxxx> wrote:
Does this compile in MS?  Seems from FR2 onwards there is a bracket
too many.

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com

--- In equismetastock@xxxxxxxxxxxxxxx, "Jose Silva" <josesilva22@xxxx>
wrote:
> > Bars:= 600;
>
> Try:
>
> Bars:=LastValue(Min(600,LastValue(Cum(1))));
>
>
> jose '-)
> http://metastocktools.com
>
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "formulaprimer"
> <formulaprimer@xxxx> wrote:
> > This indicator is an interesting study in chaos theory.
> > Just look up the title in any web search engine and start
> > reading. This indicator is fails to calculate for some stocks. It
> > requires at least 600 hundred quotes to work.
> > Can someone fix the coding so it will work for MS.
> > Thanks.
> > Kev
> >
> > ======================
> > Hurst Constant
> > ======================
> >
> > Bars:= 600;
> > FR1:= Log(Sum(Abs( C - ref(C,-1)),Bars));
> > FR2:= Log(Sum(IF((cum(1)/2 - Int(Cum(1)/2)), 0,Abs(C - ref(C,-
> > 2)),0,Bars));
> > FR3:= Log(Sum(IF((cum(1)/3 - Int(Cum(1)/3)), 0,Abs(C-ref(c,-
> > 3)),0),Bars));
> > FR4:= Log(Sum(IF((cum(1)/4 - Int(Cum(1)/4)), 0,Abs(C-ref(c,-
> > 4)  ),0),Bars));
> > FR5:= Log(Sum(IF((cum(1)/5 - Int(Cum(1)/5)) ,0,Abs( C - Ref(C,-
> > 5)  ),0),Bars));
> > FR6:= Log(Sum(IF(  (cum(1)/6 - Int(Cum(1)/6)) ,0,Abs( C - ref(C,-
> > 6)),0),Bars));
> > FR10:= Log(Sum(IF((cum(1)/10 - Int(Cum(1)/10)) ,0,Abs(C - ref(C,-
> > 10)  ),0),Bars));
> > FR20:= Log(Sum(IF((cum(1)/20 - Int(Cum(1)/20)) ,0,Abs(C - ref(C,-
> > 20) ),0),Bars));
> > FR30:= Log(Sum(IF((cum(1)/30 - Int(Cum(1)/30) ),0,Abs(C - ref(C,-
> > 30)  ),0),Bars));
> > FR40:= Log(Sum(IIF(  (cum(1)/40 - Int(Cum(1)/40) ),0,Abs(C - ref
> (C,-
> > 40)  ),0),Bars));
> > FR50:= Log(Sum(IF(  (cum(1)/50 - Int(Cum(1)/50) ),0,Abs( C - ref
> (C,-
> > 50) ),0),Bars));
> > FR60:= Log(Sum(IF(  (cum(1)/60 - Int(Cum(1)/60) ),0,Abs(C - ref(C,-
> > 60)  ),0),Bars));
> > SOMXY:= FR2*Log(2)+FR3*Log(3)+FR4*Log(4)+FR5*Log(5)+FR6*Log(6)
> > +FR10*Log(10)+FR20*Log(20)+FR30*Log(30)+FR40*Log(40)+FR50*Log(50)
> > +FR60*Log(60);
> > SOMX:= Log(2)+Log(3)+Log(4)+Log(5)+Log(6)+Log(10)+Log(20)+Log(30)
> +Log
> > (40)+ Log(50)+Log(60);
> > SOMY:= FR1+FR2+FR3+FR4+FR5+FR6+FR10+FR20+FR30+FR40+FR50+FR60;
> > SOMX2:= (Power(Log(2),2))+(Power(Log(3),2))+(Power(Log(4),2))+
> (Power
> > (Log(5),2))+(Power(Log(6),2)) +(Power(Log(10),2))+(Power(Log
> (20),2))+
> > (Power(Log(30),2))+(Power(Log(40),2))+(Power(Log(50),2))+ (Power
> (Log
> > (60),2));
> > HURST:= 1+((12*SOMXY-SOMX*SOMY)/(12*SOMX2 -  Power(SOMX ,2 )));
> > LIM:= LastValue(Cum(HURST)/(Cum(1)-Bars-60));
> > HURST;
> > LIM;
> >
> > ========================
> > END
> > ========================


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


YAHOO! GROUPS LINKS