Fractal Trading System While there are many definitions for a fractal in securities trading, the definition used in these systems is a minor version of the type defined by Bill Williams, Ph.D., and his chaos-based trading methods. According to Bill Williams, an "up fractal" is defined as a middle bar with two lower highs on each side of it. A "down fractal" would be the reverse being a middle bar with two higher lows on each side of it. This system is based on a very small fraction of Bill Williams’ complete trading system. The system enters a long position when a price crosses above the most recent up fractal. The position would be exited and a short position entered when the price crosses below the most recent down fractal. ---------------------------- Up Level and Down Level Fractals} F1:=ValueWhen(1,HRef(L,-2) AND Ref(L,-1)>Ref(L,-2) AND Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2)); {Cross Up and Down Level Fractal} a:= Cross(H,F1); b:= Cross(F2,L); state:= BarsSince(a) Ref(state,-1); {Trend Up and Down} UpTrend:= state>0; DownTrend:= state<1; {OpenBuy and CloseBuy} OpenBuy:= LongSignal and (eventCount('OpenBuy')=eventCount('CloseBuy')); CloseBuy:= ShortSignal and (eventCount('OpenBuy')>eventCount('CloseBuy')); {OpenSell and CloseSell} OpenSell:= ShortSignal and (eventCount('OpenSell')=eventCount('CloseSell')); CloseSell:= LongSignal and (eventCount('OpenSell')>eventCount('CloseSell')); ------------------------------------------------------------------- functions : 1.valuwhen This Accumulation/Distribution formula uses the cum() function (see Cumulate ) to keep a running total of the daily values. cum( (((C-L) - (H-C)) / (H-L)) * V) 2.Ref References a previous or subsequent element in a DATA ARRAY. A positive PERIOD references "n" periods in the future; a negative PERIOD references "n" periods ago. 3. cross Plots a "+1" on the day that DATA ARRAY 1 crosses above DATA ARRAY 2. Otherwise, "0" is plotted. If you want to know when DATA ARRAY 1 crosses below DATA ARRAY 2, use the formula "cross( DATA ARRAY 2, DATA ARRAY 1)"