This indicator recognizes 56 candlestick patterns and draw their names with green and red arrows on chart:
•Doji
•Evening star
•Morning star
•Shooting star
•Hammer
•Inverted hammer
•Bearish harami
•Bearish harami cross
•Bullish harami
•Bullish harami cross
•Descending Hawk
•Homing Pigeon
•Bearish engulfing
•Bullish engulfing
•Last engulfing bottom
•Last engulfing top
•Piercing line
•Hanging man
•Dark cloud cover
•Abandoned baby bottom
•Three White soldiers
•Three Inside Up
•Three Outside Up
•Concealing Baby Swallow
•Dragonfly Doji Bottom
•Gravestone Doji Bottom
•Three Stars in the South
•Bullish Breakaway
•Rising Three Methods
•Bullish Three Line Strike
•Bullish Mathold
•Abandoned Baby Top
•Three Black Crows
•Three Inside Down
•Three Outside Down
•Upside Gap Two Crows
•Dragonfly Doji Top
•Gravestone Doji Top
•Advance Block
•Two Crows
•Bearish Breakaway
•Falling Three Methods
•Bearish Three Line Strike
•Bearish Mathold
•Windows (Gaps Up & Gaps Down)
•Bull Sash
•Bull Separating Line
•Bullish Counter Attack
•Bear Sash
•Bear Separating Line
•Bearish Counter Attack
•Tweezers Top
•Tweezers Bottom
•Bullish Kicker
•Bearish Kicker
Since Candlesticks have a meaning only if related to the underlying trend, at the beginning of the code there is also the possibility to change the method used to identify the “trend direction”
(0=No Trend check, 1=MACD, 2=SAR, 3=Directional Movement, 4=Moving Averages crossing [default], 5=Stochastic)
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 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
// Trend direction identification //(choose 0=No Trend check, 1=MACD, 2=SAR, 3=Directional Movement, 4=Moving Averages crossing [default], 5=Stochastic) // TDS=4 //text color // white = 255,255,255 ; black = 0,0,0 r = 0 g = 0 b = 0 atr = averagetruerange[10](close)*0.5 body=close-open abody=abs(body) if range>0 then ratio=abody/range else ratio=0 endif middle=(open+close)/2 if body>0 then bodytop=close bodybottom=open else bodytop=open bodybottom=close endif //bodytop=max(open, close) //bodybottom=min(open, close) shadowtop=high-bodytop shadowbottom=bodybottom-low longcandle= (ratio>0.6) DojiSize = 0.05 data=(abs(open - close) <= (high - low) * DojiSize) if data then DRAWTEXT("Doji", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B) endif //Trend Detection if TDS=0 then TrendUp=1 TrendDown=1 else if TDS=1 then TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0) TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0) else if TDS=2 then TrendUp=(SAR[0.02,0.02,0.2]<low) TrendDown=(SAR[0.02,0.02,0.2]>high) else if TDS=3 then TrendUp=(ADX[14]>23 AND DI[14](close)>0) TrendDown=(ADX[14]>23 AND DI[14](close)<0) else if TDS=4 then TrendUp=(ExponentialAverage[2](close)>ExponentialAverage[4](close)) TrendDown=(ExponentialAverage[2](close)<ExponentialAverage[4](close)) else if TDS=5 then TrendUp=(Stochastic[14,3](close)>Average[5](Stochastic[14,3](close))) TrendDown=(Stochastic[14,3](close)<Average[5](Stochastic[14,3](close))) endif endif endif endif endif endif //Bullish Signal MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close) if TrendDown[3] AND MorningStar then DRAWTEXT("Morning Star", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10) endif PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1]) if TrendDown[2] AND PiercingLine then DRAWTEXT("Piercing Line", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low) if TrendDown[3] AND AbandonedBabyBottom then DRAWTEXT("Abandoned Baby Bottom", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1]) if TrendDown[3] AND ThreeInsideUp then DRAWTEXT("Three Inside Up", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1]) if TrendDown[3] AND ThreeOutsideUp then DRAWTEXT("Three Outside Up", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1]) if TrendDown[3] AND ThreeWhiteSoldiers then DRAWTEXT("Three White Soldiers", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1]) if TrendDown[4] AND ConcealingBabySwallow then DRAWTEXT("Concealing Baby Swallow", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1]) if TrendDown[2] AND BullishHarami then DRAWTEXT("Bullish Harami", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1]) if TrendDown[2] AND HomingPigeon then DRAWTEXT("Homing Pigeon", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle) if TrendDown[2] AND BullishEngulfing then DRAWTEXT("Bullish Engulfing", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle) if TrendDown[2] AND LastEngulfingBottom then DRAWTEXT("Last Engulfing Bottom", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3) if TrendDown[2] AND DragonflyDojiBottom then DRAWTEXT("Dragonfly Doji", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3) if TrendDown[2] AND GravestoneDojiBottom then DRAWTEXT("Gravestone Doji", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1]) if TrendDown[2] AND DojiStarBottom then DRAWTEXT("Doji", barindex, low-atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B) endif BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1]) if TrendDown[2] AND BullishHaramiCross then DRAWTEXT("Bullish Harami Cross", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4) if TrendDown[3] AND ThreeStarsInTheSouth then DRAWTEXT("Three Stars In The South", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3]) if TrendDown[5] AND BullishBreakaway then DRAWTEXT("Bullish Breakaway", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody) if TrendDown[2] AND Hammer then DRAWTEXT("Hammer", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody) if TrendDown[2] AND InvertedHammer then DRAWTEXT("Inverted Hammer", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1]) if TrendUp[5] AND RisingThreeMethods then DRAWTEXT("Rising Three Methods", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3]) if TrendUp[4] AND BullishThreeLineStrike then DRAWTEXT("Bullish Three Line Strike", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1]) if TrendUp[5] AND BullishMatHold then DRAWTEXT("Bullish Mat Hold", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif //Bearish Signal EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close) if TrendUp[3] AND EveningStar then DRAWTEXT("Evening Star", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10) endif DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1]) if TrendUp[2] AND DarkCloudCover then DRAWTEXT("Dark Cloud Cover", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high) if TrendUp[3] AND AbandonedBabyTop then DRAWTEXT("Abandoned Baby Top", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1]) if TrendUp[3] AND ThreeInsideDown then DRAWTEXT("Three Inside Down", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1]) if TrendUp[3] AND ThreeOutsideDown then DRAWTEXT("Three Outside Down", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1]) if TrendUp[3] AND ThreeBlackCrows then DRAWTEXT("Three Black Crows", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2]) if TrendUp[3] AND UpsideGapTwoCrows then DRAWTEXT("Upside Gap Two Crows", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1]) if TrendUp[2] AND BearishHarami then DRAWTEXT("Bearish Harami", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif DescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1]) if TrendUp[2] AND DescendingHawk then DRAWTEXT("Descending Hawk", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle) if TrendUp[2] AND BearishEngulfing then DRAWTEXT("Bearish Engulfing", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,20) endif LastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle) if TrendUp[2] AND LastEngulfingTop then DRAWTEXT("Last Engulfing Top", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,20) endif DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3) if TrendUp[2] AND DragonflyDojiTop then DRAWTEXT("Dragonfly Doji", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3) if TrendUp[2] AND GravestoneDojiTop then DRAWTEXT("Gravestone Doji", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1]) if TrendUp[2] AND DojiStarTop then DRAWTEXT("Doji", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B) endif BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1]) if TrendUp[2] AND BearishHaramiCross then DRAWTEXT("Bearish Harami Cross", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1]) if TrendUp[3] AND AdvanceBlock then DRAWTEXT("Advance Block", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2]) if TrendUp[3] AND TwoCrows then DRAWTEXT("Two Crows", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3]) if TrendUp[5] AND BearishBreakaway then DRAWTEXT("Bearish Breakaway", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody) if TrendUp[2] AND ShootingStar then DRAWTEXT("Shooting Star", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody) if TrendUp[2] AND HangingMan then DRAWTEXT("Hanging Man", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1]) if TrendDown[5] AND FallingThreeMethods then DRAWTEXT("Falling Three Methods", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3]) if TrendDown[4] AND BearishThreeLineStrike then DRAWTEXT("Bearish Three Line Strike", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1]) if TrendDown[5] AND BearishMatHold then DRAWTEXT("Bearish Mat Hold", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif //Gaps GapUp=(low>high[1]) GapDown=(high<low[1]) if GapUp then DRAWTEXT("w", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255) else if GapDown then DRAWTEXT("w", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255) endif endif //Steve Nison Candles BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody) if BullSash then DRAWTEXT("Bull Sash", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody) if BullSeparatingLine then DRAWTEXT("Bull Separating Line", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1]) if TrendDown[2] AND BullishCounterAttack then DRAWTEXT("Bullish Counter Attack", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody) if BearSash then DRAWTEXT("Bear Sash", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody) if BearSeparatingLine then DRAWTEXT("Bear Separating Line", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1]) if TrendUp[2] AND BearishCounterAttack then DRAWTEXT("Bearish Counter Attack", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif //Tweezers Top and Bottom TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1]) if TrendUp[2] AND TweezersTop then DRAWTEXT("Tweezers Top", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1]) if TrendDown[2] AND TweezersBottom then DRAWTEXT("Tweezers Bottom", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif //kicker candlestick patterns BullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0) if BullishKicking then DRAWTEXT("Bullish Kicking", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10) DRAWARROWUP(barindex,low-atr) COLOURED(0,155,10) endif BearishKicking=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowtop=0 AND shadowbottom=0) if BearishKicking then DRAWTEXT("Bearish Kicking", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10) DRAWARROWDOWN(barindex,high+atr) COLOURED(255,0,10) endif RETURN |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
bonjour ,
à priori beaucoup de fautes de syntaxe !!!
There are no syntax errors and the indicator works.
Could you be more precise?
How do I make these appear on the Price Chart rather than on its own indicator chart? Thanks.
Just found this on another post. https://www.prorealcode.com/wp-content/uploads/2017/10/add-indicator-on-price-prorealtime.jpg
It would be interesting if you can choose which candlestick patterns you want to display on the chart and which not.
I don’t know why the indicator does not work for me. It gives me an error about RETURN…
Can someone help me please?
Just remove the ones you don’t want from the code…
I would (and I had) reverse the direction of the arrow and the color of the arrow for: “last top or last bottom engulfing”. Most of time (more than 65%) they act more as a continuation than a reversal pattern. From a small sample on commodities, it is also my impression. But that’s me…
http://thepatternsite.com/LastEngulfTop.html
—–
http://thepatternsite.com/LastEngulfBottom.html
Same for advance block (more often a continuation)
http://thepatternsite.com/AdvanceBlock.html
hello sagal i would like to work with you directly for me please, is it possible ?? I have a job for you
1) improve you patern indicator
2) when i put i in PRT i see a error code …
Hi Cicco, thanks for this code – it’s great! I was wondering if there is a way to integrate a MTF trend filter, so that the indicator would only show bearish candles if the trend is bearish (for example with a Supertrend) on a higher timeframe. For example: bearish only signals on 15m TF when Supertrend is bearish on 1h TF.
Unfortunately I am not such an expert.
I use this “pattern indicator” only as a visual help…. nothing more.
Thanks for the code, very helpful, can anyone tell me how I can set an alert on the appearance of a candle stick alert? Thanks
hello and thanks for the code.
i dont understand what the “W” means on the graph ?
It means “Window” that is a Gap
Hello,
first of all, thank you !
Is this code available for an extern project ? if yes, in which language did you write it ?
this code is only available here and in ProBuilder language to be used exclusively with ProRealTime.
What a job! Thank you very much :))
@Nicolas
Could you please fix the image that is not appearing on top of this thread?
I cannot edit it.
You have only to use the race-daily.png that is attached
Thanks in advance
Great work! Thank you!
For the complete “Three inside up” and “Three inside down” there should be a small change. The t+3 candle must close above the t+1 open for the Three inside up and vis versa for the opposite pattern.
ThreeInsideUp=(body[2]0 and body>0 and BullishHarami[1] and close>close[1])
ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
should be changed to:
ThreeInsideUp=(body[2]0 and body>0 and BullishHarami[1] and close>close[1] and close>open[2])
ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1]and close<open[2])
You are right.
Thanks
I am asking again to some Mod/Nicolas if they can add at the beginning of this thread the “race-daily.png” image attached at the end of the code.
It was there but for some unkown reasons it got deleted.
I cannot do anything.
Kindly explain what does “BearSash” mean, please?
Have a look here
https://issuu.com/yesakhtar/docs/quick_reference_candlestick
Great job thanks!!!
I was glancing through the code and noticed that the variable name, Middle’ has been used. In PRC V11 the ‘Anchor’ command was introduced, This command accepts a number of predefined parameter keywords, one of which is ‘Middle’. This is why the variable now highlights in green above. Therefore, running the code, on these newer versions will create a conflict, and error. Correcting can easily be done by,, replacing all instances of ‘Middle’ with a none conflicting variable name via the code editor, modify code.