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

[amibroker] FDI Indicator



PureBytes Links

Trading Reference Links

Hello!
Can same one convert this Easy Language (TradeStation) code for FDI indicator to Amibroker? :

inputs:
    FractalLength( 30 );
variables:
    FractalDimIndex( 0 );
FractalDimIndex = FDI( FractalLength ) ;

function: FDI
{ Program to Calculate Fractal Dimension of Waveforms.
Based on code by Carlos Sevcik, "A Procedure to Estimate the Fractal Dimension of Waveforms", see
http://www.csu.edu.au/ci/vol05/sevcik/sevcik.html .
Thanks to Alex Matulich for pointing out this article
http://unicorn.us.com/ }
inputs:
    N( numericsimple ) ;
variables:
     Diff( 0 ),
    Length( 0 ),
    PriceMax ( 0 ),
     PriceMin( 0 ),
    PriorDiff( 0 ),
    Iteration( 0 ),
    FractalDim( 0 ) ;
PriceMax = Highest( Close, N ) ;
PriceMin = Lowest( Close, N ) ;
Length = 0 ;
PriorDiff = 0 ;
for Iteration = 1 to N - 1
    begin
    if PriceMax - PriceMin > 0 then
        begin
        Diff = ( Close[Iteration] - PriceMin ) /
         ( PriceMax - PriceMin ) ;
        if Iteration > 1 AND N <> 0 then
            Length = Length + SquareRoot( Square( Diff -
             PriorDiff ) + ( 1 / Square( N ) ) ) ;
        PriorDiff = Diff  ;
        end ;
    end ;
if Length > 0 AND N <> 0 then
    FractalDim = 1 + ( log( Length )+ log( 2 ) ) / log( 2 * N )
else
    FractalDim = 0 ;
FDI =  FractalDim  ;
Regards, Boris.

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___