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

[amibroker] Indicator Builder - If on Daily chart = x, but on Weekly = y



PureBytes Links

Trading Reference Links

Hi Johsun,

Unfortunately when pasting your code, I have some errors in the 
Indicator Builder.

Hope this could help you.

Regards,

Odda




johsun wrote:

>Is the Chaos exponent the same as the Hurst Exponent?
>
>Looking at this site:
>
>http://www.iqnet.cz/dostal/CHA2.htm
>
>they look very similar.
>
>In that case, with assistance from this text:
>
>http://unicorn.us.com/trading/src/_FractalDim.txt
>
>it might be coded like this:
>
>//-----------------------------------------
>Len=20;//lookback period
>y=Avg;// price array
>ymin=LLV(y,Len);
>ymax=HHV(y,Len);
>yscl=ymax-ymin;
>x=dy=0; 
>dx2=(1/(Len-1))^2;
>for(i=Len;i<BarCount;i++)
> {
> for(j=1;j<Len;j++)
>  {
>  dy=Nz((y[i-j]-y[i-j-1])/yscl[i]);
>  x[i]=x[i]+sqrt(dx2+dy^2);
>  }
> }
>fd=1+(log(x)+log(2))/log(2*(Len-1));
>Hurst=2-fd;
>
>Plot(Hurst,"Hurst",colorGreen,styleLine);
>PlotGrid(0.5);
>
>Filter=1;
>AddColumn(Hurst,"",1.4);
>//--------------------------------------------
>
>
>Regards,
>Johan
>
>
>
>
>
>
>--- In amibroker@xxxxxxxxxxxxxxx, Odda <swinger9@xxxx> wrote:
>  
>
>>Hi,
>>
>>Here is the "Chaos Exponent" written in Easy Language.
>>
>>Might anybody translate it into AFL ?
>>
>>Many thanks in advance,
>>
>>Odda
>>
>>(Note : the default length is 20 and a 0.5 line must be added)
>>
>>
>>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((h+c+l)/3, 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;
>>ChaosExp = Log(Rng/(k * Scale)) / Log(Len);
>>    
>>
>
>
>
>
>
>Check AmiBroker web page at:
>http://www.amibroker.com/
>
>Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
>Yahoo! Groups Links
>
>
>
> 
>
>
>  
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/