Announcement

Collapse
No announcement yet.

Fractal Dimension

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fractal Dimension

    Jason

    I know you have looked at this at least once before and couldn't make it work but I was wondeing if you would consider taking a second look. Below is the TS ELD code which does seem to work and I thought it might be of some assistance.

    Let me know what you think.

    Regards
    Doug

    { ************ Program to Calculate Fractal Dimension of Waveforms
    Based on code by Carlos Sevcik,
    "A procedure to Estimate the Fractal Dimension of Waveforms",

    target="_blank">http://unicorn.us.com/</a> }

    Inputs:
    N ( 30 ) ;

    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) then
    begin
    Length = Length + SquareRoot( Square(Diff - PriorDiff) + (1 / Square(N)) ) ;
    end ;
    PriorDiff = Diff ;
    end ;
    end ;
    if Length > 0 then
    FractalDim = 1 + ( LOG( Length )+ LOG( 2 ) ) / LOG( 2 * ( N ) )
    else
    FractalDim = 0 ;
    Plot1( FractalDim ) ;

  • #2
    Doug
    You should be able to replicate in efs the same exact syntax used in the ela shown at the link you provided.
    The only differences that I can see are ymax for which you will use upperDonchian(length,close()) and ymin which will be lowerDonchian(length,close()). As to Square(value) you will use Math.pow(value,2)
    Try it out and if you have any problems post what you have done and someone may be able to help
    Alex

    Comment


    • #3
      Thanks Alex, I'll give it a shot.

      Doug

      Comment

      Working...
      X