Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Fractal Fib Levels for Amibroker (AFL)
sethmo
almost 10 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 2)
Tags:
amibroker, fractal

The formula calculates Fib Levels between fractals. The Fib Levels are worked out from the most recent fractal to the one before it. I can’t remember where I found the fractal algorith, but it’s one a few AFLs throughout the net. Thanks to the person/people who put it up there.

Screenshots

Similar Indicators / Formulas

elliott wave one and two exploration
Submitted by tsarvjit about 9 years ago
Trendlines
Submitted by empottasch about 11 years ago
Pentuple Exponential Moving Average
Submitted by extremist over 8 years ago
Interactive Linear Regression Channel
Submitted by InternetWorm almost 10 years ago
Williams Alligator System
Submitted by durgesh1712 almost 10 years ago
XTL - AG -4 AmiB
Submitted by ajmal017 almost 10 years ago

Indicator / Formula

Copy & Paste Friendly
/*Fractals and Fib Levels
by Ipeleng Molete
30 October 2011
*/

//Fractals
nbar = Param("Longer Term",16,2,10000,1);

PHigh = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) <= H;
PHighPrice = ValueWhen(PHigh,H);
PLow = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) >= L;
PLowPrice = ValueWhen(PLow,L); 

Bear = ValueWhen(PHigh, DateTime());
Bull = ValueWhen(PLow, DateTime());

PlotShapes(shapeSmallCircle*PLow,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*PHigh,colorRed,0,H,10);

//Plot(PLowPrice, "Fractal Low", colorGreen, styleDots | styleNoLine);
//Plot(PHighPrice, "Fractal High", colorRed, styleDots | styleNoLine);

phase = IIf(bull > bear, 0, 1);

//Fib Level Calculation
//If previous fractal was down fractal, then Fib Level is worked out
//by subtracting the down fractal from the up fractal and vice versa

HiLoDifference = IIf(phase == 0, PLowPrice - PHighPrice, PHighPrice - PLowPrice);

Level1 = abs(HiLoDifference)*0.382;
Level2 = abs(HiLoDifference)*0.5;
Level3 = abs(HiLoDifference)*0.618;
Level4 = abs(HiLoDifference)*0.786;
Level5 = abs(HiLoDifference)*1.0;
Level6 = abs(HiLoDifference)*1.618;
Level7 = abs(HiLoDifference)*2.618;

Level0382 = IIf(phase == 0, PLowPrice + Level1, PHighPrice - Level1);
Level05 = IIf(phase == 0, PLowPrice + Level2, PHighPrice - Level2);
Level0618 = IIf(phase == 0, PLowPrice + Level3, PHighPrice - Level3);
Level0786 = IIf(phase == 0, PLowPrice + Level4, PHighPrice - Level4);
Level10 = IIf(phase == 0, PLowPrice + Level5, PHighPrice - Level5);
Level1618 = IIf(phase == 0, PLowPrice + Level6, PHighPrice - Level6);
Level2618 = IIf(phase == 0, PLowPrice + Level7, PHighPrice - Level7);

//Graph

Plot(C, "", colorBlack, styleCandle | styleNoTitle);
Plot(Level0382,"38.6%=", colorOrange, styleDots | styleNoLine);
Plot(Level05,"50%=", colorPink, styleDots | styleNoLine);
Plot(Level0618,"61.8%=", colorPaleGreen, styleDots | styleNoLine);
Plot(Level0786,"78.6%=", colorLightGrey, styleDots | styleNoLine);
Plot(Level10,"1.0%=", colorBlack, styleDots | styleNoLine);
Plot(Level1618,"161.8%=", colorSkyblue, styleDots | styleNoLine);
Plot(Level2618,"261.8%=", colorPink, styleDots | styleNoLine);

Title = WriteIf(phase == 0, "BULL Phase", "BEAR Phase") + 
"\nSymbol: " + Name() + " Date: " + Date() + " Open: " + NumToStr(Open, 1.4) + " High: " + NumToStr(High, 1.4) +
" Low: " + NumToStr(Low, 1.4) + " Close: " + NumToStr(Close, 1.4) + 
EncodeColor(colorBlue) + "\nFractal Periods:    " + NumToStr(nbar, 1.0) +
EncodeColor(colorRed) + "\n\nLast Up Fractal:         " + NumToStr(PHighPrice, 1.4) + 
EncodeColor(colorGreen) + "\nLast Down Fractal:    " + NumToStr(PLowPrice, 1.4) +
EncodeColor(colorBlack) + "\nLevel0382: " + Level0382 +
EncodeColor(colorBlack) + "\nLevel05: " + Level05 +
EncodeColor(colorBlack) + "\nLevel0618: " + Level0618 +
EncodeColor(colorBlack) + "\nLevel786: " + Level0786 +
EncodeColor(colorBlack) + "\nLevel10: " + Level10 +
EncodeColor(colorBlack) + "\nLevel1618: " + Level1618 +
EncodeColor(colorBlack) + "\nLevel2618: " + Level2618; 

0 comments

Leave Comment

Please login here to leave a comment.

Back