Fractal
Fractal was authored by Bill Williams. Fractal is a technical indicator where, in a series of at least 5 bars, the highest high (or lowest low) is in the middle, and two lower highs (or higher lows) are on both sides. The fractal indicator is often used in conjunction with the Alligator. The user may change only the strength value. This indicator’s definition is further expressed in the condensed code given in the calculation below.
How To Trade Using Fractal
Fractal may be used with the Alligator study. Signals are given according to the rules above.
How To Access in MotiveWave
Go to the top menu, choose Study>Bill Williams>Fractal
or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.
Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.
Calculation
//strength = user defined, default is 2
//MT = more than, LT = less than
//MOR= more or equal, LOR= less or equal
for(int i = 2; i LT; size()-2; i++) if (isComplete(i)) continue; h1 = getHigh(i-2); h2 = getHigh(i-1); h4 = getHigh(i+1); h5 = getHigh(i+2); high = getHigh(i); if (high MT h1 AND high LT h2 AND high MT h4 AND high MT h5) //check for next highest bars on each side lmax = Math.max(h1, h2); rmax = Math.max(h4, h5); if ((lmax MOR= h4 OR lmax MOR= h5) AND (rmax MOR= h1 OR rmax MOR= h2) ) addFigure(downArrow); ....//sell signal else l1 = getLow(i-2); l2 = getLow(i-1); l4 = getLow(i+1); l5 = getLow(i+2); low = getLow(i); if (low LT l1 AND low LT l2 AND low LT l4 AND low LT l5) //check for next lowest bars on each side lmin = Math.min(l1, l2); rmin = Math.min(l4, l5); if ((lmin LOR= l4 OR lmin LOR= l5) AND (rmin LOR= l1 OR rmin LOR= l2) ) addFigure(upArrow); //buy signal endIf endIf endIf endFor