Advertisement
Guest User

Candlesticks

a guest
Sep 19th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.54 KB | None | 0 0
  1. //@version=3
  2. study("Candlesticks",overlay=true,precision=0)
  3.  
  4. ///////////////////////////////
  5. // Green = Bullish //
  6. // Red = Bearish //
  7. // Orange = Continuation //
  8. ///////////////////////////////
  9.  
  10. ////CANDLESTICKS
  11. atr=atr(100)
  12.  
  13. redBar=close<open //ALSO BLACK BAR
  14. greenBar=close>open //ALSO WHITE BAR
  15. body=abs(close-open)
  16. total=high-low //ALSO KNOWN AS RANGE
  17. bodyTopLoc=max(open,close)
  18. bodyBottomLoc=min(open,close)
  19. shadowTop=high-bodyTopLoc
  20. shadowBottom=bodyBottomLoc-low
  21. fallingbars=barssince(greenBar) //# of CONSECUTIVE RED BARS
  22. risingbars=barssince(redBar) //# of CONSECUTIVE GREEN BARS
  23.  
  24. percent(x,y)=>
  25. z=x*100/y
  26. z
  27. //CUSTOMIZE THESE ONLY
  28. SizeBottom=atr/10 //Smallest size, anything less is a Doji
  29. SSizeBottom=atr/8 //Small bottom size, used for short candles
  30. SSizeTop=atr/3 //Small top size, used for short candles
  31. NSizeBottom=atr/3 //Normal bottom size, used for normal candles
  32. NSizeTop=atr*1.1 //Normal top size, used for normal candles
  33. LSizeBottom=atr*1.1 //Long bottom size, used for LONG candles
  34. LSizeTop=atr*6 //Long Top size, candles longer than this will be ignored
  35. doji=(body<SizeBottom and percent(body,total)<25) //DOJI
  36. sBody=(body>SSizeBottom and body<SSizeTop)//SMALL BODY
  37. nBody=(body>NSizeBottom and body<NSizeTop) //NORMAL BODY
  38. lBody=(body>LSizeBottom and body<LSizeTop) //LONG BODY
  39. sGap(x,y)=> //SMALL GAP
  40. abs(x-y)<SSizeBottom and abs(x-y)>SSizeBottom/2
  41. nGap(x,y)=> //NORMAL GAP
  42. abs(x-y)>SSizeBottom and abs(x-y)<LSizeBottom/2
  43. lGap(x,y)=> //LARGE GAP
  44. abs(x-y)>LSizeBottom /2
  45. VSShadow(x)=> //VERY SMALL SHADOW
  46. percent(x,total)<15
  47. SShadow(x)=> //SMALL SHADOW
  48. percent(x,total)>15 and percent(x,total)<30
  49. LShadow(x)=> //LONG SHADOW
  50. percent(x,total)>70
  51. SUpTrend=close>ema(close,6) //SHORT UPTREND, used in retracement calculations
  52. LUpTrend=close>ema(close,25) //LONG UPTREND
  53. SPeak=highestbars(25) //PEAK OF SHORT UPTREND
  54. LPeak=highestbars(50) //PEAK OF LONG UPTREND
  55. SDownTrend=close<ema(close,6) //SHORT DOWNTREND, used in retracement calculations
  56. LDownTrend=close<ema(close,25) //LONG DOWNTREND
  57. SBottom=lowestbars(25) //PEAK OF SHORT DOWNTREND
  58. LBottom=lowestbars(50) //PEAK OF LONG DOWNTREND
  59.  
  60. //END CUSTOMIZE
  61. lowPercDiffFall=((close-low)*100)/(open-low)
  62. lowPercDiffRise=((open-low)*100)/(close-low)
  63. highPercDiffFall=((high-open)*100/(high-close))
  64. highPercDiffRise=((high-close)*100/(high-open))
  65.  
  66. // Volume Bars //
  67.  
  68. //Bearish:
  69. //DARK RED when prices goes down and VOLUME is bigger than 150% of its (default 20 day) average, this indicates that price action is supported by a strong BEARISH VOLUME.
  70. //RED when prices goes down and VOLUME is BETWEEN 50% AND 150% of its (default 20 day) average, this indicates that volume is neither strong or weak.
  71. //ORANGE when prices goes down and VOLUME is less than 50% of its (default 20 day) average, so the volume is weak and doesn't support the price action.
  72.  
  73. //Bullish:
  74. //DARK GREEN when prices goes UP and VOLUME is bigger than 150% of its (default 20 day) average, this indicates that the price action is supported by a strong BULLISH VOLUME.
  75. //GREEN when prices goes UP and VOLUME is BETWEEN 50% AND 150% of its (default 20 day) average, this indicates that volume is neither strong or weak.
  76. //LIGHT GREEN when prices goes UP and VOLUME is less than 50% of its (default 20 day) average, so the volume is weak and doesn't support the price action.
  77.  
  78. length1=input(20, "Volume Bars Length", minval=1)
  79. avrg=sma(volume,length1)
  80. vold1 = volume > avrg*1.5 and close<open
  81. vold2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close<open
  82. vold3 = volume < avrg *0.5 and close<open
  83. volu1 = volume > avrg*1.5 and close>open
  84. volu2 = volume >= avrg*0.5 and volume<=avrg*1.5 and close>open
  85. volu3 = volume< avrg*0.5 and close>open
  86. cold1=#800000
  87. cold2=#FF0000
  88. cold3=orange
  89. colu1=#006400
  90. colu2=lime
  91. colu3=#7FFFD4
  92. color = vold1 ? cold1 : vold2 ? cold2 : vold3 ? cold3 : volu1 ? colu1 : volu2 ? colu2 : volu3 ? colu3 : na
  93. barcolor(color)
  94.  
  95. //BULLISH PATTERNS
  96.  
  97. //DRAGONFLY DOJI: Theoretical performance: bullish reversal during a decline, otherwise indecision - Tested performance: Reversal 50% of the time
  98. DFly=(doji and LShadow(shadowBottom) and VSShadow(shadowTop) and total>NSizeBottom and total<LSizeTop and ((SDownTrend)or(LDownTrend)))
  99. plotchar(DFly and not DFly[1], title= "Dragonfly Doji", location=location.belowbar, color=green, char='', text=" \n \nDragonfly\nDoji")
  100.  
  101. //HAMMER: Theoretical performance: Bullish reversal - Tested performance: Bullish reversal 60% of the time
  102. Hammer=(sBody and LShadow(shadowBottom) and VSShadow(shadowTop) and total>LSizeBottom and total<LSizeBottom*2 and ((LUpTrend and SDownTrend)or(LDownTrend)))
  103. plotchar(Hammer and not Hammer[1], title= "Hammer", location=location.belowbar, color=green, char='', text=" \n \nHammer")
  104.  
  105. //TAKURI LINE: Theoretical performance: Bullish reversal - Tested performance: Bullish reversal 66% of the time
  106. Takuri=(sBody and LShadow(shadowBottom) and VSShadow(shadowTop) and total>LSizeBottom*2 and ((LUpTrend and SDownTrend)or(LDownTrend)))
  107. plotchar(Takuri and not Takuri[1], title= "Takuri", location=location.belowbar, color=green, char='', text=" \n \nTakuri\nLine")
  108.  
  109. //BULLISH BELT HOLD: Theoretical performance: Bullish reversal - Tested performance: Bullish reversal 71% of the time
  110. BBelt=((nBody or lBody) and open<=low[1] and low==open and (VSShadow(shadowTop) or SShadow(shadowTop)) and ((LUpTrend and SDownTrend))) //or(LDownTrend)
  111. plotchar(BBelt and not Takuri[1], title= "Bullish Belt Hold", location=location.belowbar, color=green, char='', text=" \n \nBull\nBelt\nHold")
  112.  
  113. //BULLISH ENGULFING: Theoretical performance: Bullish reversal - Tested performance: Bullish reversal 63% of the time
  114. BullEngulf=((sBody[1] or nBody[1]) and redBar[1] and close>open[1] and open<close[1] and not(VSShadow(shadowTop) or VSShadow(shadowBottom)) and greenBar and ((LUpTrend and SDownTrend))) //or(LDownTrend)
  115. plotchar(BullEngulf, title= "Bullish Engulfing", location=location.belowbar, color=green, char='', text=" \n \nBull\nEngulf")
  116.  
  117. //HARAMI CROSS BULLISH, like 56%, very bad indicator, best used in retracement or continuation of uptrend.
  118. HCBull=(doji and redBar[1] and high<open[1] and low>close[1] and SBottom[1]==0 and LUpTrend and (sGap(low,close[1]) or nGap(low,close[1])))
  119. plotchar(HCBull, title= "Bullish Harami Cross", location=location.belowbar, color=green, char='', text=" \n \nHarami\nCross")
  120.  
  121. //HARAMI BULLISH, like 51%, very bad indicator, best used in retracement.
  122. HBull=(not doji and redBar[1] and greenBar and high<open[1] and low>close[1] and SBottom[1]==0 and ((LUpTrend and SDownTrend)) and not(abs(high-high[1])<SSizeBottom and abs(low-low[1])<SSizeBottom) and not(VSShadow(shadowTop) or VSShadow(shadowBottom)) and (sGap(low,close[1]) or nGap(low,close[1])))
  123. plotchar(HBull, title= "Bullish Harami", location=location.belowbar, color=green, char='', text=" \n \nHarami\nBull")
  124.  
  125. //INVERTED HAMMER BULLISH, like 66% CONTINUATION, meaning it's best used in the primary downtrend to SELL, this is the BULLISH version, used in retracements in an uptrend, be careful with this one.
  126. IHammer=(sBody and LShadow(shadowTop) and VSShadow(shadowBottom) and total>LSizeBottom and total<LSizeBottom*2 and ((LUpTrend and SDownTrend)))
  127. plotchar(IHammer, title= "Inverted Hammer", location=location.belowbar, color=green, char='', text=" \n \nInverted\nHammer")
  128.  
  129. //PIERCING LINE, about 64%, long term overall pretty reliable, best used in retracements.
  130. PLine=((nBody[1] or lBody[1]) and (nBody or lBody) and redBar[1] and greenBar and close>=((body[1]*50/100)+bodyBottomLoc[1]) and close<open[1] and nGap(open,close[1]) and nGap(open,close[2]) and ((LUpTrend and SDownTrend)))
  131. plotchar(PLine, title= "Piercing Line", location=location.belowbar, color=green, char='', text=" \n \nPiercing\nLine")
  132.  
  133. //BULLISH DOJI STAR, about 70% CONTINUATION, meaning it's best used in the primary downtrend to SELL, this is the BULLISH version, used in retracements in an uptrend, be careful with this one.
  134. BDojiStar=(doji and redBar[1] and open<close[1] and nGap(open,close[1]) and ((LUpTrend and SDownTrend)))
  135. plotchar(BDojiStar and not DFly, title= "Bullish Doji Star", location=location.belowbar, color=green, char='', text=" \n \nBullish\nDoji\nStar")
  136.  
  137. //BULLISH MEETING LINES, about 56%, long term overall pretty reliable, best used in retracements, code uses the extra green bar to rise frequency to 80%.
  138. BMeetLine=((nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and redBar[2] and greenBar[1] and greenBar and abs(close[2]-close[1])<SizeBottom and ((LUpTrend and SDownTrend)) and VSShadow(shadowTop[2]) and VSShadow(shadowBottom[1]) and close>open[1])
  139. plotchar(BMeetLine, title= "Bullish Meeting Line", location=location.belowbar, color=green, char='', text=" \n \nBull\nMeeting\nLine", offset=-1)
  140.  
  141. //BULLISH HOMING PIGEON, about 57% CONTINUATION, meaning it's best used in the primary downtrend to SELL, this is the BULLISH version, used in retracements in an uptrend, be careful with this one.
  142. HPigeon=(not doji and redBar[1] and redBar and high<open[1] and low>close[1] and ((LUpTrend and SDownTrend)) and not(abs(high-high[1])<SSizeBottom and abs(low-low[1])<SSizeBottom) and not(VSShadow(shadowTop) or VSShadow(shadowBottom)) and (sGap(low,close[1]) or nGap(low,close[1])))
  143. plotchar(HPigeon, title= "Bullish Homing Pigeon", location=location.belowbar, color=green, char='', text=" \n \nBull\nHoming\nPigeon")
  144.  
  145. //BULLISH MATCHING LOW, about 61% CONTINUATION, meaning it's best used in the primary downtrend to SELL, this is the BULLISH version, used in retracements in an uptrend with the added security of an extra green candle above close, be careful with this one.
  146. BMatchLow=((nBody[2] or sBody[2]) and (nBody[1] or sBody[1]) and redBar[2] and redBar[1] and greenBar and abs(close[2]-close[1])<SizeBottom and ((LUpTrend and SDownTrend)) and VSShadow(shadowTop[1]) and VSShadow(shadowTop[2]) and close>open[1])
  147. plotchar(BMatchLow, title= "Bullish Matching Low", location=location.belowbar, color=green, char='', text=" \n \nBull\nMatching\nLow", offset=-1)
  148.  
  149. //KICKER PATTERN, Theoretical performance: Bullish reversal - Tested performance: Bullish reversal 53% of the time.
  150. Kicker=(high[1]<open and lGap(high[1],open) and greenBar and lBody and (SDownTrend or LDownTrend) and volume>=sma(volume,50))
  151. plotchar(Kicker, title= "Kicker Pattern", location=location.belowbar, color=green, char='', text=" \n \nKicker")
  152.  
  153. //BULLISH ABANDONED BABY about 70%, very infrequent though.
  154. ABaby=((doji[1] or sBody[1]) and SDownTrend[1] and redBar[2] and (nBody[2] or lBody[2]) and greenBar and (nBody or lBody) and high[1]<=low[2] and low>=high[1] and close>=((body[2]*40/100)+bodyBottomLoc[2]) and (sGap(low[2],high[1]) or nGap(low[2],high[1]) or lGap(low[2],high[1])) and (sGap(low,high[1]) or nGap(low,high[1]) or lGap(low,high[1])))
  155. plotchar(ABaby, title= "Bullish Abondoned Baby", location=location.belowbar, color=green, char='', text=" \n \nBull Abandoned\nBaby", offset=-1)
  156.  
  157. //MORNING STAR 76 or 78%, very good rates, even in bearish markets, always wait for confirmation
  158. MStar=((doji[1] or sBody[1]) and SDownTrend[1] and redBar[2] and (nBody[2] or lBody[2]) and greenBar and (nBody or lBody) and open[1]<=close[2] and close[1]<=close[2] and open>=close[1] and close>=((body[2]*40/100)+bodyBottomLoc[2]))
  159. plotchar(MStar and not ABaby and not Takuri[1] and not DFly[1] and not Hammer[1], title= "Morning Star", location=location.belowbar, color=green, char='', text=" \n \nMorning\nStar", offset=-1)
  160.  
  161. //BULLISH TRI STAR 60%, used in uptrend or retracements.
  162. BullTriStar=(doji[1] and doji[2] and doji and LUpTrend[1] and open[1]<=close[2] and close[1]<=close[2] and open>=close[1])
  163. plotchar(BullTriStar and not DFly, title= "Bullish Tri Star", location=location.belowbar, color=green, char='', text=" \n \nBull\nTri\nStar")
  164.  
  165. //BULLISH DOWNSIDE GAP TWO RABBITS
  166. BullDownTwoRabb=(((LUpTrend and SDownTrend)) and redBar[2] and (nBody[2] or lBody[2]) and greenBar[1] and greenBar and (nBody[1] or sBody[1])and (nBody or lBody) and (sGap(close[2],open[1]) or nGap(close[2],open[1])) and (sGap(close[1],open) or nGap(close[1],open)) and close[2]>open[1] and close[1]>open)
  167. plotchar(BullDownTwoRabb, title= "Bullish Downside Gap Two Rabbits", location=location.belowbar, color=green, char='', text=" \n \nBull\nDown Gap\nTwo\nRabbits")
  168.  
  169. //BULLISH UNIQUE THREE RIVER BOTTOM, about 60% CONTINUATION, meaning it's best used in the primary downtrend to SELL, this is the BULLISH version, used in retracements in an uptrend, be careful with this one.
  170. BullUnThreeRiver=(((LUpTrend and SDownTrend)) and (nBody[2] or lBody[2]) and redBar[2] and redBar[1] and greenBar and open[1]>close[2] and close[1]<close[2] and low[1]>low[2] and (nBody[1] or sBody[1]) and (sGap(close[2],open[1]) or nGap(close[2],open[1])) and not VSShadow(shadowBottom) and sBody and open<close[1] and (sGap(close[1],open) or nGap(close[1],open)))
  171. plotchar(BullUnThreeRiver and not BullEngulf, title= "Bullish Unique Three River Bottom", location=location.belowbar, color=green, char='', text=" \n \nBull\nUnique\nThree\nRiver\nBottom")
  172.  
  173. //THREE WHITE SOLDIERS, about 83% but somewhat infrequent due to being 3 normal or large green bars.
  174. TGSol=((nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (nBody or lBody) and greenBar[2] and greenBar[1] and greenBar and close[2]<close[1] and close[1]<close and high[2]<high[1] and high[1]<high and open[1]<=close[2] and open<=close[1] and VSShadow(shadowTop[2]) and VSShadow(shadowTop[1]) and VSShadow(shadowTop))
  175. plotchar(TGSol and not TGSol[1], title= "Three White Soldiers", location=location.belowbar, color=green, char='', text=" \n \nThree\nWhite\nSoldiers")
  176.  
  177. //BULLISH DESCENT BLOCK, supposedly 62%,
  178. BullDescBlock=((nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (nBody or lBody) and redBar[2] and redBar[1] and redBar and close[2]>close[1] and close[1]>close and open[1]>=close[2] and open>=close[1] and (not VSShadow(shadowBottom[1]) or SShadow(shadowBottom[1])) and (not VSShadow(shadowBottom[1]) or SShadow(shadowBottom[1])) and body<body[1])
  179. plotchar(BullDescBlock and not BullDescBlock[1], title= "Bullish Descent Block", location=location.belowbar, color=green, char='', text=" \n \nBull\nDescent\nBlock")
  180.  
  181. //BULLISH DELIBERATION BLOCK, this one is the counterpart to deliberation which has like 74% to actually continue... be EXTREMELY CAREFUL WITH THIS ONE.
  182. BullDeliBlock=(((LUpTrend and SDownTrend)) and (nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (sBody or doji) and redBar[2] and redBar[1] and redBar and close[2]>close[1] and close[1]>close and open[1]>=close[2] and (sGap(open,close[1]) or nGap(open,close[1])) and open<close)
  183. plotchar(BullDeliBlock, title= "Bullish Deliberation Block", location=location.belowbar, color=green, char='', text=" \n \nBull\nDeliberation\nBlock")
  184.  
  185. //DELIBERATION BLOCK, this one is the counterpart to deliberation which has like 74% to actually continue falling, that's why it's here.
  186. BullDeliBlock2=(not LUpTrend and (nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (sBody or doji) and redBar[2] and redBar[1] and redBar and close[2]>close[1] and close[1]>close and open[1]>=close[2] and (sGap(open,close[1]) or nGap(open,close[1])) and open<close)
  187. plotchar(BullDeliBlock2, title= "Deliberation Block", location=location.belowbar, color=green, char='', text=" \n \nDeliberation\nBlock")
  188.  
  189. //BULLISH DELIBERATION: Theoretical performance: Bearish reversal - Tested performance: Bullish continuation 77% of the time
  190. Deliberation=(not LDownTrend and (nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (sBody or doji) and greenBar[2] and greenBar[1] and greenBar and close[2]<close[1] and close[1]<close and open[1]<=close[2] and (sGap(open,close[1]) or nGap(open,close[1])) and open>close)
  191. plotchar(Deliberation, title= "Bullish Deliberation", location=location.belowbar, color=green, char='', text=" \n \nBull\nDeliberation")
  192.  
  193. //DELIBERATION, about 74% CONTINUATION, meaning it's best used in the primary uptrend to BUY, despite being called a bearish indicator.
  194. Deliberation2=(((LDownTrend and SUpTrend)) and (nBody[2] or lBody[2]) and (nBody[1] or lBody[1]) and (sBody or doji) and greenBar[2] and greenBar[1] and greenBar and close[2]<close[1] and close[1]<close and open[1]<=close[2] and (sGap(open,close[1]) or nGap(open,close[1])) and open>close)
  195. plotchar(Deliberation2, title= "Deliberation", location=location.belowbar, color=green, char='', text=" \n \nDeliberation")
  196.  
  197. //BULLISH TWO RABBITS, counterpart to two crows, 54%, almost random
  198. TwoRabbits=(LUpTrend and (nBody[2] or lBody[2]) and redBar[2] and open[1]<close[2] and greenBar[1] and greenBar and (nBody[1] or sBody[1]) and (nBody or lBody) and (sGap(open[1],close[2]) or nGap(open[1],close[2]) or lGap(open[1],close[2])) and open<=close[1] and close>=((body[2]*15/100)+bodyBottomLoc[2]))
  199. plotchar(TwoRabbits and not BullDownTwoRabb, title= "Two Rabbits", location=location.belowbar, color=green, char='', text=" \n \nTwo\nRabbits")
  200.  
  201. //CANDLESTICK SANDWICH
  202. CSandwich=(((nBody[2] and nBody[1] and nBody) or ((lBody[2] and lBody[1] and lBody))) and redBar[2] and greenBar[1] and redBar and abs(close-close[2])<atr/6 and abs(open-open[2])<atr/6)
  203. plotchar(CSandwich, title= "Candlestick Sandwich", location=location.belowbar, color=green, char='', text=" \n \nCandleStick\nSandwich")
  204.  
  205. //THREE LINE STRIKE
  206. TLS=(close[1]<close[2] and close[2]<close[3] and open[3]>close[3] and close>high[3])
  207. plotchar(TLS, title= "Three Line Strike", location=location.belowbar, color=green, char='', text=" \n \nThree\nLine\nStrike")
  208.  
  209. //BULLISH HOOK REVERSAL
  210. BullHR=(greenBar and redBar[1] and open-low[1]<atr/6 and low> low[1] and high<high[1] and high[1]-high<atr/4 and volume>=sma(volume,50)/2 and SBottom[1]==0 and abs(close[1]-open[1]) > atr/3 and open[1]-close<atr/6 and open-close[1]<atr/6)
  211. plotchar(BullHR, title= "Bullish Hook Reversal", location=location.belowbar, color=green, char='', text=" \n \nBull\nHook\nReversal")
  212.  
  213. //BULLISH BULL SAN KU PATTERN
  214. SanKuBull=(redBar and close[1]<open[1] and close[2]<open[2] and close[2]-open[1]>atr/6 and close[1]-open>atr/6 and abs(close[2]-open[2]) > atr/7 and abs(close[1]-open[1]) > atr/7 and body > atr/7)
  215. plotchar(SanKuBull, title= "Bullish San Ku Pattern", location=location.belowbar, color=green, char='', text=" \n \nSan Ku\nBull")
  216.  
  217. //BULLISH ISLAND REVERSAL
  218. BullIR=(low[2]>open[1] and low[2]-open[1]> atr[1]/3 and abs(close[1]-open[1])<atr[1]/8 and close[1]<low and high-close[1]>atr/3 and volume[1]>=sma(volume,50)/2)
  219. plotchar(BullIR, title= "Bullish Island Reversal", location=location.belowbar, color=green, char='', text=" \n \nBull\nIsland\nReversal")
  220.  
  221.  
  222. //BEARISH PATTERNS
  223.  
  224.  
  225. //TWO BLACK GAPPING MODIFIED:
  226. TwoBGap=(close<close[1] and close[1]<close[2] and close[2]<close[3] and LPeak[3]==0 and high[2]<high[3] and open[2]-close[1]>(close[3]-open[3])*3 and open[3]<close[3] and close[3]-open[3]>atr[3])
  227. plotchar(TwoBGap, title= "Two Black Gapping", location=location.abovebar, color=red, char='', text=" \n \nTwo\nBlack\nGapping")
  228.  
  229. //THREE BLACK CROWS:
  230. TBC=(LPeak[2]>=-1 and close<close[1] and close[1] < close[2] and low< low[1] and low[1]< low[2] and lowPercDiffFall<45 and lowPercDiffFall[1]<45 and lowPercDiffFall[2]<45)
  231. plotchar(TBC, title= "Three Black Crows", location=location.abovebar, color=red, char='', text=" \n \nThree\nBlack\nCrows")
  232.  
  233. //EVENING STAR:
  234. EStar=((doji[1] or sBody[1]) and LPeak[1]==0 and (close[2]-open[2])>atr[2]*1.25 and ((redBar and open-close < atr/2) or highPercDiffFall>30 or highPercDiffRise>50) and close<(close[2]-((close[2]-open[2])*34/100)) and redBar and high[1]-low[1]<atr/1.5)
  235. plotchar(EStar, title= "Evening Star", location=location.abovebar, color=red, char='', text=" \n \nEvening\nStar")
  236.  
  237. //BEARISH ISLAND REVERSAL:
  238. BearIR=(high[2]<open[1] and open[1]-high[2]> atr[1]/3 and abs(close[1]-open[1])<atr[1]/8 and close[1]>high and close[1]-high>atr/3 and volume[1]>=sma(volume,50)/2)
  239. plotchar(BearIR, title= "Bearish Island Reversal", location=location.abovebar, color=red, char='', text=" \n \nBear\nIsland\nReversal")
  240.  
  241. //BEARISH HOOK REVERSAL:
  242. BearHR=(redBar and greenBar[1] and high[1]-open<atr/6 and low> low[1] and high<high[1] and low-low[1]<atr/4 and volume>=sma(volume,50)/2 and SPeak[1]==0 and abs(close[1]-open[1]) > atr/3 and close-open[1]<atr/6 and close[1]-open<atr/6)
  243. plotchar(BearHR, title= "Bearish Hook Reversal", location=location.abovebar, color=red, char='', text=" \n \nBear\nHook\nReversal")
  244.  
  245. //BEAR SAN KU PATTERN:
  246. SanKuBear=(greenBar and close[1]>open[1] and close[2]>open[2] and open[1]-close[2]>atr/6 and open-close[1]>atr/6 and abs(close[2]-open[2]) > atr/7 and abs(close[1]-open[1]) > atr/7 and body > atr/7)
  247. plotchar(SanKuBear, title= "Bearish San Ku Patterm", location=location.abovebar, color=red, char='', text=" \n \nSan Ku\nBear")
  248.  
  249. //HARAMI CROSS BEARISH:
  250. HCBear=(doji and high<close[1] and low>open[1] and close[1]>open[1] and SPeak[1]==0)
  251. plotchar(HCBear, title= "Bearish Harami Cross", location=location.abovebar, color=red, char='', text=" \n \nHarami\nCross")
  252.  
  253. //SHOOTING STAR:
  254. SStar=(sBody and shadowBottom/(high-low)<0.15 and shadowTop/(high-low)>0.7 and SPeak[1]==0 and redBar and high-low>atr*1.25)
  255. plotchar(SStar, title= "Shooting Star", location=location.abovebar, color=red, char='', text=" \n \nShooting\nStar")
  256.  
  257. //HANGING MAN:
  258. Hanging=(sBody and shadowBottom/(high-low)>0.7 and shadowTop/(high-low)<0.15 and SPeak[1]==0 and open>=close[1])
  259. plotchar(Hanging, title= "Hanging Man", location=location.abovebar, color=red,char='', text=" \n \nHanging\nMan")
  260.  
  261. //UPSIDE GAP TWO CROWS:
  262. UpsideGapTwoCrows=(greenBar[2] and redBar[1] and redBar and body[2]>atr[2] and open[1]>=close[2] and sBody[1] and open>=open[1] and close<close[1] and close>close[2] and body>atr/1.5)
  263. plotchar(UpsideGapTwoCrows, title= "Upside Gap Two Crows",location=location.abovebar, color=red, char='', text=" \n \nUpside\nGap\nTwo\nCrows")
  264.  
  265. //DARK CLOUD COVER: Theoretical performance: Bearish reversal - Tested performance: Bearish reversal 60% of the time
  266. DarkCC=(body[1]>atr[1]/2 and body>atr/2 and open>=high[1] and close<(open[1]+close[1])/2 and close > open[1] and redBar and SUpTrend)
  267. plotchar(DarkCC, title= "Dark Cloud Cover",location=location.abovebar, color=red, char='', text=" \n \nDark\nCloud\nCover")
  268.  
  269. //BEARISH ENGULFING:
  270. BearEngulf=((sBody[1] or doji[1]) and LPeak[1]==0 and body>atr*1.15 and redBar and close<low[1] and shadowBottom/(high-low)<0.1)
  271. plotchar(BearEngulf, title= "Bearish Engulfing",location=location.abovebar, color=red, char='', text=" \n \nBear\nEngulf")
  272.  
  273. //GRAVESTONE DOJI
  274. Gravestone=(doji and (max(open,close)-low)/(high-low)<0.25 and high-low>(atr/2) and SUpTrend)
  275. plotchar(Gravestone, title= "Gravestone Doji", location=location.abovebar, color=red, char='', text=" \n \nGravestone\nDoji")
  276.  
  277. //BEARISH ABANDONED BABY
  278. BearABaby=((doji[1] or sBody[1]) and SUpTrend[1] and greenBar[2] and (nBody[2] or lBody[2]) and redBar and (nBody or lBody) and low[1]>=high[2] and high<=low[1] and close<=((body[2]*40/100)+bodyBottomLoc[2]) and (sGap(high[2],low[1]) or nGap(high[2],low[1]) or lGap(high[2],low[1])) and (sGap(high,low[1]) or nGap(high,low[1]) or lGap(high,low[1])))
  279. plotchar(BearABaby, title= "Bearish Abondoned Baby", location=location.abovebar, color=red, char='', text=" \n \nBear\nAbandoned\nBaby", offset=-1)
  280.  
  281.  
  282. //CONTINUATION PATTERNS
  283.  
  284.  
  285. //INVERTED HAMMER, like 66% CONTINUATION, meaning it's best used in the primary downtrend to SELL, despite being called a bullish indicator
  286. IHammer2=(sBody and LShadow(shadowTop) and VSShadow(shadowBottom) and total>LSizeBottom and total<LSizeBottom*2 and LDownTrend)
  287. plotchar(IHammer2 and not MStar, title= "Continuation Inverted Hammer", location=location.abovebar, color=orange, char='', text=" \n \nInverted\nHammer")
  288.  
  289. //BULLISH MATCHING LOW: 61% CONTINUATION meaning it's best used in the primary downtrend to SELL, despite being called a bullish indicator.
  290. BMatchLow2=((nBody[1] or sBody[1]) and (nBody or sBody) and redBar[1] and redBar and abs(close[1]-close)<SizeBottom and LDownTrend and VSShadow(shadowTop[1]) and VSShadow(shadowTop))
  291. plotchar(BMatchLow2, title= "Continuation Bull Matching Low", location=location.abovebar, color=orange, char='', text=" \n \nBull\nMatching\nLow")
  292.  
  293. //BULLISH HOMING PIGEON: 57% CONTINUATION, meaning it's best used in the primary downtrend to SELL, despite being called a bullish indicator.
  294. HPigeon2=(not doji and redBar[1] and redBar and high<open[1] and low>close[1] and LDownTrend and not(abs(high-high[1])<SSizeBottom and abs(low-low[1])<SSizeBottom) and not(VSShadow(shadowTop) or VSShadow(shadowBottom)) and (sGap(low,close[1]) or nGap(low,close[1])))
  295. plotchar(HPigeon2, title= "Continuation Bull Homing Pigeon", location=location.belowbar, color=orange, char='', text=" \n \nBull\nHoming\nPigeon")
  296.  
  297. //BULLISH DOJI STAR: about 70% CONTINUATION, meaning it's best used in the primary downtrend to SELL, despite being called a bullish indicator.
  298. BDojiStar2=(doji and redBar[1] and open<close[1] and nGap(open,close[1]) and LDownTrend)
  299. plotchar(BDojiStar2, title= "Continuation Bull Doji Star", location=location.abovebar, color=orange, char='', text=" \n \nBullish\nDoji\nStar")
  300.  
  301. //BULLISH UNIQUE THREE RIVER BOTTOM, about 60% CONTINUATION, meaning it's best used in the primary downtrend to SELL, despite being called a bullish indicator.
  302. BullUnThreeRiver2=(LDownTrend and (nBody[2] or lBody[2]) and redBar[2] and redBar[1] and greenBar and open[1]>close[2] and close[1]<close[2] and low[1]>low[2] and (nBody[1] or sBody[1]) and (sGap(close[2],open[1]) or nGap(close[2],open[1])) and not VSShadow(shadowBottom) and sBody and open<close[1] and (sGap(close[1],open) or nGap(close[1],open)))
  303. plotchar(BullUnThreeRiver2, title= "Continuation Bull Unique Three River Bottom", location=location.belowbar, color=orange, char='', text=" \n \nBull\nUnique\nThree\nRiver\nBottom")
  304.  
  305. // End //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement