Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Fractal Fib Levels for Amibroker (AFL)
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
Indicator / Formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | /*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