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 ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Simple Pattern for Amibroker (AFL)
Copy & Paste Friendly
Back
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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | _SECTION_BEGIN ( "Chart Pattern Simple" ); Reentry = Re Breakout = Breakout TC = uptrend(1) OR downtrend(-1) Patterns AT(+1) = Ascending Triangle DT(-1) = Descending Triangle ST(+1) = Symmetrical Triangle ET(-1) = Extended Triangle RW(+1) = Rising Wedge FW(-1) = Falling Wedge ROC SL = daily ROC Support Line (SL) ROC RL = daily ROC Resistance Line (RL) */ Per = 1; V1 = 1.05; V2 = 1.01; Color_SL= colorRed ;Color_PHL= colorRed ; Color_RL= colorBlue ;Color_PLL= colorBlue ; DisRange = 15; x = Cum (1); s1= L ;s11= H ; PS = TroughBars (s1,per,1) == 0; xb = LastValue ( ValueWhen (PS,x,1)); xa = LastValue ( ValueWhen (PS,x,2)); yb = LastValue ( ValueWhen (PS,s1,1)); Ya = LastValue ( ValueWhen (PS,s1,2)); xab_log = log (yb/yA)/(xb-xa); SL = exp ((x-xb)*xab_log)*yb; RocSL = ROC (SL,1); PR1 = PeakBars (s11,per,1) == 0; Xd = LastValue ( ValueWhen (pR1,x,1 )); xc = LastValue ( ValueWhen (pR1,x,2 )); yd = LastValue ( ValueWhen (pR1,s11,1)); Yc = LastValue ( ValueWhen (pR1,s11,2)); xcd_log = log (yd/yc)/(xd-xc); RL = exp ((x-xd)*xcd_log)*yd; RocRL = ROC (RL,1); Low_Value = LastValue ( Ref ( LLV ( L ,xd-xc),-(x-xd))); x2 = LastValue ( ValueWhen ( L ==Low_Value & x>xc & x<xd,x)); PLL = IIf ( LastValue (x)-x2>5, exp ((x-x2)*xcd_log)*Low_Value,-1e10); Hi_Value = LastValue ( Ref ( HHV ( H ,xb-xa),-(x-xb))); x3 = LastValue ( ValueWhen ( H ==Hi_Value & x>xa & x<xb,x)); PHL = IIf ( LastValue (x)-x3>5, exp ((x-x3)*xab_log)*Hi_Value,-1e10); parallel= abs (1-RocRL/RocSL)<0.1; uptrend= (RocSL>0 & RocRL>0 & parallel) OR ( L <1.05*PLL & H >0.95*PLL); downtrend=(RocSL<0 & RocRL<0 & parallel) OR ( H <1.05*PHL & H >0.95*PHL); DT_UT = IIf (Downtrend & parallel,-1, IIf (Uptrend & parallel,1,0)); bu_Breakout = Cross ( C ,RL) & X>XD; be_Breakout = Cross (SL, C ) & X>XB; breakout = bu_breakout OR be_breakout; RSL_b = L <V1*SL & L >V2*SL & Ref ( L ,-1)>V2*SL; RSL_a = L <=V2*SL & L >0.99*SL & Ref ( L ,-1)>SL & C >SL; RPLL_b = L >Low_Value & L <V1*PLL & L >V2*PLL & Ref ( L ,-1)>V2*PLL; RPLL_a = L >Low_Value & L <V2*PLL & L >0.99*PLL & Ref ( L ,-1)>PLL & C >PLL; ARb = RSL_b OR RPLL_b; ARa = RSL_a OR RPLL_a; Ar = ARb OR ARa; Xm = xb-xa >4 & xd-xc >4; AT= abs (RocRL)<0.03 & RocSL>0.05 & xa<xd & xc<xb & Xm; DT= abs (RocSL)<0.03 & RocRL<-0.05 & xa<xd & xc<xb & Xm; AT_DT= IIf (AT,1, IIf (DT,-1,0)); ST= RocSL>0.03 & RocRL<-0.03 & RL>SL & xa<xd & xc<xb & Xm; ET = RocRL>0.03 & RocSL<-0.03 & RL>SL & abs (ROCSL/ROCRL)<3 & xa<xd & xc<xb & Xm; ST_ET = IIf (ST,1, IIf (ET,-1,0)); RW = RocRL>0.05 & RocSL>0.07 & RocSL>1.5*RocRL & Xm; FW = RocSL<-0.05 & RocRL<-0.07 & RocRL<1.5*RocSL & Xm; RW_FW = IIf (RW,1, IIf (FW,-1,0)); //////////////////////////////////////////7 S_RL = H >0.98*RL & C < RL; S_PHL = H >0.98*PHL & C < PHL; BS = bu_breakout OR Ar; SS = be_breakout OR S_RL OR S_PHL; Buy = BS; Sell = SS; Longfilter = C > MA ( C ,100); Filter = Longfilter; Reentry_Column = IIf (ARb,-1, IIf (ARa,1,0)); AddColumn (Reentry_Column, "Re" ,1.0); bu_be_breakout = IIf (bu_breakout,1, IIf (be_breakout,-1,0)); AddColumn (bu_be_breakout, "B-out" ,1.0); AddColumn (DT_UT, "TC" ,1); AddColumn (AT_DT, "AT/DT" ,1); AddColumn (ST_ET, "ST/ET" ,1); AddColumn (RW_FW, "RW/FW" ,1); AddColumn ( IIf ( C >SL,RocSL,0), "Roc(SL,1)" ,1.1); AddColumn ( IIf ( C <RL,RocRL,0), "Roc(RL,1)" ,1.1); PLLd = abs (( LastValue ( C )/ LastValue (PLL))-1)<0.01*DisRange; PHLd = abs (( LastValue ( C )/ LastValue (PHL))-1)<0.01*DisRange; barvisible = Status ( "barvisible" ); firstvisiblebar = barvisible & NOT Ref (barvisible,-1); HHvisible = LastValue ( HighestSince (firstvisiblebar, High )); LLvisible = LastValue ( LowestSince (firstvisiblebar, Low )); RaH = HHvisible *1.05; RaL = LLVisible *0.95; SL_plot = IIf (x>=xa & SL>RaL & SL<RaH,SL, IIf (x>=xa & RaL==0 ,SL,-1e10)); RL_plot = IIf (x>=xc & RL>RaL & RL<RaH,RL, IIf (x>=xc & RaL==0,RL,-1e10)); PLL_plot = IIf (x-x2>=0 & abs ( LastValue ( C )/ LastValue ( exp ((x-x2)*xcd_log)*Low_Value)-1)<0.01*DisRange & PLL>RaL & PLL<RaH,PLL, IIf (x-x2>=0 & RaL==0 & PLLd,PLL,-1e10)); PHL_plot = IIf (x-x3>=0 & abs ( LastValue ( C )/ LastValue ( exp ((x-x3)*xab_log)*Hi_Value)-1)<0.01*DisRange & PHL>RaL & PHL<RaH,PHL, IIf (x-x3>=0 & RaL==0 & PHLd,PHL,-1e10)); GraphXSpace = 1.5; LastBar = Cum (1) == LastValue ( Cum (1)); Plot ( C , "close" , IIf (LastBar, IIf (BS, colorGreen , IIf (SS,4,1)),1),64); Plot (SL_plot , "SL" ,Color_SL,1+4+ styleNoRescale ); Plot (RL_plot , "RL" ,Color_RL,1+4+ styleNoRescale ); Plot (PLL_plot, "PLL" ,Color_PLL,1+4+ styleNoRescale ); Plot (PHL_plot, "PHL" ,Color_PHL,1+4+ styleNoRescale ); Title = Name () + EncodeColor ( colorRed )+ " pds:" + WriteVal (per,1) + " " + EncodeColor ( colorBlue )+ Date ()+ EncodeColor (3)+ " " + WriteVal ( C ,1.2)+ " (" + WriteIf ( C > Ref ( C ,-1), "+" , "" )+ WriteVal ( ROC ( C ,1),1.2)+ "%)" ; _SECTION_END (); |