Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Gann Trend for Amibroker (AFL)
// 2 bar Gann Trend Swing Chart
// Developed by DollarHeineken
// Contact me at dollarheineken@gmail.com
// Parameters allow you to choose bar/candle type and color intensity.
// And display of Bollinger band
//trend line beg
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | // 2 bar Gann Trend Swing Chart // Developed by DollarHeineken // Contact me at dollarheineken@gmail.com // Parameters allow you to choose bar/candle type and color intensity. // And display of Bollinger band //trend line beg SetBarsRequired (1000); BarLum1 = Param ( "Bar Color Intensity" , 8, 0, 10,01); UpBarColor = ColorBlend( ColorRGB (5,36,5), ColorRGB (10,75,10), BarLum1); DnBarColor = ColorBlend( ColorRGB (36,5,5), ColorRGB (75,10,10), BarLum1); BarColor = IIf ( Close > Open , UpBarColor, DnBarColor); SetBarFillColor (BarColor); stylecndl= ParamList ( "Bar or Candle chart?" , "Bar|Candle" ); Showboll= ParamList ( "Show Bollinger Bands" , "Yes|No" ); if (stylecndl== "Bar" )stylec= styleBar ; else stylec= styleCandle ; Plot ( C , "close" , colorWhite ,stylec); tline=tlinebs=barhi=barlo=beglo=beghi=endi=begi=0; for (i=1;i< BarCount ;i++) { if (i>=4) { //if (i>begi+1)PlotText(WriteVal(I>begi+1,1.0),i,H[i]+15,colorOrange); if ( H [i]> H [i-1] AND H [i-1]> H [i-2] AND i>beglo) { tline[i]= H [i]; barhi=1; barlo=0; prevhi=beghi; beghi=i; } if ( L [i]< L [i-1] AND L [i-1]< L [i-2] AND i>beghi) { tline[i]= L [i]; barlo=1; barhi=0; prevlo=beglo; beglo=i; } } if (i==beglo) { if (prevlo>beghi) { begi=prevlo; begval= L [prevlo]; endi=beglo;endval= L [beglo]; } else if (beghi>prevlo) { begi=beghi; begval= H [beghi]; endi=beglo;endval= L [beglo]; } } if (i==beghi) { if (prevhi>beglo) { begi=prevhi; begval= H [prevhi]; endi=beghi;endval= H [beghi]; } else if (beglo>prevhi) { begi=beglo; begval= L [beglo]; endi=beghi;endval= H [beghi]; } } if (endi-begi>1) { incr=(endval-begval)/(endi-begi); for (j=begi;j<=endi;j++) { tline[j]=begval+(j-begi)*incr; } } if (tline[i]==0)tline[i]= Null ; //trend line end } tline= IIf (tline>0,tline, Null ); Plot (tline, "Trendline" , colorWhite , styleLine ); if (showboll== "Yes" ) { _SECTION_BEGIN ( "Bollinger Bands" ); P = ParamField ( "Price field" ,-1); Periods = Param ( "Periods" , 15, 2, 300, 1 ); Width = Param ( "Width" , 2, 0, 10, 0.05 ); Color = ParamColor ( "Color" , colorCycle ); Style = ParamStyle ( "Style" ); Plot ( BBandTop ( P, Periods, Width ), "BBTop" + _PARAM_VALUES (), Color, Style ); Plot ( BBandBot ( P, Periods, Width ), "BBBot" + _PARAM_VALUES (), Color, Style ); _SECTION_END (); _SECTION_BEGIN ( "MA" ); P = ParamField ( "Price field" ,-1); Periods = Param ( "Periods" , 15, 2, 300, 1, 10 ); Plot ( MA ( P, Periods ), _DEFAULT_NAME (), ParamColor ( "Color" , colorCycle ), ParamStyle ( "Style" ) ); _SECTION_END (); } |
0 comments
Leave Comment
Please login here to leave a comment.
Back