Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Auto Fib Extension & Retrace for Amibroker (AFL)
Automatically generate Fibonacci retracements and up to 5 Extensions at each swing point or just the last one.
Screenshots
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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | _SECTION_BEGIN ( "Auto Fib Ext&Retrace" ); // // TimingPundit.com // 4/14/2022 // Based on Candle body. I found this slightly better than tails // and much better than closing price. // Mode= ParamList ( "Retrace and/or Extensions" , "Both|Retracements|Extensions" ); FibLines= ParamToggle ( "Fib Lines Shown" , "All|Last" ,1); FibLabels= ParamToggle ( "Label Fibs?" , "No|Yes" ,1); SPWidth= param ( "Swing Point Width" ,9,7,13,2); //suggest 7,9,13 arrows= ParamToggle ( "Swing POint Arrows" , "No|Yes" ,1); NE= Param ( "Number of Extensions" ,1,1,5,1); HV=HighestVisibleValue( H ); LV=LowestVisibleValue( L ); ymin=LV-.05*(hv-lv); ymax=HV+.05*(hv-lv); SetChartOptions (1,0,chartGridMiddle,ymin,ymax); HB= Max ( C , O ); LB= Min ( C , O ); sp1=sp2=0; sph = (HB== HHV (HB,SPWidth)) AND (HB== Ref ( HHV (HB,SPWidth),SPWidth-1)); spl = (LB== LLV (LB,SPWidth)) AND (LB== Ref ( LLV (LB,SPWidth),SPWidth-1)); fibmult1=.236; fibmult2=.382; fibmult3=.5; fibmult4=.618; fibmult5=.786; fibmult6=1; fibmult7=1.272; fibmult8=1.618; fibmult9=2.618; txt1= NumToStr (fibmult1); txt2= NumToStr (fibmult2); txt3= NumToStr (fibmult3); txt4= NumToStr (fibmult4); txt5= NumToStr (fibmult5); txt6= NumToStr (fibmult6); txt7= NumToStr (fibmult7); txt8= NumToStr (fibmult8); txt9= NumToStr (fibmult9); ////// Eliminates 2 SPL or 2 SPH in a row. Picks most extreme ///////// lasti=0; for (i=0;i<= BarCount -1;i++){ if (sph[i] AND sph[lasti]){ if (HB[i]>HB[lasti]){ sph[lasti]=0; } else { sph[i]=0; } } if (spl[i] AND spl[lasti]){ if (LB[i]<LB[lasti]){ spl[lasti]=0; } else { spl[i]=0; } } if (sph[i] OR spl[i]) lasti=i; } /////////////////////////////////////////////////////////////////////////////////////// LB1=HB1=fib1=fib2=fib3=fib4=fib5=fib6=fib7=fib8=fib9= Null ; Lastfib=B=S=range=i=m=0; function SetFibs(){ if (sph[i] OR spl[i]){ fib1[i]=B+S*range*FibMult1; fib2[i]=B+S*range*FibMult2; fib3[i]=B+S*range*FibMult3; fib4[i]=B+S*range*FibMult4; fib5[i]=B+S*range*FibMult5; fib6[i]=B+S*range*FibMult6; fib7[i]=B+S*range*FibMult7; fib8[i]=B+S*range*FibMult8; fib9[i]=B+S*range*FibMult9; } fib1[i+1]=fib1[i]; fib2[i+1]=fib2[i]; fib3[i+1]=fib3[i]; fib4[i+1]=fib4[i]; fib5[i+1]=fib5[i]; fib6[i+1]=fib6[i]; fib7[i+1]=fib7[i]; fib8[i+1]=fib8[i]; fib9[i+1]=fib9[i]; if (fib1[i]!=fib1[i-1]){ lastfib=i; if (FibLabels AND NOT fiblines){ PlotText (txt1,i,fib1[i], colorblack , colorDefault ); PlotText (txt2,i,fib2[i], colorblack , colorDefault ); PlotText (txt3,i,fib3[i], colorblack , colorDefault ); PlotText (txt4,i,fib4[i], colorblack , colorDefault ); PlotText (txt5,i,fib5[i], colorblack , colorDefault ); PlotText (txt6,i,fib6[i], colorblack , colorDefault ); PlotText (txt7,i,fib7[i], colorblack , colorDefault ); PlotText (txt8,i,fib8[i], colorblack , colorDefault ); PlotText (txt9,i,fib9[i], colorblack , colorDefault ); } fib1[i]= Null ; fib2[i]= Null ; fib3[i]= Null ; fib4[i]= Null ; fib5[i]= Null ; fib6[i]= Null ; fib7[i]= Null ; fib8[i]= Null ; fib9[i]= Null ; } } function PlotFibs(){ if (fiblabels AND fiblines){ PlotText (txt1,LastFib,fib1[lastfib+1], colorblack , colorDefault ); PlotText (txt2,LastFib,fib2[lastfib+1], colorblack , colorDefault ); PlotText (txt3,LastFib,fib3[lastfib+1], colorblack , colorDefault ); PlotText (txt4,LastFib,fib4[lastfib+1], colorblack , colorDefault ); PlotText (txt5,LastFib,fib5[lastfib+1], colorblack , colorDefault ); PlotText (txt6,LastFib,fib6[lastfib+1], colorblack , colorDefault ); PlotText (txt7,LastFib,fib7[lastfib+1], colorblack , colorDefault ); PlotText (txt8,LastFib,fib8[lastfib+1], colorblack , colorDefault ); PlotText (txt9,LastFib,fib9[lastfib+1], colorblack , colorDefault ); } if (FibLines){ for (i=0;i<lastfib;i++){ fib1[i]= Null ; fib2[i]= Null ; fib3[i]= Null ; fib4[i]= Null ; fib5[i]= Null ; fib6[i]= Null ; fib7[i]= Null ; fib8[i]= Null ; fib9[i]= Null ; } } Plot (fib1,txt1, colorLightBlue ); Plot (fib2,txt2, colorLightBlue ); Plot (fib3,txt3, colorLightBlue ); Plot (fib4,txt4, colorRed ,4); Plot (fib5,txt5, colorLightBlue ); Plot (fib6,txt6, colorRed ,4); Plot (fib7,txt7, colorbrightgreen ); Plot (fib8,txt8, colorbrightgreen ,4); Plot (fib9,txt9, colorbrightgreen ); } if (Mode== "Both" OR Mode== "Retracements" ){ ///////////// Retracements //////////////////// m=1; for (i=1;i< BarCount -1;i++){ if (sph[i]){ B=HB1=HB[i]; S=-1; range=(HB1-LB1); } if (spl[i]){ B=LB1=LB[i]; S=1; range=(HB1-LB1); } SetFibs(); } PlotFibs(); } if (mode== "Both" OR Mode== "Extensions" ){ ////////////////// Extensions ////////////////// n=0; S=1; for (i=1;i< BarCount -1;i++){ if (sph[i]){ n++; sp2=sp1; sp1=HB[i]; delta[n]=sp1-sp2; } if (spl[i]){ n++; sp2=sp1; sp1=LB[i]; delta[n]=sp1-sp2; } } for (j=1;j<=NE;j++){ n=0; for (i=1;i< BarCount -1;i++){ if (sph[i]){ n++; B=HB[i]; } if (spl[i]){ n++; B=LB[i]; } m=n-(j*2-1); if (m>0){ range=delta[m]; SetFibs(); } } PlotFibs(); } } /* BuyPrice=LB; SellPrice=HB; Buy=spl; Sell=sph; Cover=Buy; Short=Sell; */ if (arrows){ shape=spl* shapeUpArrow +sph* shapeDownArrow ; PlotShapes (shape, colorBlue ,0, IIf (spl, Low , High )); } _SECTION_END (); |
1 comments
Leave Comment
Please login here to leave a comment.
Back
V-Good afl