Fractal Dimension Index - FDI

Category: Indicators By: Nicolas Created: April 15, 2016, 2:24 PM
April 15, 2016, 2:24 PM
Indicators
6 Comments

The Fractal Dimension Index is an indicator that measure the strength of a trend by determining the amount of volatility of the instrument. This indicator is already available in the platform but not available for custom coding in ProScreener or ProOrder. This version can resolve this issue.

 

N = 30

once fdi=undefined

if barindex >= n-1 then
 diff=0
 length = 0
 pdiff = 0
 hh=0
 ll=0
 FDI=0
 HH = highest[N](close)
 LL = lowest[N](close)

 for Period = 1 to N-1 do
  if (HH - LL) > 0 then
   diff = (customclose[Period] - LL) / (HH - LL)
    if Period > 1 then
     length = length + SQRT(SQUARE(diff - pdiff) + (1 / SQUARE(N)))
   endif
  pdiff = diff
 endif
next

 if length > 0 then
  FDI = 1 + (LOG(length) + LOG(2)) / LOG(2 * (N))
 else
  FDI = 0
 endif
endif

return FDI AS "Fractal Dimension Index"

 

Download
Filename: Fractal-Dimension-Index-PRC.itf
Downloads: 182
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...