ET News & Sponsor Info
General Topics
Trading Instruments
Technical Topics
Brokerage Firms
Tools of the Trade
Trading for a Living
Community Lounge
Site Support

# Fractional dimension index

Discussion in 'Technical Analysis' started by dtrader98, Mar 28, 2007.

1. ### dtrader98

Anyone know how to derive the FDI?
Seems like a useful tool in latest S&C mag. However, I would also like to see longer term periods, and a greater assortment of stocks covered.

I get the basic part about trending/trading range vs. 1.5, but I am looking for specific formulas to derive the FDI and hurst param.

2. ### dtrader98

Ok, I have the basic formula.
R/S=(a*N)^H
FDI = 2 - H

Can anyone explain how to apply this formula to a real life stock? Say ebay or appl for example.

3. ### jficquette

Here is the code for tradestation for a Fractal Indicator.

[LegacyColorValue = true];

{ ************ 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 for Alex Matulich for pointing out this article
http://unicorn.us.com/ }

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

4. ### Volker Butzlaff

Hi,

because the FDI depends on the so-called Hurst exponent, this website (with a hurst exponent excel example) can help you to understand...

http://www.gummy-stuff.org/hurst.htm

This site of a canadian math prof. has also many other well and funny explained (excel) examples concerning investment and trading issues.

bye,
zentrader

5. ### dtrader98

Thanks for these replies.

I just read something in stocks and commodities that blew my mind about fractal generators. Almost makes elliot waves looks objective. Too bad elliot waves != fractals, although it's followers will eventually try to make the connection.

6. ### KS96

Iteration runs through N-1 values not N. It this correct?

7. ### KS96

After further investigation, I think this is the correct code
(not for tradestation, but it can easily get translated):

----------------------------------------------------------------------------------
if barindex >= N-1 then
Length = 0
PriceMax = highest[N](customclose)
PriceMin = lowest[N](customclose)
PriceRange = PriceMax-PriceMin

if PriceRange > 0 then
PriorDiff = (customclose[0] - PriceMin) / PriceRange
for i = 1 TO N -1 do
Diff = (customclose - PriceMin) / PriceRange
Length = Length + sqrt(square(Diff - PriorDiff) + (1/square(N)))
PriorDiff = Diff
next
endif

if Length > 0 then
FractalDim = 1 + (log(Length)+log(2)) / log(2*N)
else
FractalDim = FractalDim[1]
endif

else
FractalDim = undefined
endif

return FractalDim as "Fractal Dimension"
----------------------------------------------------------------------------------

For the Hurst exponent, do:
H = 2 - FractalDim

ET IS FREE BECAUSE OF THE FINANCIAL SUPPORT FROM THESE COMPANIES:
 24option Forex & CFD Trading AMP Global Clearing Futures and FX Trading GFF Brokers Low-Cost Futures Brokerage IC Markets True ECN for FX and CFDs Jigsaw Trading Advanced Trading Tools Lightspeed Trading Equities & Options Trading NinjaTrader Trading Software & Brokerage Optimus Futures Futures Trading Platforms and Order Routing Option Workshop Option Analysis Software PTMC Full Multi-Asset Trading Platform Rithmic Futures Trade Execution Platform SpreadProfessor Spread Trading Instruction TD Ameritrade Get the #1 trading app in the App Store TopstepTrader We Fund Traders TradersStudio System Development Platform Trading Technologies Trading Software Provider Tradovate Commision-Free Futures Trading