• Get $40 off VIP by signing up for a free account! Sign Up

Automatic patterns studies, Bull, Bear, Bullish only & Bearish only For ThinkOrSwim

Hello everyone, this is my first big study I've worked on, been busy the last weekend so I didn't post it once I finished it. @BenTen had posted this study on this thread and I thought it was awesome, The format was started based on the 2013 patterns available and someone added on to it. I reorganized it so it's in order of the current order of available patterns on this definition list.I also changed the color so the darker shade is the reversal, and a lighter shade of the same color is signaling a continuation. All of this info is added to an addlabel for each study. As you can see, you can change the inputs to show various metrics of the patterns, just an arrow, number ID, and verbose(the pattern name). You can also select up 3 patterns which will show instead of all of them. I won't go into detail on the bull because a working version is already up at the first link on this document. Use all 4 studies together on your upper, or pick and choose which ones you want to use. Super helpful for learning which kinds of candles occur the most often, which ones will get ignored the most, etc. some I have found will be a strong reversal signal

I will post another version in the comments once I finish that it is a work in progress still. It will show just the patterns and you can't select a certain few to display, it will only show all patterns regardless of the 4 types of patterns, meaning bull, bear, B&B Bull, B&B bear.

It helps if you put the studies in the order I listed below, because I have:
Show 1st, 2nd, 3rd for bull only.
Show 3rd, 4th, 5th for bear only.
Show 7th, 8th, 9th for B&B Bull only.
Show 10th, 11th, 12th for B&B Bear only

This is verbose only bull:
0cm3aB8.png


Code Bull only:
Code:
#Bullish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021
#Report any problems to 'StanL' on TOS' ThinkScript Lounge
#Revision date 3:36 PM 9/29/2013

AddLabel(yes, "Bullish only Reversals", CreateColor(0, 255, 0));
AddLabel(yes, "Bullish only Continuations: 3, 7, 12, 19, 20", CreateColor(153, 255, 153));

input TurnAlertOff_bull = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_bull = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubble_bull = {default none_bull, Verbose_bull, ID_Number_bull};#Hint showBubble:Choice of what format the candle bubble ID should have

input ShowAll_bull = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.


def BubNone_bull = If (showBubble_bull == showBubble_bull.none_bull, 1, 0);

def BubVerb_bull = If (showBubble_bull == showBubble_bull.Verbose_bull, 1, 0);

def BubNumb_bull =  If (showBubble_bull == showBubble_bull.ID_Number_bull, 1, 0);

#####################################################
############ Define the three selection Enums #################
#####################################################

input ShowFirst =  {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

input ShowSecond = {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

input ShowThird =  {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle;

switch (ShowFirst) {
case ConcealingBabySwallow_1:

    candle = If(ShowFirst.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle =  If(ShowFirst.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle = If(ShowFirst.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle = If(ShowFirst.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle = If(ShowFirst.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle = If(ShowFirst.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle = If(ShowFirst.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle = If(ShowFirst.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle = If(ShowFirst.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle = If(ShowFirst.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle = If(ShowFirst.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle = If(ShowFirst.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle = If(ShowFirst.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle = If(ShowFirst.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle = If(ShowFirst.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle = If(ShowFirst.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle = If(ShowFirst.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle = If(ShowFirst.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle = If(ShowFirst.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle = If(ShowFirst.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle;

Show1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show1st.SetDefaultColor(Color.GREEN);

Show1st.SetLineWeight(5);
#####################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle2;

switch (ShowSecond) {
case ConcealingBabySwallow_1:

    candle2 = If(ShowSecond.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle2 =  If(ShowSecond.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle2 = If(ShowSecond.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle2 = If(ShowSecond.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle2 = If(ShowSecond.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle2 = If(ShowSecond.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle2 = If(ShowSecond.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle2 = If(ShowSecond.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle2 = If(ShowSecond.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle2 = If(ShowSecond.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle2 = If(ShowSecond.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle2 = If(ShowSecond.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle2 = If(ShowSecond.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle2 = If(ShowSecond.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle2 = If(ShowSecond.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle2 = If(ShowSecond.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle2 = If(ShowSecond.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle2 = If(ShowSecond.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle2 = If(ShowSecond.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle2 = If(ShowSecond.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle2 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;

Show2nd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show2nd.SetDefaultColor(Color.GREEN);

Show2nd.SetLineWeight(5);
#####################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle3;

switch (ShowThird) {
case ConcealingBabySwallow_1:

    candle3 = If(ShowThird.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle3 =  If(ShowThird.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle3 = If(ShowThird.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle3 = If(ShowThird.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle3 = If(ShowThird.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle3 = If(ShowThird.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle3 = If(ShowThird.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle3 = If(ShowThird.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle3 = If(ShowThird.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle3 = If(ShowThird.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle3 = If(ShowThird.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle3 = If(ShowThird.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle3 = If(ShowThird.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle3 = If(ShowThird.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle3 = If(ShowThird.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle3 = If(ShowThird.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle3 = If(ShowThird.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle3 = If(ShowThird.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle3 = If(ShowThird.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle3 = If(ShowThird.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle3 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;

Show3rd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show3rd.SetDefaultColor(Color.GREEN);

Show3rd.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

#ConcealingBabySwallow_1,
###### 1 ####################### ConcealingBabySwallow() #############################
def ThreeShows_1 = If (ShowFirst == ShowFirst.ConcealingBabySwallow_1 or ShowSecond == ShowSecond.ConcealingBabySwallow_1 or ShowThird == ShowThird.ConcealingBabySwallow_1, 1, 0);

rec ConcealingBabySwallow_Trig = If(ConcealingBabySwallow().bullish , ConcealingBabySwallow(), ConcealingBabySwallow_Trig[1]);

AddLabel(ConcealingBabySwallow_Trig > 0  && showLabel_bull  && ThreeShows_1, "1=ConcealingBabySwallow" , CreateColor(0, 255, 0));

Alert(ConcealingBabySwallow() && !TurnAlertOff_bull, "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);

AddChartBubble(ConcealingBabySwallow() && (BubVerb_bull or BubNumb_bull) && ThreeShows_1 , low -15 ,  if BubNumb_bull

then "1" else if BubVerb_bull then "ConcealingBabySwallow" else "" , CreateColor(0, 255, 0)  , no);



#Hammer_2,  
###### 2 ####################### Hammer() #############################
def ThreeShows_2 = If (ShowFirst == ShowFirst.Hammer_2 or ShowSecond == ShowSecond.Hammer_2 or ShowThird == ShowThird.Hammer_2, 1, 0);

rec Hammer_Trig = If(Hammer().bullish , Hammer(), Hammer_Trig[1]);

AddLabel(Hammer_Trig > 0  && showLabel_bull  && ThreeShows_2, "2=Hammer" , CreateColor(0, 255, 0));

Alert(Hammer() && !TurnAlertOff_bull, "Hammer", Alert.BAR, Sound.Chimes);

AddChartBubble(Hammer() && (BubVerb_bull or BubNumb_bull) && ThreeShows_2, low -15 ,  if BubNumb_bull

then "2" else if BubVerb_bull then "Hammer" else "" , CreateColor(0, 255, 0)  , no);



#HighPriceGappingPlay_3, #C
###### 2 ####################### HighPriceGappingPlay() #############################
def ThreeShows_3 = If (ShowFirst == ShowFirst.HighPriceGappingPlay_3 or ShowSecond == ShowSecond.HighPriceGappingPlay_3 or ShowThird == ShowThird.HighPriceGappingPlay_3, 1, 0);

rec HighPriceGappingPlay_Trig = If(HighPriceGappingPlay().bullish , HighPriceGappingPlay(), HighPriceGappingPlay_Trig[1]);

AddLabel(HighPriceGappingPlay_Trig > 0  && showLabel_bull  && ThreeShows_3, "3=HighPriceGappingPlay" , CreateColor(153, 255, 153));

Alert(HighPriceGappingPlay() && !TurnAlertOff_bull, "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(HighPriceGappingPlay() && (BubVerb_bull or BubNumb_bull) && ThreeShows_3, low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "HighPriceGappingPlay" else "" , CreateColor(153, 255, 153)  , no);


#HomingPigeon_4,
###### 4 ####################### HomingPigeon() #############################
def ThreeShows_4 = If (ShowFirst == ShowFirst.HomingPigeon_4 or ShowSecond == ShowSecond.HomingPigeon_4 or ShowThird == ShowThird.HomingPigeon_4, 1, 0);

rec HomingPigeon_Trig = If(HomingPigeon().bullish , HomingPigeon(), HomingPigeon_Trig[1]);

AddLabel(HomingPigeon_Trig > 0  && showLabel_bull  && ThreeShows_4, "4=HomingPigeon" , CreateColor(0, 255, 0));

Alert(HomingPigeon() && !TurnAlertOff_bull, "HomingPigeon", Alert.BAR, Sound.Chimes);

AddChartBubble(HomingPigeon() && (BubVerb_bull or BubNumb_bull) && ThreeShows_4, low -15 ,  if BubNumb_bull

then "4" else if BubVerb_bull then "HomingPigeon" else "" , CreateColor(0, 255, 0)  , no);


#InvertedHammer_5,
###### 5 ####################### InvertedHammer() #############################
def ThreeShows_5 = If (ShowFirst == ShowFirst.InvertedHammer_5 or ShowSecond == ShowSecond.InvertedHammer_5 or ShowThird == ShowThird.InvertedHammer_5, 1, 0);

rec InvertedHammer_Trig = If(InvertedHammer().bullish , InvertedHammer(), InvertedHammer_Trig[1]);

AddLabel(InvertedHammer_Trig > 0  && showLabel_bull  && ThreeShows_5, "5=InvertedHammer" , CreateColor(0, 255, 0));

Alert(InvertedHammer() && !TurnAlertOff_bull, "InvertedHammer", Alert.BAR, Sound.Chimes);

AddChartBubble(InvertedHammer() && (BubVerb_bull or BubNumb_bull) && ThreeShows_5, low -15 ,  if BubNumb_bull

then "5" else if BubVerb_bull then "InvertedHammer" else "" , CreateColor(0, 255, 0)  , no);

#MatchingLow_6,
###### 6 ####################### MatchingLow() #############################
def ThreeShows_6 = If (ShowFirst == ShowFirst.MatchingLow_6 or ShowSecond == ShowSecond.MatchingLow_6 or ShowThird == ShowThird.MatchingLow_6, 1, 0);

rec MatchingLow_Trig = If(MatchingLow().bullish , MatchingLow(), MatchingLow_Trig[1]);

AddLabel(MatchingLow_Trig > 0  && showLabel_bull  && ThreeShows_6, "6=MatchingLow" , CreateColor(0, 255, 0));

Alert(MatchingLow() && !TurnAlertOff_bull, "MatchingLow", Alert.BAR, Sound.Chimes);

AddChartBubble(MatchingLow() && (BubVerb_bull or BubNumb_bull) && ThreeShows_6, low -15 ,  if BubNumb_bull

then "6" else if BubVerb_bull then "MatchingLow" else "" , CreateColor(0, 255, 0)  , no);

#MatHold_7,  #C
###### 7 ####################### MatHold() #############################
def ThreeShows_7 = If (ShowFirst == ShowFirst.MatHold_7 or ShowSecond == ShowSecond.MatHold_7 or ShowThird == ShowThird.MatHold_7, 1, 0);

rec MatHold_Trig = If(MatHold().bullish , MatHold(), MatHold_Trig[1]);

AddLabel(MatHold_Trig > 0  && showLabel_bull  && ThreeShows_7, "7=MatHold" , CreateColor(153, 255, 153));

Alert(MatHold() && !TurnAlertOff_bull, "MatHold", Alert.BAR, Sound.Chimes);

AddChartBubble(MatHold() && (BubVerb_bull or BubNumb_bull) && ThreeShows_7, low -15 ,  if BubNumb_bull

then "7" else if BubVerb_bull then "MatHold" else "" , CreateColor(153, 255, 153)  , no);



#MorningDojiStar_8,
###### 2 ####################### MorningDojiStar() #############################
def ThreeShows_8 = If (ShowFirst == ShowFirst.MorningDojiStar_8 or ShowSecond == ShowSecond.MorningDojiStar_8 or ShowThird == ShowThird.MorningDojiStar_8, 1, 0);

rec MorningDojiStar_Trig = If(MorningDojiStar().bullish , MorningDojiStar(), MorningDojiStar_Trig[1]);

AddLabel(MorningDojiStar_Trig > 0  && showLabel_bull  && ThreeShows_8, "8=MorningDojiStar" , CreateColor(0, 255, 0));

Alert(MorningDojiStar() && !TurnAlertOff_bull, "MorningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningDojiStar() && (BubVerb_bull or BubNumb_bull) && ThreeShows_8, low -15 ,  if BubNumb_bull

then "8" else if BubVerb_bull then "MorningDojiStar" else "" , CreateColor(0, 255, 0)  , no);



#MorningStar_9,
###### 9 ####################### MorningStar() #############################
def ThreeShows_9 = If (ShowFirst == ShowFirst.MorningStar_9 or ShowSecond == ShowSecond.MorningStar_9 or ShowThird == ShowThird.MorningStar_9, 1, 0);

rec MorningStar_Trig = If(MorningStar().bullish , MorningStar(), MorningStar_Trig[1]);

AddLabel(MorningStar_Trig > 0  && showLabel_bull  && ThreeShows_9, "9=MorningStar" , CreateColor(0, 255, 0));

Alert(MorningStar() && !TurnAlertOff_bull, "MorningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningStar() && (BubVerb_bull or BubNumb_bull) && ThreeShows_9, low -15 ,  if BubNumb_bull

then "9" else if BubVerb_bull then "MorningStar" else "" , CreateColor(0, 255, 0)  , no);



#OneWhiteSoldier_10,
###### 10 ####################### OneWhiteSoldier() #############################
def ThreeShows_10 = If (ShowFirst == ShowFirst.OneWhiteSoldier_10 or ShowSecond == ShowSecond.OneWhiteSoldier_10 or ShowThird == ShowThird.OneWhiteSoldier_10, 1, 0);

rec OneWhiteSoldier_Trig = If(OneWhiteSoldier().bullish , OneWhiteSoldier(), OneWhiteSoldier_Trig[1]);

AddLabel(OneWhiteSoldier_Trig > 0  && showLabel_bull  && ThreeShows_10, "10=OneWhiteSoldier" , CreateColor(0, 255, 0));

Alert(OneWhiteSoldier() && !TurnAlertOff_bull, "OneWhiteSoldier", Alert.BAR, Sound.Chimes);

AddChartBubble(OneWhiteSoldier() && (BubVerb_bull or BubNumb_bull) && ThreeShows_10, low -15 ,  if BubNumb_bull

then "10" else if BubVerb_bull then "OneWhiteSoldier" else "" , CreateColor(0, 255, 0)  , no);




#PiercingLine_11,
###### 11 ####################### PiercingLine() #############################
def ThreeShows_11 = If (ShowFirst == ShowFirst.PiercingLine_11 or ShowSecond == ShowSecond.PiercingLine_11 or ShowThird == ShowThird.PiercingLine_11, 1, 0);

rec PiercingLine_Trig = If(PiercingLine().bullish , PiercingLine(), Hammer_Trig[1]);

AddLabel(Hammer_Trig > 0  && showLabel_bull  && ThreeShows_11, "11=PiercingLine" , CreateColor(0, 255, 0));

Alert(PiercingLine() && !TurnAlertOff_bull, "PiercingLine", Alert.BAR, Sound.Chimes);

AddChartBubble(PiercingLine() && (BubVerb_bull or BubNumb_bull) && ThreeShows_11, low -15 ,  if BubNumb_bull

then "11" else if BubVerb_bull then "PiercingLine" else "" , CreateColor(0, 255, 0)  , no);



#RisingThreeMethods_12, #C
###### 12 ####################### RisingThreeMethods() #############################
def ThreeShows_12 = If (ShowFirst == ShowFirst.RisingThreeMethods_12 or ShowSecond == ShowSecond.RisingThreeMethods_12 or ShowThird == ShowThird.RisingThreeMethods_12, 1, 0);

rec RisingThreeMethods_Trig = If(RisingThreeMethods().bullish , RisingThreeMethods(), RisingThreeMethods_Trig[1]);

AddLabel(RisingThreeMethods_Trig > 0  && showLabel_bull  && ThreeShows_12, "3=RisingThreeMethods" , CreateColor(153, 255, 153));

Alert(RisingThreeMethods() && !TurnAlertOff_bull, "RisingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(RisingThreeMethods() && (BubVerb_bull or BubNumb_bull) && ThreeShows_12, low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "RisingThreeMethods" else "" , CreateColor(153, 255, 153)  , no);





#Sticksandwich_13,
###### 13 ####################### Sticksandwich() #############################
def ThreeShows_13 = If (ShowFirst == ShowFirst.Sticksandwich_13 or ShowSecond == ShowSecond.Sticksandwich_13 or ShowThird == ShowThird.Sticksandwich_13, 1, 0);

rec Sticksandwich_Trig = If(Sticksandwich().bullish , Sticksandwich(), Sticksandwich_Trig[1]);

AddLabel(Sticksandwich_Trig > 0  && showLabel_bull  && ThreeShows_13, "13=Sticksandwich" , CreateColor(0, 255, 0));

Alert(Sticksandwich() && !TurnAlertOff_bull, "Sticksandwich", Alert.BAR, Sound.Chimes);

AddChartBubble(Sticksandwich() && (BubVerb_bull or BubNumb_bull) && ThreeShows_13, low -15 ,  if BubNumb_bull

then "13" else if BubVerb_bull then "Sticksandwich" else "" , CreateColor(0, 255, 0)  , no);



#ThreeInsideUp_14,
###### 14 ####################### ThreeInsideUp() #############################
def ThreeShows_14 = If (ShowFirst == ShowFirst.ThreeInsideUp_14 or ShowSecond == ShowSecond.ThreeInsideUp_14 or ShowThird == ShowThird.ThreeInsideUp_14, 1, 0);

rec ThreeInsideUp_Trig = If(ThreeInsideUp().bullish , ThreeInsideUp(), ThreeInsideUp_Trig[1]);

AddLabel(ThreeInsideUp_Trig > 0  && showLabel_bull  && ThreeShows_14, "14=ThreeInsideUp" , CreateColor(0, 255, 0));

Alert(ThreeInsideUp() && !TurnAlertOff_bull, "ThreeInsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideUp() && (BubVerb_bull or BubNumb_bull) && ThreeShows_14, low -15 ,  if BubNumb_bull

then "14" else if BubVerb_bull then "ThreeInsideUp" else "" , CreateColor(0, 255, 0)  , no);




#ThreeOutsideUp_15,
###### 15 ####################### ThreeOutsideUp() #############################
def ThreeShows_15 = If (ShowFirst == ShowFirst.ThreeOutsideUp_15 or ShowSecond == ShowSecond.ThreeOutsideUp_15 or ShowThird == ShowThird.ThreeOutsideUp_15, 1, 0);

rec ThreeOutsideUp_Trig = If(ThreeOutsideUp().bullish , ThreeOutsideUp(), ThreeOutsideUp_Trig[1]);

AddLabel(ThreeOutsideUp_Trig > 0  && showLabel_bull  && ThreeShows_15, "15=ThreeOutsideUp" , CreateColor(0, 255, 0));

Alert(ThreeOutsideUp() && !TurnAlertOff_bull, "ThreeOutsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideUp() && (BubVerb_bull or BubNumb_bull) && ThreeShows_15, low -15 ,  if BubNumb_bull

then "15" else if BubVerb_bull then "ThreeOutsideUp" else "" , CreateColor(0, 255, 0)  , no);




#ThreeStarsInTheSouth_16,
###### 2 ####################### ThreeStarsInTheSouth() #############################
def ThreeShows_16 = If (ShowFirst == ShowFirst.ThreeStarsInTheSouth_16 or ShowSecond == ShowSecond.ThreeStarsInTheSouth_16 or ShowThird == ShowThird.ThreeStarsInTheSouth_16, 1, 0);

rec ThreeStarsInTheSouth_Trig = If(ThreeStarsInTheSouth().bullish , ThreeStarsInTheSouth(), ThreeStarsInTheSouth_Trig[1]);

AddLabel(ThreeStarsInTheSouth_Trig > 0  && showLabel_bull  && ThreeShows_16, "16=ThreeStarsInTheSouth" , CreateColor(0, 255, 0));

Alert(ThreeStarsInTheSouth() && !TurnAlertOff_bull, "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeStarsInTheSouth() && (BubVerb_bull or BubNumb_bull) && ThreeShows_16, low -15 ,  if BubNumb_bull

then "16" else if BubVerb_bull then "ThreeStarsInTheSouth" else "" , CreateColor(0, 255, 0)  , no);




#ThreeWhiteSoldiers_17,
###### 1 ####################### ThreeWhiteSoldiers() #############################
def ThreeShows_17 = If (ShowFirst == ShowFirst.ThreeWhiteSoldiers_17 or ShowSecond == ShowSecond.ThreeWhiteSoldiers_17 or ShowThird == ShowThird.ThreeWhiteSoldiers_17, 1, 0);

rec ThreeWhiteSoldiers_Trig = If(ThreeWhiteSoldiers().bullish , ThreeWhiteSoldiers(), ThreeWhiteSoldiers_Trig[1]);

AddLabel(ThreeWhiteSoldiers_Trig > 0  && showLabel_bull  && ThreeShows_17, "17=ThreeWhiteSoldiers" , CreateColor(0, 255, 0));

Alert(ThreeWhiteSoldiers() && !TurnAlertOff_bull, "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeWhiteSoldiers() && (BubVerb_bull or BubNumb_bull) && ThreeShows_17 , low -15 ,  if BubNumb_bull

then "17" else if BubVerb_bull then "ThreeWhiteSoldiers" else "" , CreateColor(0, 255, 0)  , no);




#UniqueThreeRiverBottom_18,
###### 18 ####################### UniqueThreeRiverBottom() #############################
def ThreeShows_18 = If (ShowFirst == ShowFirst.UniqueThreeRiverBottom_18 or ShowSecond == ShowSecond.UniqueThreeRiverBottom_18 or ShowThird == ShowThird.UniqueThreeRiverBottom_18, 1, 0);

rec UniqueThreeRiverBottom_Trig = If(UniqueThreeRiverBottom().bullish , UniqueThreeRiverBottom(), UniqueThreeRiverBottom_Trig[1]);

AddLabel(UniqueThreeRiverBottom_Trig > 0  && showLabel_bull  && ThreeShows_18, "18=UniqueThreeRiverBottom" , CreateColor(0, 255, 0));

Alert(UniqueThreeRiverBottom() && !TurnAlertOff_bull, "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);

AddChartBubble(UniqueThreeRiverBottom() && (BubVerb_bull or BubNumb_bull) && ThreeShows_1 , low -15 ,  if BubNumb_bull

then "18" else if BubVerb_bull then "UniqueThreeRiverBottom" else "" , CreateColor(0, 255, 0)  , no);



#UpsideGapThreeMethods_19, #C
###### 19 ####################### UpsideGapThreeMethods() #############################
def ThreeShows_19 = If (ShowFirst == ShowFirst.UpsideGapThreeMethods_19 or ShowSecond == ShowSecond.UpsideGapThreeMethods_19 or ShowThird == ShowThird.UpsideGapThreeMethods_19, 1, 0);

rec UpsideGapThreeMethods_Trig = If(UpsideGapThreeMethods().bullish , UpsideGapThreeMethods(), UpsideGapThreeMethods_Trig[1]);

AddLabel(UpsideGapThreeMethods_Trig > 0  && showLabel_bull  && ThreeShows_19, "19=UpsideGapThreeMethods" , CreateColor(153, 255, 153));

Alert(UpsideGapThreeMethods() && !TurnAlertOff_bull, "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapThreeMethods() && (BubVerb_bull or BubNumb_bull) && ThreeShows_19 , low -15 ,  if BubNumb_bull

then "19" else if BubVerb_bull then "UpsideGapThreeMethods" else "" , CreateColor(153, 255, 153)  , no);



#UpsideTasukiGap_20,    #C
###### 20 ####################### UpsideTasukiGap() #############################
def ThreeShows_20 = If (ShowFirst == ShowFirst.UpsideTasukiGap_20 or ShowSecond == ShowSecond.UpsideTasukiGap_20 or ShowThird == ShowThird.UpsideTasukiGap_20, 1, 0);

rec UpsideTasukiGap_Trig = If(UpsideTasukiGap().bullish , UpsideTasukiGap(), UpsideTasukiGap_Trig[1]);

AddLabel(UpsideTasukiGap_Trig > 0  && showLabel_bull  && ThreeShows_20, "20=UpsideTasukiGap" , CreateColor(153, 255, 153));

Alert(UpsideTasukiGap() && !TurnAlertOff_bull, "UpsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideTasukiGap() && (BubVerb_bull or BubNumb_bull) && ThreeShows_20 , low -15 ,  if BubNumb_bull

then "20" else if BubVerb_bull then "UpsideTasukiGap" else "" , CreateColor(153, 255, 153)  , no);


##################################################################################################################################


#ConcealingBabySwallow_1, # R
###### 1 ####################### ConcealingBabySwallow() #############################
def candleAll_1 =  If(ShowAll_bull == yes , ConcealingBabySwallow(), Double.NaN);

plot CBS = candleAll_1;

CBS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

CBS.SetDefaultColor(CreateColor(0, 255, 0));

CBS.SetLineWeight(5);

rec ConcealingBabySwallow_Trig_1 = If (ConcealingBabySwallow().bullish , + BarNumber(), ConcealingBabySwallow_Trig_1[1] );

AddLabel(ConcealingBabySwallow_Trig_1 > 0 && showLabel_bull && ShowAll_bull,  "1=ConcealingBabySwallow" , CreateColor(0, 255, 0));

Alert(ConcealingBabySwallow()  && !TurnAlertOff_bull && ShowAll_bull, "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);

AddChartBubble(ConcealingBabySwallow() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "1" else if BubVerb_bull then "ConcealingBabySwallow" else "" ,  CreateColor(0, 255, 0) , no);



#Hammer_2,    # R
###### 2 ####################### Hammer() #############################
def candleAll_2 =  If(ShowAll_bull == yes , Hammer(), Double.NaN);

plot Hammer = candleAll_2;

Hammer.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Hammer.SetDefaultColor(CreateColor(0, 255, 0));

Hammer.SetLineWeight(5);

rec Hammer_Trig_2 = If (Hammer().bullish , + BarNumber(), Hammer_Trig_2[1] );

AddLabel(Hammer_Trig_2 > 0 && showLabel_bull && ShowAll_bull,  "2=Hammer" , CreateColor(0, 255, 0));

Alert(Hammer()  && !TurnAlertOff_bull && ShowAll_bull, "Hammer", Alert.BAR, Sound.Chimes);

AddChartBubble(Hammer() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "2" else if BubVerb_bull then "Hammer" else "" ,  CreateColor(0, 255, 0) , no);




#HighPriceGappingPlay_3, #C
###### 3 ####################### HighPriceGappingPlay() & showAll #################################
def  candleAll_3 = If(ShowAll_bull == yes , HighPriceGappingPlay(), Double.NaN);

plot AB = candleAll_3;

AB.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

AB.SetDefaultColor(CreateColor(153, 255, 153));

AB.SetLineWeight(5);

rec HighPriceGappingPlay_Trig_3 = If (HighPriceGappingPlay().bullish, + BarNumber(), HighPriceGappingPlay_Trig_3[1] );

AddLabel(HighPriceGappingPlay_Trig_3 > 0 && showLabel_bull && ShowAll_bull, "3=HighPriceGappingPlay" , CreateColor(153, 255, 153));

Alert(HighPriceGappingPlay()  && !TurnAlertOff_bull && ShowAll_bull, "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(HighPriceGappingPlay() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "HighPriceGappingPlay" else "" ,  CreateColor(153, 255, 153) , no);





#HomingPigeon_4, #R
###### 4 ####################### HomingPigeon() & showAll #################################
def candleAll_4 =  If(ShowAll_bull == yes , HomingPigeon(), Double.NaN);

plot HP = candleAll_4;

HP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

HP.SetDefaultColor(CreateColor(0, 255, 0));

HP.SetLineWeight(5);

rec HomingPigeon_Trig_4 = If (HomingPigeon().bullish , + BarNumber(), HomingPigeon_Trig_4[1] );

AddLabel(HomingPigeon_Trig_4 > 0 && showLabel_bull && ShowAll_bull,  "4=HomingPigeon" , CreateColor(0, 255, 0));

Alert(HomingPigeon()  && !TurnAlertOff_bull && ShowAll_bull, "HomingPigeon", Alert.BAR, Sound.Chimes);

AddChartBubble(HomingPigeon() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "4" else if BubVerb_bull then "HomingPigeon" else "" ,  CreateColor(0, 255, 0) , no);



#InvertedHammer_5,
###### 5 ####################### InvertedHammer() #############################
def candleAll_5 =  If(ShowAll_bull == yes , InvertedHammer(), Double.NaN);

plot INVHammer = candleAll_5;

INVHammer.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

INVHammer.SetDefaultColor(CreateColor(0, 255, 0));

INVHammer.SetLineWeight(5);

rec InvertedHammer_Trig_5 = If (InvertedHammer().bullish , + BarNumber(), InvertedHammer_Trig_5[1] );

AddLabel(InvertedHammer_Trig_5 > 0 && showLabel_bull && ShowAll_bull,  "5=InvertedHammer" , CreateColor(0, 255, 0));

Alert(InvertedHammer()  && !TurnAlertOff_bull && ShowAll_bull, "InvertedHammer", Alert.BAR, Sound.Chimes);

AddChartBubble(InvertedHammer() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "5" else if BubVerb_bull then "InvertedHammer" else "" ,  CreateColor(0, 255, 0) , no);



#MatchingLow_6,
###### 6 ####################### MatchingLow() #############################
def candleAll_6 =  If(ShowAll_bull == yes , MatchingLow(), Double.NaN);

plot ML = candleAll_6;

ML.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

ML.SetDefaultColor(CreateColor(0, 255, 0));

ML.SetLineWeight(5);

rec MatchingLow_Trig_6 = If (MatchingLow().bullish , + BarNumber(), MatchingLow_Trig_6[1] );

AddLabel(MatchingLow_Trig_6 > 0 && showLabel_bull && ShowAll_bull,  "6=MatchingLow" , CreateColor(0, 255, 0));

Alert(MatchingLow()  && !TurnAlertOff_bull && ShowAll_bull, "MatchingLow", Alert.BAR, Sound.Chimes);

AddChartBubble(MatchingLow() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "6" else if BubVerb_bull then "MatchingLow" else "" ,  CreateColor(0, 255, 0) , no);





#MatHold_7, #C
###### 7 ####################### MatHold() #############################
def  candleAll_7 = If(ShowAll_bull == yes , MatHold(), Double.NaN);

plot MH = candleAll_7;

MH.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MH.SetDefaultColor(CreateColor(153, 255, 153));

MH.SetLineWeight(5);

rec MatHold_Trig_7 = If (MatHold().bullish, + BarNumber(), MatHold_Trig_7[1] );

AddLabel(MatHold_Trig_7 > 0 && showLabel_bull && ShowAll_bull, "7=MatHold" , CreateColor(153, 255, 153));

Alert(MatHold()  && !TurnAlertOff_bull && ShowAll_bull, "MatHold", Alert.BAR, Sound.Chimes);

AddChartBubble(MatHold() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "7" else if BubVerb_bull then "MatHold" else "" ,  CreateColor(153, 255, 153) , no);

#MorningDojiStar_8,
###### 2 ####################### MorningDojiStar() #############################
def candleAll_8 =  If(ShowAll_bull == yes , MorningDojiStar(), Double.NaN);

plot MDS = candleAll_8;

MDS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MDS.SetDefaultColor(CreateColor(0, 255, 0));

MDS.SetLineWeight(5);

rec MorningDojiStar_Trig_8 = If (MorningDojiStar().bullish , + BarNumber(), MorningDojiStar_Trig_8[1] );

AddLabel(MorningDojiStar_Trig_8 > 0 && showLabel_bull && ShowAll_bull,  "8=MorningDojiStar" , CreateColor(0, 255, 0));

Alert(MorningDojiStar()  && !TurnAlertOff_bull && ShowAll_bull, "MorningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningDojiStar() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "8" else if BubVerb_bull then "MorningDojiStar" else "" ,  CreateColor(0, 255, 0) , no);




#MorningStar_9,
###### 9 ####################### MorningStar() #############################
def candleAll_9 =  If(ShowAll_bull == yes , MorningStar(), Double.NaN);

plot MS = candleAll_9;

MS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MS.SetDefaultColor(CreateColor(0, 255, 0));

MS.SetLineWeight(5);

rec MorningStar_Trig_9 = If (MorningStar().bullish , + BarNumber(), MorningStar_Trig_9[1] );

AddLabel(MorningStar_Trig_9 > 0 && showLabel_bull && ShowAll_bull,  "9=MorningStar" , CreateColor(0, 255, 0));

Alert(MorningStar()  && !TurnAlertOff_bull && ShowAll_bull, "MorningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningStar() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "9" else if BubVerb_bull then "MorningStar" else "" ,  CreateColor(0, 255, 0) , no);


#OneWhiteSoldier_10,
###### 10 ####################### OneWhiteSoldier() #############################
def candleAll_10 =  If(ShowAll_bull == yes , OneWhiteSoldier(), Double.NaN);

plot OWS = candleAll_10;

OWS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

OWS.SetDefaultColor(CreateColor(0, 255, 0));

OWS.SetLineWeight(5);

rec OneWhiteSoldier_Trig_10 = If (OneWhiteSoldier().bullish , + BarNumber(), OneWhiteSoldier_Trig_10[1] );

AddLabel(OneWhiteSoldier_Trig_10 > 0 && showLabel_bull && ShowAll_bull,  "10=OneWhiteSoldier" , CreateColor(0, 255, 0));

Alert(OneWhiteSoldier()  && !TurnAlertOff_bull && ShowAll_bull, "OneWhiteSoldier", Alert.BAR, Sound.Chimes);

AddChartBubble(OneWhiteSoldier() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "10" else if BubVerb_bull then "OneWhiteSoldier" else "" ,  CreateColor(0, 255, 0) , no);



#PiercingLine_11,
###### 11 ####################### PiercingLine() #############################
def candleAll_11 =  If(ShowAll_bull == yes , PiercingLine(), Double.NaN);

plot PL = candleAll_11;

PL.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

PL.SetDefaultColor(CreateColor(0, 255, 0));

PL.SetLineWeight(5);

rec PiercingLine_Trig_11 = If (PiercingLine().bullish , + BarNumber(), PiercingLine_Trig_11[1] );

AddLabel(PiercingLine_Trig_11 > 0 && showLabel_bull && ShowAll_bull,  "11=PiercingLine" , CreateColor(0, 255, 0));

Alert(PiercingLine()  && !TurnAlertOff_bull && ShowAll_bull, "PiercingLine", Alert.BAR, Sound.Chimes);

AddChartBubble(PiercingLine() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "11" else if BubVerb_bull then "PiercingLine" else "" ,  CreateColor(0, 255, 0) , no);



#RisingThreeMethods_12, #C
###### 12 ####################### RisingThreeMethods() #############################
def  candleAll_12 = If(ShowAll_bull == yes , RisingThreeMethods(), Double.NaN);

plot RTM = candleAll_12;

RTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

RTM.SetDefaultColor(CreateColor(153, 255, 153));

RTM.SetLineWeight(5);

rec RisingThreeMethods_Trig_12 = If (RisingThreeMethods().bullish, + BarNumber(), RisingThreeMethods_Trig_12[1] );

AddLabel(RisingThreeMethods_Trig_12 > 0 && showLabel_bull && ShowAll_bull, "12=RisingThreeMethods" , CreateColor(153, 255, 153));

Alert(RisingThreeMethods()  && !TurnAlertOff_bull && ShowAll_bull, "RisingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(RisingThreeMethods() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "12" else if BubVerb_bull then "RisingThreeMethods" else "" ,  CreateColor(153, 255, 153) , no);



#Sticksandwich_13,
###### 13 ####################### Sticksandwich() #############################
def candleAll_13 =  If(ShowAll_bull == yes , Sticksandwich(), Double.NaN);

plot SS = candleAll_13;

SS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SS.SetDefaultColor(CreateColor(0, 255, 0));

SS.SetLineWeight(5);

rec Sticksandwich_Trig_13 = If (Sticksandwich().bullish , + BarNumber(), Sticksandwich_Trig_13[1] );

AddLabel(Sticksandwich_Trig_13 > 0 && showLabel_bull && ShowAll_bull,  "13=Sticksandwich" , CreateColor(0, 255, 0));

Alert(Sticksandwich()  && !TurnAlertOff_bull && ShowAll_bull, "Sticksandwich", Alert.BAR, Sound.Chimes);

AddChartBubble(Sticksandwich() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "13" else if BubVerb_bull then "Sticksandwich" else "" ,  CreateColor(0, 255, 0) , no);



#ThreeInsideUp_14,
###### 14 ####################### ThreeInsideUp() #############################
def candleAll_14 =  If(ShowAll_bull == yes , ThreeInsideUp(), Double.NaN);

plot TIU = candleAll_14;

TIU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TIU.SetDefaultColor(CreateColor(0, 255, 0));

TIU.SetLineWeight(5);

rec ThreeInsideUp_Trig_14 = If (ThreeInsideUp().bullish , + BarNumber(), ThreeInsideUp_Trig_14[1] );

AddLabel(ThreeInsideUp_Trig_14 > 0 && showLabel_bull && ShowAll_bull,  "14=ThreeInsideUp" , CreateColor(0, 255, 0));

Alert(ThreeInsideUp()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeInsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideUp() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "14" else if BubVerb_bull then "ThreeInsideUp" else "" ,  CreateColor(0, 255, 0) , no);



#ThreeOutsideUp_15,
###### 15 ####################### ThreeOutsideUp() #############################
def candleAll_15 =  If(ShowAll_bull == yes , ThreeOutsideUp(), Double.NaN);

plot TOU = candleAll_15;

TOU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TOU.SetDefaultColor(CreateColor(0, 255, 0));

TOU.SetLineWeight(5);

rec ThreeOutsideUp_Trig_15 = If (ThreeOutsideUp().bullish , + BarNumber(), ThreeOutsideUp_Trig_15[1] );

AddLabel(ThreeOutsideUp_Trig_15 > 0 && showLabel_bull && ShowAll_bull,  "15=ThreeOutsideUp" , CreateColor(0, 255, 0));

Alert(ThreeOutsideUp()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeOutsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideUp() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "15" else if BubVerb_bull then "ThreeOutsideUp" else "" ,  CreateColor(0, 255, 0) , no);




#ThreeStarsInTheSouth_16,
###### 16 ####################### ThreeStarsInTheSouth() #############################
def candleAll_16 =  If(ShowAll_bull == yes , ThreeStarsInTheSouth(), Double.NaN);

plot TSITS = candleAll_16;

TSITS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TSITS.SetDefaultColor(CreateColor(0, 255, 0));

TSITS.SetLineWeight(5);

rec ThreeStarsInTheSouth_Trig_16 = If (ThreeStarsInTheSouth().bullish , + BarNumber(), ThreeStarsInTheSouth_Trig_16[1] );

AddLabel(ThreeStarsInTheSouth_Trig_16 > 0 && showLabel_bull && ShowAll_bull,  "16=ThreeStarsInTheSouth" , CreateColor(0, 255, 0));

Alert(ThreeStarsInTheSouth()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeStarsInTheSouth() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "16" else if BubVerb_bull then "ThreeStarsInTheSouth" else "" ,  CreateColor(0, 255, 0) , no);


#ThreeWhiteSoldiers_17,
###### 17 ####################### ThreeWhiteSoldiers() #############################
def candleAll_17 =  If(ShowAll_bull == yes , ThreeWhiteSoldiers(), Double.NaN);

plot TWS = candleAll_17;

TWS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TWS.SetDefaultColor(CreateColor(0, 255, 0));

TWS.SetLineWeight(5);

rec ThreeWhiteSoldiers_Trig_17 = If (ThreeWhiteSoldiers().bullish , + BarNumber(), ThreeWhiteSoldiers_Trig_17[1] );

AddLabel(ThreeWhiteSoldiers_Trig_17 > 0 && showLabel_bull && ShowAll_bull,  "17=ThreeWhiteSoldiers" , CreateColor(0, 255, 0));

Alert(ThreeWhiteSoldiers()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeWhiteSoldiers() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "17" else if BubVerb_bull then "ThreeWhiteSoldiers" else "" ,  CreateColor(0, 255, 0) , no);



#UniqueThreeRiverBottom_18,
###### 18 ####################### UniqueThreeRiverBottom() #############################
def candleAll_18 =  If(ShowAll_bull == yes , UniqueThreeRiverBottom(), Double.NaN);

plot UTRB = candleAll_18;

UTRB.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UTRB.SetDefaultColor(CreateColor(0, 255, 0));

UTRB.SetLineWeight(5);

rec UniqueThreeRiverBottom_Trig_18 = If (UniqueThreeRiverBottom().bullish, + BarNumber(), UniqueThreeRiverBottom_Trig_18[1] );

AddLabel(UniqueThreeRiverBottom_Trig_18 > 0 && showLabel_bull && ShowAll_bull,  "18=UniqueThreeRiverBottom" , CreateColor(0, 255, 0));

Alert(UniqueThreeRiverBottom()  && !TurnAlertOff_bull && ShowAll_bull, "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);

AddChartBubble(UniqueThreeRiverBottom() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "18" else if BubVerb_bull then "UniqueThreeRiverBottom" else "" ,  CreateColor(0, 255, 0) , no);



#UpsideGapThreeMethods_19, #C
###### 19 ####################### UpsideGapThreeMethods() #############################
def  candleAll_19 = If(ShowAll_bull == yes , UpsideGapThreeMethods(), Double.NaN);

plot UGTM = candleAll_19;

UGTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UGTM.SetDefaultColor(CreateColor(153, 255, 153));

UGTM.SetLineWeight(5);

rec UpsideGapThreeMethods_Trig_19 = If (UpsideGapThreeMethods().bullish, + BarNumber(), UpsideGapThreeMethods_Trig_19[1] );

AddLabel(UpsideGapThreeMethods_Trig_19 > 0 && showLabel_bull && ShowAll_bull, "19=UpsideGapThreeMethods" , CreateColor(153, 255, 153));

Alert(UpsideGapThreeMethods()  && !TurnAlertOff_bull && ShowAll_bull, "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapThreeMethods() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "19" else if BubVerb_bull then "UpsideGapThreeMethods" else "" ,  CreateColor(153, 255, 153) , no);




#UpsideTasukiGap_20  #C
###### 20 ####################### UpsideTasukiGap() #############################
def  candleAll_20 = If(ShowAll_bull == yes , UpsideTasukiGap().bullish, Double.NaN);

plot UTG = candleAll_20;

UTG.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UTG.SetDefaultColor(CreateColor(153, 255, 153));

UTG.SetLineWeight(5);

rec UpsideTasukiGap_Trig_20 = If (UpsideTasukiGap().bullish, + BarNumber(), UpsideTasukiGap_Trig_20[1] );

AddLabel(UpsideTasukiGap_Trig_20 > 0 && showLabel_bull && ShowAll_bull, "20=UpsideTasukiGap" , CreateColor(153, 255, 153));

Alert(UpsideTasukiGap()  && !TurnAlertOff_bull && ShowAll_bull, "UpsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideTasukiGap() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "20" else if BubVerb_bull then "UpsideTasukiGap" else "" ,  CreateColor(153, 255, 153) , no);

The bear pattern is here but it needed a lot of work. So I stripped it down and started from scratch using the basic format, and here is the final product.

This is verbose bear only:
fOvmmzo.png


This is ID # bear only:
GjJ6mz8.png


This is select 3 to show example 1-verbose:
aodyGJ2.png


This is select 3 to show example 2-ID #: as you can see the choose display format works for both show all or pick n choose.
oNnav0N.png


Code Bear only:
Code:
#Bearish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021
#Report any problems to 'StanL' on TOS' ThinkScript Lounge
#Revision date 3:36 PM 9/29/2013


addlabel(yes, "Bearish Only Reversals",  createcolor(255, 0, 0));
addlabel(yes, "Bearish only Continuations: 4, 5, 8, 11, 12, 14, 19", createcolor(255, 153, 153));


input TurnAlertOff = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubble = {default none, Verbose, ID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.


def BubNone = If (showBubble == showBubble.none, 1, 0);

def BubVerb = If (showBubble == showBubble.Verbose, 1, 0);

def BubNumb =  If (showBubble == showBubble.ID_Number, 1, 0);

#####################################################

############ Define the three selection Enums #################

#####################################################

input ShowFirst =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show


input ShowSecond =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show


input ShowThird =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show

###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle;

switch (ShowFirst) {
case AdvanceBlock_1:

    candle = If(ShowFirst.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle =  If(ShowFirst.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle = If(ShowFirst.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle = If(ShowFirst.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle = If(ShowFirst.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle = If(ShowFirst.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle = If(ShowFirst.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle = If(ShowFirst.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle = If(ShowFirst.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle = If(ShowFirst.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle = If(ShowFirst.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle = If(ShowFirst.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle = If(ShowFirst.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle = If(ShowFirst.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle = If(ShowFirst.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle = If(ShowFirst.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle = If(ShowFirst.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle = If(ShowFirst.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle = If(ShowFirst.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle = If(ShowFirst.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle = If(ShowFirst.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle;

Show1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show1st.SetDefaultColor(Color.GREEN);

Show1st.SetLineWeight(5);
#####################################################

############ Process Input 'ShowSecond' Enum #################

#####################################################
def candle2;

switch (ShowSecond) {
case AdvanceBlock_1:

    candle2 = If(ShowSecond.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle2 =  If(ShowSecond.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle2 = If(ShowSecond.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle2 = If(ShowSecond.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle2 = If(ShowSecond.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle2 = If(ShowSecond.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle2 = If(ShowSecond.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle2 = If(ShowSecond.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle2 = If(ShowSecond.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle2 = If(ShowSecond.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle2 = If(ShowSecond.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle2 = If(ShowSecond.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle2 = If(ShowSecond.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle2 = If(ShowSecond.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle2 = If(ShowSecond.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle2 = If(ShowSecond.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle2 = If(ShowSecond.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle2 = If(ShowSecond.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle2 = If(ShowSecond.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle2 = If(ShowSecond.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle2 = If(ShowSecond.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle2 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;

Show2nd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show2nd.SetDefaultColor(Color.GREEN);

Show2nd.SetLineWeight(5);
###########################################################

############ Process Input 'Showthird' Enum ###############

###########################################################
def candle3;

switch (ShowThird) {
case AdvanceBlock_1:

    candle3 = If(ShowThird.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle3 =  If(ShowThird.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle3 = If(ShowThird.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle3 = If(ShowThird.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle3 = If(ShowThird.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle3 = If(ShowThird.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle3 = If(ShowThird.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle3 = If(ShowThird.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle3 = If(ShowThird.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle3 = If(ShowThird.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle3 = If(ShowThird.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle3 = If(ShowThird.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle3 = If(ShowThird.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle3 = If(ShowThird.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle3 = If(ShowThird.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle3 = If(ShowThird.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle3 = If(ShowThird.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle3 = If(ShowThird.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle3 = If(ShowThird.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle3 = If(ShowThird.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle3 = If(ShowThird.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle3 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;

Show3rd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show3rd.SetDefaultColor(Color.GREEN);

Show3rd.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

#AdvanceBlock_1,
###### 1 ####################### AdvanceBlock() #############################
def ThreeShows_1 = If (ShowFirst == ShowFirst.AdvanceBlock_1 or ShowSecond == ShowSecond.AdvanceBlock_1 or ShowThird == ShowThird.AdvanceBlock_1, 1, 0);

rec AdvancedB_Trig = If(AdvanceBlock().bearish , BarNumber(), AdvancedB_Trig[1]);

#Def AB_label = if(Trig_bar > 0, 1, 0);

AddLabel(AdvancedB_Trig > 0  && showLabel  && ThreeShows_1, "1=AdvanceBlock" , CreateColor(255, 0, 0));

Alert(AdvanceBlock() && !TurnAlertOff, "AdvanceBlockAlert", Alert.BAR, Sound.Chimes);

AddChartBubble(AdvanceBlock() && (BubVerb or BubNumb) && ThreeShows_1 , 15 + high ,  if BubNumb

then "1" else if BubVerb then "AdvanceBlock" else "" , CreateColor(255, 0, 0)  , yes);



#DarkcloudCover_2,
###### 2 ####################### DarkCloudCover() #################################
def ThreeShows_2 = If (ShowFirst == ShowFirst.DarkCloudCover_2 or ShowSecond == ShowSecond.DarkCloudCover_2 or ShowThird == ShowThird.DarkCloudCover_2, 1, 0);

rec DarkCloudCover_Trig = If(DarkCloudCover().bearish , BarNumber(), DarkCloudCover_Trig[1]);

AddLabel(DarkCloudCover_Trig > 0  && showLabel  && ThreeShows_2, "2=DarkCloudCover", CreateColor(255, 0, 0));

Alert(DarkCloudCover() && !TurnAlertOff, "DarkCloudCover Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DarkCloudCover() && (BubVerb or BubNumb) && ThreeShows_2, 15 + high ,  if BubNumb

then "2" else if BubVerb then "DarkCloudCover" else "" , CreateColor(255, 0, 0) , yes);



#Deliberation_3,
###### 3 ####################### Deliberation() #################################
def ThreeShows_3 = If (ShowFirst == ShowFirst.Deliberation_3 or ShowSecond == ShowSecond.Deliberation_3 or ShowThird == ShowThird.Deliberation_3, 1, 0);

rec Deliberation_Trig = If(Deliberation().bearish , BarNumber(), Deliberation_Trig[1]);

AddLabel(Deliberation_Trig > 0  && showLabel  && ThreeShows_3, "3=Deliberation", CreateColor(255, 0, 0));

Alert(Deliberation() && !TurnAlertOff, "Deliberation Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(Deliberation() && (BubVerb or BubNumb) && ThreeShows_3, 15 + high ,  if BubNumb

then "3" else if BubVerb then "Deliberation" else "" , CreateColor(255, 0, 0) , yes);




# DownsideGapThreeMethods_4,   #C
###### 4 ####################### DownsideGapThreeMethods() #################################
def ThreeShows_4 = If (ShowFirst == ShowFirst.DownsideGapThreeMethods_4 or ShowSecond == ShowSecond.DownsideGapThreeMethods_4 or ShowThird == ShowThird.DownsideGapThreeMethods_4, 1, 0);

rec DownsideGapThreeMethods_Trig = If(DownsideGapThreeMethods().bearish , BarNumber(), DownsideGapThreeMethods_Trig[1]);

AddLabel(DownsideGapThreeMethods_Trig > 0  && showLabel  && ThreeShows_4, "4=DownsideGapThreeMethods", CreateColor(255, 153, 153));

Alert(DownsideGapThreeMethods() && !TurnAlertOff, "DownsideGapThreeMethods Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideGapThreeMethods() && (BubVerb or BubNumb) && ThreeShows_4, 15 + high ,  if BubNumb

then "4" else if BubVerb then "DownsideGapThreeMethods" else "" , CreateColor(255, 153, 153) , yes);




#DownsideTasukiGap_5, #C
###### 5 ####################### DownsideTasukiGap() #################################
def ThreeShows_5 = If (ShowFirst == ShowFirst.DownsideTasukiGap_5 or ShowSecond == ShowSecond.DownsideTasukiGap_5 or ShowThird == ShowThird.DownsideTasukiGap_5, 1, 0);

rec DownsideTasukiGap_Trig = If(DownsideTasukiGap().bearish , BarNumber(), DownsideTasukiGap_Trig[1]);

AddLabel(DownsideTasukiGap_Trig > 0  && showLabel  && ThreeShows_5, "5=DownsideTasukiGap", CreateColor(255, 153, 153));

Alert(DownsideTasukiGap() && !TurnAlertOff, "DownsideTasukiGap Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideTasukiGap() && (BubVerb or BubNumb) && ThreeShows_5, 15 + high ,  if BubNumb

then "5" else if BubVerb then "DownsideTasukiGap" else "" , CreateColor(255, 153, 153) , yes);


#EveningDojiStar_6,  
###### 6 ####################### EveningDojiStar() #################################
def ThreeShows_6 = If (ShowFirst == ShowFirst.EveningDojiStar_6 or ShowSecond == ShowSecond.EveningDojiStar_6 or ShowThird == ShowThird.EveningDojiStar_6, 1, 0);

rec EveningDojiStar_Trig = If(EveningDojiStar().bearish , BarNumber(), EveningDojiStar_Trig[1]);

AddLabel(EveningDojiStar_Trig > 0  && showLabel  && ThreeShows_6, "6=EveningDojiStar", CreateColor(255, 0, 0));

Alert(EveningDojiStar() && !TurnAlertOff, "EveningDojiStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningDojiStar() && (BubVerb or BubNumb) && ThreeShows_6, 15 + high ,  if BubNumb

then "6" else if BubVerb then "EveningDojiStar" else "" , CreateColor(255, 0, 0) , yes);



#EveningStar_7,  
###### 7 ####################### EveningStar() #################################
def ThreeShows_7 = If (ShowFirst == ShowFirst.EveningStar_7 or ShowSecond == ShowSecond.EveningStar_7 or ShowThird == ShowThird.EveningStar_7, 1, 0);

rec EveningStar_Trig = If(EveningStar().bearish , BarNumber(), EveningStar_Trig[1]);

AddLabel(EveningStar_Trig > 0  && showLabel  && ThreeShows_7, "7=EveningStar", CreateColor(255, 0, 0));

Alert(EveningStar() && !TurnAlertOff, "EveningStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningStar() && (BubVerb or BubNumb) && ThreeShows_7, 15 + high ,  if BubNumb

then "7" else if BubVerb then "EveningStar" else "" , CreateColor(255, 0, 0) , yes);



#FallingThreeMethods_8, #C
###### 8 ####################### FallingThreeMethods() #################################
def ThreeShows_8 = If (ShowFirst == ShowFirst.FallingThreeMethods_8 or ShowSecond == ShowSecond.FallingThreeMethods_8 or ShowThird == ShowThird.FallingThreeMethods_8, 1, 0);

rec FallingThreeMethods_Trig = If(FallingThreeMethods().bearish , BarNumber(), FallingThreeMethods_Trig[1]);

AddLabel(FallingThreeMethods_Trig > 0  && showLabel  && ThreeShows_8, "8=FallingThreeMethods", CreateColor(255, 153, 153));

Alert(FallingThreeMethods() && !TurnAlertOff, "FallingThreeMethods Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(FallingThreeMethods() && (BubVerb or BubNumb) && ThreeShows_8, 15 + high ,  if BubNumb

then "8" else if BubVerb then "FallingThreeMethods" else "" , CreateColor(255, 153, 153) , yes);




#HangingMan_9,  
###### 9 ####################### HangingMan() #################################
def ThreeShows_9 = If (ShowFirst == ShowFirst.HangingMan_9 or ShowSecond == ShowSecond.HangingMan_9 or ShowThird == ShowThird.HangingMan_9, 1, 0);

rec HangingMan_Trig = If(HangingMan().bearish , BarNumber(), HangingMan_Trig[1]);

AddLabel(HangingMan_Trig > 0  && showLabel  && ThreeShows_9, "9=HangingMan", CreateColor(255, 0, 0));

Alert(HangingMan() && !TurnAlertOff, "HangingMan Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(HangingMan() && (BubVerb or BubNumb) && ThreeShows_9,  15 + high,  if BubNumb

then "9" else if BubVerb then "HangingMan" else "" , CreateColor(255, 0, 0), yes);



#IdenticalThreeCrows_10,  
###### 10 ####################### IdenticalThreeCrows() #################################
def ThreeShows_10 = If (ShowFirst == ShowFirst.IdenticalThreeCrows_10 or ShowSecond == ShowSecond.IdenticalThreeCrows_10 or ShowThird == ShowThird.IdenticalThreeCrows_10, 1, 0);

rec IdenticalThreeCrows_Trig = If(IdenticalThreeCrows().bearish , BarNumber(), IdenticalThreeCrows_Trig[1]);

AddLabel(IdenticalThreeCrows_Trig > 0  && showLabel  && ThreeShows_10, "10=IdenticalThreeCrows", CreateColor(255, 0, 0));

Alert(IdenticalThreeCrows() && !TurnAlertOff, "IdenticalThreeCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(IdenticalThreeCrows() && (BubVerb or BubNumb) && ThreeShows_10, 15 + high ,  if BubNumb

then "10" else if BubVerb then "IdenticalThreeCrows" else "" , CreateColor(255, 0, 0) , yes);



#InNeck_11,    #C
###### 11 ####################### InNeck() #################################
def ThreeShows_11 = If (ShowFirst == ShowFirst.InNeck_11 or ShowSecond == ShowSecond.InNeck_11 or ShowThird == ShowThird.InNeck_11, 1, 0);

rec InNeck_Trig = If(InNeck().bearish , BarNumber(), InNeck_Trig[1]);

AddLabel(InNeck_Trig > 0  && showLabel  && ThreeShows_11, "11=InNeck", CreateColor(255, 153, 153));

Alert(InNeck() && !TurnAlertOff, "InNeck Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(InNeck() && (BubVerb or BubNumb) && ThreeShows_11, 15 + high ,  if BubNumb

then "11" else if BubVerb then "InNeck" else "" , CreateColor(255, 153, 153) , yes);




#LowPriceGappingPlay_12, #C
###### 12 ####################### LowPriceGappingPlay() #################################
def ThreeShows_12 = If (ShowFirst == ShowFirst.LowPriceGappingPlay_12 or ShowSecond == ShowSecond.LowPriceGappingPlay_12 or ShowThird == ShowThird.LowPriceGappingPlay_12, 1, 0);

rec LowPriceGappingPlay_Trig = If(LowPriceGappingPlay().bearish , BarNumber(), LowPriceGappingPlay_Trig[1]);

AddLabel(LowPriceGappingPlay_Trig > 0  && showLabel  && ThreeShows_12, "12=LowPriceGappingPlay", CreateColor(255, 153, 153));

Alert(LowPriceGappingPlay() && !TurnAlertOff, "LowPriceGappingPlay Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(LowPriceGappingPlay() && (BubVerb or BubNumb) && ThreeShows_12, 15 + high ,  if BubNumb

then "12" else if BubVerb then "LowPriceGappingPlay" else "" , CreateColor(255, 153, 153) , yes);



#OneBlackCrow_13,
###### 13 ####################### OneBlackCrow() #################################
def ThreeShows_13 = If (ShowFirst == ShowFirst.OneBlackCrow_13 or ShowSecond == ShowSecond.OneBlackCrow_13 or ShowThird == ShowThird.OneBlackCrow_13, 1, 0);

rec OneBlackCrow_Trig = If(OneBlackCrow().bearish , BarNumber(), OneBlackCrow_Trig[1]);

AddLabel(OneBlackCrow_Trig > 0  && showLabel  && ThreeShows_13, "13=OneBlackCrow", CreateColor(255, 0, 0));

Alert(OneBlackCrow() && !TurnAlertOff, "OneBlackCrow Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(OneBlackCrow() && (BubVerb or BubNumb) && ThreeShows_13, 15 + high ,  if BubNumb

then "13" else if BubVerb then "OneBlackCrow" else "" , CreateColor(255, 0, 0) , yes);



#OnNeck_14, #C
###### 14 ####################### OnNeck() #################################
def ThreeShows_14 = If (ShowFirst == ShowFirst.OnNeck_14 or ShowSecond == ShowSecond.OnNeck_14 or ShowThird == ShowThird.OnNeck_14, 1, 0);

rec OnNeck_Trig = If(OnNeck().bearish , BarNumber(), OnNeck_Trig[1]);

AddLabel(OnNeck_Trig > 0  && showLabel  && ThreeShows_14, "14=OnNeck", CreateColor(255, 153, 153));

Alert(OnNeck() && !TurnAlertOff, "OnNeck Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(OnNeck() && (BubVerb or BubNumb) && ThreeShows_14, 15 + high ,  if BubNumb

then "14" else if BubVerb then "OnNeck" else "" , CreateColor(255, 153, 153) , yes);



#ShootingStar_15,
###### 15 ####################### ShootingStar() #################################
def ThreeShows_15 = If (ShowFirst == ShowFirst.ShootingStar_15 or ShowSecond == ShowSecond.ShootingStar_15 or ShowThird == ShowThird.ShootingStar_15, 1, 0);

rec ShootingStar_Trig = If(ShootingStar().bearish , BarNumber(), ShootingStar_Trig[1]);

AddLabel(ShootingStar_Trig > 0  && showLabel  && ThreeShows_15, "15=ShootingStar", CreateColor(255, 0, 0));

Alert(ShootingStar() && !TurnAlertOff, "ShootingStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ShootingStar() && (BubVerb or BubNumb) && ThreeShows_15, 15 + high ,  if BubNumb

then "15" else if BubVerb then "ShootingStar" else "" , CreateColor(255, 0, 0) , yes);



#ThreeBlackCrows_16,
###### 16 ####################### ThreeBlackCrows() #################################
def ThreeShows_16 = If (ShowFirst == ShowFirst.ThreeBlackCrows_16 or ShowSecond == ShowSecond.ThreeBlackCrows_16 or ShowThird == ShowThird.ThreeBlackCrows_16, 1, 0);

rec ThreeBlackCrows_Trig = If(ThreeBlackCrows().bearish , BarNumber(), ThreeBlackCrows_Trig[1]);

AddLabel(ThreeBlackCrows_Trig > 0  && showLabel  && ThreeShows_16, "16=ThreeBlackCrows", CreateColor(255, 0, 0));

Alert(ThreeBlackCrows() && !TurnAlertOff, "ThreeBlackCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeBlackCrows() && (BubVerb or BubNumb) && ThreeShows_16, 15 + high ,  if BubNumb

then "16" else if BubVerb then "ThreeBlackCrows" else "" , CreateColor(255, 0, 0) , yes);




#ThreeInsideDown_17,
###### 17 ####################### ThreeInsideDown() #################################
def ThreeShows_17 = If (ShowFirst == ShowFirst.ThreeInsideDown_17 or ShowSecond == ShowSecond.ThreeInsideDown_17 or ShowThird == ShowThird.ThreeInsideDown_17, 1, 0);

rec ThreeInsideDown_Trig = If(DarkCloudCover().bearish , BarNumber(), ThreeInsideDown_Trig[1]);

AddLabel(ThreeInsideDown_Trig > 0  && showLabel  && ThreeShows_17, "17=ThreeInsideDown", Color.GREEN);

Alert(ThreeInsideDown() && !TurnAlertOff, "ThreeInsideDown Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideDown() && (BubVerb or BubNumb) && ThreeShows_17, 15 + high ,  if BubNumb

then "17" else if BubVerb then "ThreeInsideDown" else "" , CreateColor(255, 0, 0) , yes);



#ThreeOutsideDown_18,
###### 18 ####################### ThreeOutsideDown() #################################
def ThreeShows_18 = If (ShowFirst == ShowFirst.ThreeOutsideDown_18 or ShowSecond == ShowSecond.ThreeOutsideDown_18 or ShowThird == ShowThird.ThreeOutsideDown_18, 1, 0);

rec ThreeOutsideDown_Trig = If(DarkCloudCover().bearish , BarNumber(), ThreeOutsideDown_Trig[1]);

AddLabel(ThreeOutsideDown_Trig > 0  && showLabel  && ThreeShows_18, "18=ThreeOutsideDown", CreateColor(255, 0, 0));

Alert(ThreeOutsideDown() && !TurnAlertOff, "ThreeOutsideDown Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideDown() && (BubVerb or BubNumb) && ThreeShows_18, 15 + high ,  if BubNumb

then "18" else if BubVerb then "ThreeOutsideDown" else "" , CreateColor(255, 0, 0) , yes);






#Thrusting_19, #C
###### 19 ####################### Thrusting() #################################
def ThreeShows_19 = If (ShowFirst == ShowFirst.Thrusting_19 or ShowSecond == ShowSecond.Thrusting_19 or ShowThird == ShowThird.Thrusting_19, 1, 0);

rec Thrusting_Trig = If(DarkCloudCover().bearish , BarNumber(), Thrusting_Trig[1]);

AddLabel(Thrusting_Trig > 0  && showLabel  && ThreeShows_19, "19=Thrusting", CreateColor(255, 153, 153));

Alert(Thrusting() && !TurnAlertOff, "Thrusting Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(Thrusting() && (BubVerb or BubNumb) && ThreeShows_19, 15 + high ,  if BubNumb

then "19" else if BubVerb then "Thrusting" else "" , CreateColor(255, 153, 153) , yes);



#TwoCrows_20,
###### 20 ####################### TwoCrows() #################################
def ThreeShows_20 = If (ShowFirst == ShowFirst.TwoCrows_20 or ShowSecond == ShowSecond.TwoCrows_20 or ShowThird == ShowThird.TwoCrows_20, 1, 0);

rec TwoCrows_Trig = If(TwoCrows().bearish , BarNumber(), TwoCrows_Trig[1]);

AddLabel(TwoCrows_Trig > 0  && showLabel  && ThreeShows_20, "20=TwoCrows", CreateColor(255, 0, 0));

Alert(TwoCrows() && !TurnAlertOff, "TwoCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(TwoCrows() && (BubVerb or BubNumb) && ThreeShows_20, 15 + high ,  if BubNumb

then "20" else if BubVerb then "TwoCrows" else "" , CreateColor(255, 0, 0) , yes);



#UpsideGapTwoCrows_21};
###### 21 ####################### UpsideGapTwoCrows() #################################
def ThreeShows_21 = If (ShowFirst == ShowFirst.UpsideGapTwoCrows_21 or ShowSecond == ShowSecond.UpsideGapTwoCrows_21 or ShowThird == ShowThird.UpsideGapTwoCrows_21, 1, 0);

rec UpsideGapTwoCrows_Trig = If(DarkCloudCover().bearish , BarNumber(), UpsideGapTwoCrows_Trig[1]);

AddLabel(UpsideGapTwoCrows_Trig > 0  && showLabel  && ThreeShows_21, "21=UpsideGapTwoCrows", CreateColor(255, 0, 0));

Alert(UpsideGapTwoCrows() && !TurnAlertOff, "UpsideGapTwoCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapTwoCrows() && (BubVerb or BubNumb) && ThreeShows_21, 15 + high ,  if BubNumb

then "21" else if BubVerb then "UpsideGapTwoCrows" else "" , CreateColor(255, 0, 0) , yes);




#############################################################################

############## Processing 'Show All' = yes #######################

#############################################################################
###all adjustments to bubble locations are imput using this second section and the placement is in the second section



# AdvanceBlock_1, #R
###### 1 ####################### AdvanceBlock() & showAll #################################
def  candleAll_41 = If(ShowAll == yes , AdvanceBlock(), Double.NaN);

plot AdvBlk = candleAll_41;

AdvBlk.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AdvBlk.SetDefaultColor(CreateColor(255, 0, 0));

AdvBlk.SetLineWeight(5);

rec AdvanceBlock_Trig_41 = If (AdvanceBlock().bearish, + BarNumber(), AdvanceBlock_Trig_41[1] );

AddLabel(AdvanceBlock_Trig_41 > 0 && showLabel && ShowAll, "1=AdvanceBlock" , CreateColor(255, 0, 0));

Alert(AdvanceBlock()  && !TurnAlertOff && ShowAll, "AdvanceBlock", Alert.BAR, Sound.Chimes);

AddChartBubble(AdvanceBlock() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "1" else if BubVerb then "AdvanceBlock" else "" ,  CreateColor(255, 0, 0) , yes);



#DarkCloudCover_2, #R
###### 2 ####################### DarkCloudCover() & showAll #################################
def candleAll_42 =  If(ShowAll == yes , DarkCloudCover(), Double.NaN);

plot DCC = candleAll_42;

DCC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DCC.SetDefaultColor(CreateColor(255, 0, 0));

DCC.SetLineWeight(5);

rec DarkCloudCover_Trig_42 = If (DarkCloudCover().bearish , + BarNumber(), DarkCloudCover_Trig_42[1] );

AddLabel(DarkCloudCover_Trig_42 > 0 && showLabel && ShowAll,  "2=DarkCloudCover" , CreateColor(255, 0, 0));

Alert(DarkCloudCover()  && !TurnAlertOff && ShowAll, "DarkCloudCover", Alert.BAR, Sound.Chimes);

AddChartBubble(DarkCloudCover() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "2" else if BubVerb then "DarkCloudCover" else "" ,  CreateColor(255, 0, 0) , yes);



#Deliberation_3, #R
###### 3 ####################### Deliberation() & showAll #################################
def  candleAll_43 = If(ShowAll == yes , Deliberation(), Double.NaN);

plot Delib = candleAll_43;

Delib.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Delib.SetDefaultColor(CreateColor(255, 0, 0));

Delib.SetLineWeight(5);

rec Deliberation_Trig_43 = If (Deliberation().bearish, + BarNumber(), Deliberation_Trig_43[1] );

AddLabel(Deliberation_Trig_43 > 0 && showLabel && ShowAll, "3=Deliberation" , CreateColor(255, 0, 0));

Alert(Deliberation()  && !TurnAlertOff && ShowAll, "Deliberation", Alert.BAR, Sound.Chimes);

AddChartBubble(Deliberation() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "3" else if BubVerb then "Deliberation" else "" ,  CreateColor(255, 0, 0) , yes);



#DownsideGapThreeMethods_4, #C
###### 4 ####################### DownsideGapThreeMethods() & showAll #################################
def candleAll_44 =  If(ShowAll == yes , DownsideGapThreeMethods(), Double.NaN);

plot DGTM = candleAll_44;

DGTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DGTM.SetDefaultColor(CreateColor(255, 153, 153));

DGTM.SetLineWeight(5);

rec DownsideGapThreeMethods_Trig_44 = If (DownsideGapThreeMethods().bearish , + BarNumber(), DownsideGapThreeMethods_Trig_44[1] );

AddLabel(DownsideGapThreeMethods_Trig_44 > 0 && showLabel && ShowAll,  "4=DownsideGapThreeMethods" , CreateColor(255, 153, 153));

Alert(DownsideGapThreeMethods()  && !TurnAlertOff && ShowAll, "DownsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideGapThreeMethods() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "4" else if BubVerb then "DownsideGapThreeMethods" else "" ,  CreateColor(255, 153, 153) , yes);



# DownsideTasukiGap_5, #C
###### 5 ####################### DownsideTasukiGap() & showAll #################################
def candleAll_45 =  If(ShowAll == yes , DownsideTasukiGap(), Double.NaN);

plot DTG = candleAll_45;

DTG.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DTG.SetDefaultColor(CreateColor(255, 153, 153));

DTG.SetLineWeight(5);

rec DownsideTasukiGap_Trig_45 = If (DownsideTasukiGap().bearish , + BarNumber(), DownsideTasukiGap_Trig_45[1] );

AddLabel(DownsideTasukiGap_Trig_45 > 0 && showLabel && ShowAll,  "5=DownsideTasukiGap" , CreateColor(255, 153, 153));

Alert(DownsideTasukiGap()  && !TurnAlertOff && ShowAll, "DownsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideTasukiGap() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "5" else if BubVerb then "DownsideTasukiGap" else "" ,  CreateColor(255, 153, 153) , yes);


#EveningDojiStar_6, #R
###### 6 ####################### EveningDojiStar() & showAll #################################
def candleAll_46 =  If(ShowAll == yes , EveningDojiStar(), Double.NaN);

plot EDS = candleAll_46;

EDS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

EDS.SetDefaultColor(CreateColor(255, 0, 0));

EDS.SetLineWeight(5);

rec EveningDojiStar_Trig_46 = If (EveningDojiStar().bearish , + BarNumber(), EveningDojiStar_Trig_46[1] );

AddLabel(EveningDojiStar_Trig_46 > 0 && showLabel && ShowAll,  "6=EveningDojiStar" , CreateColor(255, 0, 0));

Alert(EveningDojiStar()  && !TurnAlertOff && ShowAll, "EveningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningDojiStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "6" else if BubVerb then "EveningDojiStar" else "" ,  CreateColor(255, 0, 0) , yes);



#EveningStar_7, #R
###### 7 ####################### EveningStar() & showAll #################################
def candleAll_47 =  If(ShowAll == yes , EveningStar(), Double.NaN);

plot ES = candleAll_47;

ES.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ES.SetDefaultColor(CreateColor(255, 0, 0));

ES.SetLineWeight(5);

rec EveningStar_Trig_47 = If (EveningStar().bearish , + BarNumber(), EveningStar_Trig_47[1] );

AddLabel(EveningStar_Trig_47 > 0 && showLabel && ShowAll,  "7=EveningStar" , CreateColor(255, 0, 0));

Alert(EveningStar()  && !TurnAlertOff && ShowAll, "EveningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "7" else if BubVerb then "EveningStar" else "" ,  CreateColor(255, 0, 0) , yes);



#FallingThreeMethods_8,   #C
###### 8 ####################### FallingThreeMethods() & showAll #################################
def candleAll_48 =  If(ShowAll == yes , FallingThreeMethods(), Double.NaN);

plot FTM = candleAll_48;

FTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

FTM.SetDefaultColor(CreateColor(255, 153, 153));

FTM.SetLineWeight(5);

rec FallingThreeMethods_Trig_48 = If (FallingThreeMethods().bearish , + BarNumber(), FallingThreeMethods_Trig_48[1] );

AddLabel(FallingThreeMethods_Trig_48 > 0 && showLabel && ShowAll,  "8=FallingThreeMethods" , CreateColor(255, 153, 153));

Alert(FallingThreeMethods()  && !TurnAlertOff && ShowAll, "FallingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(FallingThreeMethods() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "8" else if BubVerb then "FallingThreeMethods" else "" ,  CreateColor(255, 153, 153) , yes);



#HangingMan_9, #R
###### 9 ####################### HangingMan() & showAll #################################
def candleAll_49 =  If(ShowAll == yes , HangingMan(), Double.NaN);

plot HM = candleAll_49;

HM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

HM.SetDefaultColor(CreateColor(255, 0, 0));

HM.SetLineWeight(5);

rec HangingMan_Trig_49 = If (HangingMan().bearish , + BarNumber(), HangingMan_Trig_49[1] );

AddLabel(HangingMan_Trig_49 > 0 && showLabel && ShowAll,  "9=HangingMan" , CreateColor(255, 0, 0));

Alert(HangingMan()  && !TurnAlertOff && ShowAll, "HangingMan", Alert.BAR, Sound.Chimes);

AddChartBubble(HangingMan() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "9" else if BubVerb then "HangingMan" else "" ,  CreateColor(255, 0, 0) , yes);



#IdenticalThreeCrows_10, #R
###### 10 ####################### IdenticalThreeCrows() & showAll #################################
def candleAll_50 =  If(ShowAll == yes , IdenticalThreeCrows(), Double.NaN);

plot ITC = candleAll_50;

ITC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ITC.SetDefaultColor(CreateColor(255, 0, 0));

ITC.SetLineWeight(5);

rec IdenticalThreeCrows_Trig_50 = If (IdenticalThreeCrows().bearish , + BarNumber(), IdenticalThreeCrows_Trig_50[1] );

AddLabel(IdenticalThreeCrows_Trig_50 > 0 && showLabel && ShowAll,  "10=IdenticalThreeCrows" , CreateColor(255, 0, 0));

Alert(IdenticalThreeCrows()  && !TurnAlertOff && ShowAll, "IdenticalThreeCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(IdenticalThreeCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "10" else if BubVerb then "IdenticalThreeCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#InNeck_11, # C
###### 11 ####################### InNeck() & showAll #################################
def candleAll_51 =  If(ShowAll == yes , InNeck(), Double.NaN);

plot IN = candleAll_51;

IN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

IN.SetDefaultColor(CreateColor(255, 153, 153));

IN.SetLineWeight(5);

rec InNeck_Trig_52 = If (InNeck().bearish , + BarNumber(), InNeck_Trig_52[1] );

AddLabel(InNeck_Trig_52 > 0 && showLabel && ShowAll,  "11=InNeck" , CreateColor(255, 153, 153));

Alert(InNeck()  && !TurnAlertOff && ShowAll, "InNeck", Alert.BAR, Sound.Chimes);

AddChartBubble(InNeck() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "11" else if BubVerb then "InNeck" else "" ,  CreateColor(255, 153, 153) , yes);



#LowPriceGappingPlay_12, # C
###### 12 ####################### LowPriceGappingPlay() & showAll #################################
def candleAll_52 =  If(ShowAll == yes , LowPriceGappingPlay(), Double.NaN);

plot LPGP = candleAll_52;

LPGP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

LPGP.SetDefaultColor(CreateColor(255, 153, 153));

LPGP.SetLineWeight(5);

rec LowPriceGappingPlay_Trig_52 = If (LowPriceGappingPlay().bearish , + BarNumber(), LowPriceGappingPlay_Trig_52[1] );

AddLabel(LowPriceGappingPlay_Trig_52 > 0 && showLabel && ShowAll,  "12=LowPriceGappingPlay" , CreateColor(255, 153, 153));

Alert(LowPriceGappingPlay()  && !TurnAlertOff && ShowAll, "LowPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(LowPriceGappingPlay() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "12" else if BubVerb then "LowPriceGappingPlay" else "" ,  CreateColor(255, 153, 153) , yes);



#OneBlackCrow_13, # R
###### 13 ####################### OneBlackCrow() & showAll #################################
def candleAll_53 =  If(ShowAll == yes , OneBlackCrow(), Double.NaN);

plot OBC = candleAll_53;

OBC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

OBC.SetDefaultColor(CreateColor(255, 0, 0));

OBC.SetLineWeight(5);

rec OneBlackCrow_Trig_53 = If (OneBlackCrow().bearish , + BarNumber(), OneBlackCrow_Trig_53[1] );

AddLabel(OneBlackCrow_Trig_53 > 0 && showLabel && ShowAll,  "13=OneBlackCrow" , CreateColor(255, 0, 0));

Alert(OneBlackCrow()  && !TurnAlertOff && ShowAll, "OneBlackCrow", Alert.BAR, Sound.Chimes);

AddChartBubble(OneBlackCrow() && (BubVerb or BubNumb) && (ShowAll) , 15 +  high ,  if BubNumb

then "13" else if BubVerb then "OneBlackCrow" else "" ,  CreateColor(255, 0, 0) , yes);



#OnNeck_14, # C
###### 14 ####################### OnNeck() & showAll #################################
def candleAll_54 =  If(ShowAll == yes , OnNeck(), Double.NaN);

plot ON = candleAll_54;

ON.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ON.SetDefaultColor(CreateColor(255, 153, 153));

ON.SetLineWeight(5);

rec OnNeck_Trig_54 = If (OnNeck().bearish , + BarNumber(), OnNeck_Trig_54[1] );

AddLabel(OnNeck_Trig_54 > 0 && showLabel && ShowAll,  "14=OnNeck" , CreateColor(255, 153, 153));

Alert(OnNeck()  && !TurnAlertOff && ShowAll, "OnNeck", Alert.BAR, Sound.Chimes);

AddChartBubble(OnNeck() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "14" else if BubVerb then "OnNeck" else "" ,  CreateColor(255, 153, 153) , yes);



#ShootingStar_15,
###### 15 ####################### ShootingStar() & showAll #################################
def candleAll_55 =  If(ShowAll == yes , ShootingStar(), Double.NaN);

plot SS = candleAll_55;

SS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SS.SetDefaultColor(CreateColor(255, 0, 0));

SS.SetLineWeight(5);

rec ShootingStar_Trig_55 = If (ShootingStar().bearish , + BarNumber(), ShootingStar_Trig_55[1] );

AddLabel(ShootingStar_Trig_55 > 0 && showLabel && ShowAll,  "15=ShootingStar" , CreateColor(255, 0, 0));

Alert(ShootingStar()  && !TurnAlertOff && ShowAll, "ShootingStar", Alert.BAR, Sound.Chimes);

AddChartBubble(ShootingStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "15" else if BubVerb then "ShootingStar" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeBlackCrows_16,
###### 16 ####################### ThreeBlackCrows() & showAll #################################
def candleAll_56 =  If(ShowAll == yes , ThreeBlackCrows(), Double.NaN);

plot TBC = candleAll_56;

TBC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TBC.SetDefaultColor(CreateColor(255, 0, 0));

TBC.SetLineWeight(5);

rec ThreeBlackCrows_Trig_56 = If (ThreeBlackCrows().bearish , + BarNumber(), ThreeBlackCrows_Trig_56[1] );

AddLabel(ThreeBlackCrows_Trig_56 > 0 && showLabel && ShowAll,  "16=ThreeBlackCrows" , CreateColor(255, 0, 0));

Alert(ThreeBlackCrows()  && !TurnAlertOff && ShowAll, "ThreeBlackCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeBlackCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high  ,  if BubNumb

then "16" else if BubVerb then "ThreeBlackCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeInsideDown_17,
###### 17 ####################### ThreeInsideDown() & showAll #################################
def candleAll_57 =  If(ShowAll == yes , ThreeInsideDown(), Double.NaN);

plot TID = candleAll_57;

TID.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TID.SetDefaultColor(CreateColor(255, 0, 0));

TID.SetLineWeight(5);

rec ThreeInsideDown_Trig_57 = If (ThreeInsideDown().bearish , + BarNumber(), ThreeInsideDown_Trig_57[1] );

AddLabel(ThreeInsideDown_Trig_57 > 0 && showLabel && ShowAll,  "17=ThreeInsideDown" , CreateColor(255, 0, 0));

Alert(ThreeInsideDown()  && !TurnAlertOff && ShowAll, "ThreeInsideDown", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideDown() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "17" else if BubVerb then "ThreeInsideDown" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeOutsideDown_18,
###### 18 ####################### ThreeOutsideDown() & showAll #################################
def candleAll_58 =  If(ShowAll == yes , ThreeOutsideDown(), Double.NaN);

plot TOD = candleAll_58;

TOD.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TOD.SetDefaultColor(CreateColor(255, 0, 0));

TOD.SetLineWeight(5);

rec ThreeOutsideDown_Trig_58 = If (ThreeOutsideDown().bearish , + BarNumber(), ThreeOutsideDown_Trig_58[1] );

AddLabel(ThreeOutsideDown_Trig_58 > 0 && showLabel && ShowAll,  "18=ThreeOutsideDown" , CreateColor(255, 0, 0));

Alert(ThreeOutsideDown()  && !TurnAlertOff && ShowAll, "ThreeOutsideDown", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideDown() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "18" else if BubVerb then "ThreeOutsideDown" else "" ,  CreateColor(255, 0, 0) , yes);



#Thrusting_19, # C
###### 19 ####################### Thrusting() & showAll #################################
def candleAll_59 =  If(ShowAll == yes , Thrusting(), Double.NaN);

plot Thrust = candleAll_59;

Thrust.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Thrust.SetDefaultColor(CreateColor(255, 153, 153));

Thrust.SetLineWeight(5);

rec Thrusting_Trig_59 = If (Thrusting().bearish , + BarNumber(), Thrusting_Trig_59[1] );

AddLabel(Thrusting_Trig_59 > 0 && showLabel && ShowAll,  "19=Thrusting" , CreateColor(255, 153, 153));

Alert(Thrusting()  && !TurnAlertOff && ShowAll, "Thrusting", Alert.BAR, Sound.Chimes);

AddChartBubble(Thrusting() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "19" else if BubVerb then "Thrusting" else "" ,  CreateColor(255, 153, 153) , yes);



#TwoCrows_20,
###### 20 ####################### TwoCrows() & showAll #################################
def candleAll_60 =  If(ShowAll == yes , TwoCrows(), Double.NaN);

plot TC = candleAll_60;

TC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TC.SetDefaultColor(CreateColor(255, 0, 0));

TC.SetLineWeight(5);

rec TwoCrows_Trig_60 = If (TwoCrows().bearish , + BarNumber(), TwoCrows_Trig_60[1] );

AddLabel(TwoCrows_Trig_60 > 0 && showLabel && ShowAll,  "20=TwoCrows" , CreateColor(255, 0, 0));

Alert(TwoCrows()  && !TurnAlertOff && ShowAll, "TwoCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(TwoCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "20" else if BubVerb then "TwoCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#UpsideGapTwoCrows_21,
###### 21 ####################### UpsideGapTwoCrows() & showAll #################################
def candleAll_61 =  If(ShowAll == yes , UpsideGapTwoCrows(), Double.NaN);

plot UGTC = candleAll_61;

UGTC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

UGTC.SetDefaultColor(CreateColor(255, 0, 0));

UGTC.SetLineWeight(5);

rec UpsideGapTwoCrows_Trig_61 = If (UpsideGapTwoCrows().bearish , + BarNumber(), UpsideGapTwoCrows_Trig_61[1] );

AddLabel(UpsideGapTwoCrows_Trig_61 > 0 && showLabel && ShowAll,  "21=UpsideGapTwoCrows" , CreateColor(255, 0, 0));

Alert(UpsideGapTwoCrows()  && !TurnAlertOff && ShowAll, "UpsideGapTwoCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapTwoCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "21" else if BubVerb then "UpsideGapTwoCrows" else "" ,  CreateColor(255, 0, 0) , yes);

The next 2 sections took me the longest. I had to make the system know each pattern was either bullish only or bearish only since each study will plot both a bullish arrow and bearish arrow unless you state otherwise, which is what I have done.
One thing to note, which I noted in the top of both of these studies, I took out 3 of the studies with # in front of but the format is there if you want to mess around with it.
I've taken out #Diji, #Williams Fractal & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.
Here is why I have #'ed out the Williams Fractal and zig zag:
Adzc2Bi.png


# Bullish&&Bearish Bullish only

This is the verbose B&B Bullish only:
NlQZh8p.png


This is the ID# B&B Bullish only:
bBcTwJV.png


B&B Bull Code:
Code:
#Bullish_AND_Bearish_Bullish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 14 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#formated by mourningwood4521 on usethinkscript using the format outlined by 'StanL' on TOS' ThinkScript Lounge for bull only.

AddLabel(yes, "Bull & Bear Bullish only Reversals", color.blue);
AddLabel(yes, "Bull & Bear Bullish only Continuations: 10, 12, 13, 14", createColor(0, 202, 236));

#shows all bullish only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.


input TurnAlertOff_BBl = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_BBl = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubbleBull = {default none_Bull, Verbose_Bull, BullishID_Number}; #Hint showBubble:Choice of what format the candle bubble ID should have

def BubNoneBull = If (showBubbleBull == showBubbleBull.none_Bull, 1, 0);

def BubVerbBull = If (showBubbleBull == showBubbleBull.Verbose_Bull, 1, 0);

def BubNumbBull = If (showBubbleBull == showBubbleBull.BullishID_Number, 1, 0);

input ShowAll_BBl = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

#####################################################
############ Define the three selection Enums #################
#####################################################

input ShowSeventh =   {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input ShowEighth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input ShowNinth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show
###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle7;

switch (ShowSeventh) {
case AbandonedBaby_1:

    candle7 = If(ShowSeventh.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle7 = If(ShowSeventh.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle7 = If(ShowSeventh.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle7 = If(ShowSeventh.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle7 = If(ShowSeventh.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle7 = If(ShowSeventh.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle7 = If(ShowSeventh.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle7 = If(ShowSeventh.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle7 = If(ShowSeventh.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle7 = If(ShowSeventh.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle7 = If(ShowSeventh.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle7 = If(ShowSeventh.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle7 = If(ShowSeventh.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle7 = If(ShowSeventh.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle7 = If(ShowSeventh.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle7 = If(ShowSeventh.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle7 = If(ShowSeventh.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle7 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show7th = candle7;

Show7th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show7th.SetDefaultColor(Color.GREEN);

Show7th.SetLineWeight(5);
###################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle8;

switch (ShowEighth) {
case AbandonedBaby_1:

    candle8 = If(ShowEighth.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle8 = If(ShowEighth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle8 = If(ShowEighth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle8 = If(ShowEighth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle8 = If(ShowEighth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle8 = If(ShowEighth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle8 = If(ShowEighth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle8 = If(ShowEighth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle8 = If(ShowEighth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle8 = If(ShowEighth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle8 = If(ShowEighth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle8 = If(ShowEighth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle8 = If(ShowEighth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle8 = If(ShowEighth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle8 = If(ShowEighth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle8 = If(ShowEighth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle8 = If(ShowEighth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle8 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show8th = candle8;

Show8th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show8th.SetDefaultColor(Color.GREEN);

Show8th.SetLineWeight(5);

###################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle9;

switch (ShowNinth) {
case AbandonedBaby_1:

    candle9 = If(ShowNinth.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);   # edited in .bullish.need to do this  for.bearish for all
case BeltHold_2:

    candle9 = If(ShowNinth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle9 = If(ShowNinth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle9 = If(ShowNinth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle9 = If(ShowNinth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle9 = If(ShowNinth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle9 = If(ShowNinth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle9 = If(ShowNinth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle9 = If(ShowNinth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle9 = If(ShowNinth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle9 = If(ShowNinth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle9 = If(ShowNinth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle9 = If(ShowNinth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle9 = If(ShowNinth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle9 = If(ShowNinth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle9 = If(ShowNinth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle9 = If(ShowNinth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle9 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show9th = candle9;

Show9th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show9th.SetDefaultColor(Color.GREEN);

Show9th.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

###### 1 ####################### AbandonedBaby() #############################
def ThreeShows_71 = If (ShowSeventh == ShowSeventh.AbandonedBaby_1 or ShowEighth == ShowEighth.AbandonedBaby_1 or ShowNinth == ShowNinth.AbandonedBaby_1, 1, 0);

rec AbandonedBaby_Trig_bull = If(AbandonedBaby().bullish , BarNumber(), AbandonedBaby_Trig_bull[1]);

AddLabel(AbandonedBaby_Trig_bull > 0  && showLabel_BBl  && ThreeShows_71, "1=AbandonedBaby" , Color.GREEN);

Alert(AbandonedBaby().bullish && !TurnAlertOff_BBl, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_71 , low - 6 ,  if BubNumbBull

then "1" else if BubVerbBull then "AbandonedBaby" else "" , color.white  , no);



#BeltHold_2, #Bear
###### 2 ####################### BeltHold() #############################
def ThreeShows_72 = If (ShowSeventh == ShowSeventh.BeltHold_2 or ShowEighth == ShowEighth.BeltHold_2 or ShowNinth == ShowNinth.BeltHold_2, 1, 0);

rec BeltHold_Trig_bull = If(BeltHold().bullish , BarNumber(), BeltHold_Trig_bull[1]);

AddLabel(BeltHold_Trig_bull > 0  && showLabel_BBl  && ThreeShows_72, "2=BeltHold" , Color.RED);

Alert(BeltHold().bullish && !TurnAlertOff_BBl, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_72 , low - 6 ,  if BubNumbBull

then "2" else if BubVerbBull then "BeltHold" else "" , Color.WHITE  , no);



#Breakaway_3,
###### 3 ####################### Breakaway() #############################
def ThreeShows_73 = If (ShowSeventh == ShowSeventh.Breakaway_3 or ShowEighth == ShowEighth.Breakaway_3 or ShowNinth == ShowNinth.Breakaway_3, 1, 0);

rec Breakaway_Trig_bull = If(Breakaway().bullish , BarNumber(), Breakaway_Trig_bull[1]);

AddLabel(Breakaway_Trig_bull > 0  && showLabel_BBl  && ThreeShows_73, "3=Breakaway" , Color.RED);

Alert(Breakaway().bullish && !TurnAlertOff_BBl, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway() && (BubVerbBull or BubNumbBull) && ThreeShows_73 , low - 6 ,  if BubNumbBull

then "3" else if BubVerbBull then "Breakaway" else "" , Color.WHITE  , no);


#Doji_4,
###### 4 ####################### Doji() #############################
#def ThreeShows_84 = If (ShowSeventh == ShowSeventh.Doji_4 or ShowEighth == ShowEighth.Doji_4 or ShowNinth == ShowNinth.Doji_4, 1, 0);
#rec Doji_Trig_bull = If(Doji(), BarNumber(), Doji_Trig_bull[1]);
#AddLabel(Doji_Trig_bull > 0  && showLabel_BBl  && ThreeShows_84, "4=Doji" , Color.RED);
#Alert(Doji() && !TurnAlertOff_BBl, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBull or BubNumbBull) && ThreeShows_84 , low - 6  ,  if BubNumbBull
#then "4" else if BubVerbBull then "Doji" else "" , Color.WHITE  , no);


#Engulfing_5,
###### 5 ####################### Engulfing() #############################
def ThreeShows_75 = If (ShowSeventh == ShowSeventh.Engulfing_5 or ShowEighth == ShowEighth.Engulfing_5 or ShowNinth == ShowNinth.Engulfing_5, 1, 0);

rec Engulfing_Trig_bull = If(Engulfing().bullish , BarNumber(), Engulfing_Trig_bull[1]);

AddLabel(Engulfing_Trig_bull > 0  && showLabel_BBl  && ThreeShows_75, "5=Engulfing" , Color.RED);

Alert(Engulfing().bullish && !TurnAlertOff_BBl, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_75 , low - 6 ,  if BubNumbBull

then "5" else if BubVerbBull then "Engulfing" else "" , Color.WHITE  , no);



#Harami_6,
###### 6 ####################### Harami() #############################
def ThreeShows_76 = If (ShowSeventh == ShowSeventh.Harami_6 or ShowEighth == ShowEighth.Harami_6 or ShowNinth == ShowNinth.Harami_6, 1, 0);

rec Harami_Trig_bull = If(Harami().bullish , BarNumber(), Harami_Trig_bull[1]);

AddLabel(Harami_Trig_bull > 0  && showLabel_BBl  && ThreeShows_76, "6=Harami" , Color.RED);

Alert(Harami().bullish && !TurnAlertOff_BBl, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_76 , low - 6 ,  if BubNumbBull

then "6" else if BubVerbBull then "Harami" else "" , Color.WHITE  , no);



#HaramiCross_7,
###### 7 ####################### HaramiCross() #############################
def ThreeShows_77 = If (ShowSeventh == ShowSeventh.HaramiCross_7 or ShowEighth == ShowEighth.HaramiCross_7 or ShowNinth == ShowNinth.HaramiCross_7, 1, 0);

rec HaramiCross_Trig_bull = If(HaramiCross().bullish , BarNumber(), HaramiCross_Trig_bull[1]);

AddLabel(HaramiCross_Trig_bull > 0  && showLabel_BBl  && ThreeShows_77, "7=HaramiCross" , Color.RED);

Alert(HaramiCross().bullish && !TurnAlertOff_BBl, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_77 , low - 6 ,  if BubNumbBull

then "7" else if BubVerbBull then "HaramiCross" else "" , Color.WHITE  , no);



#Kicking_8,
###### 8 ####################### BeltHold() #############################
def ThreeShows_78 = If (ShowSeventh == ShowSeventh.Kicking_8 or ShowEighth == ShowEighth.Kicking_8 or ShowNinth == ShowNinth.Kicking_8, 1, 0);

rec Kicking_Trig_bull = If(Kicking().bullish , BarNumber(), Kicking_Trig_bull[1]);

AddLabel(Kicking_Trig_bull > 0  && showLabel_BBl  && ThreeShows_78, "8=Kicking" , Color.RED);

Alert(Kicking().bullish && !TurnAlertOff_BBl, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_78 , low - 6 ,  if BubNumbBull

then "8" else if BubVerbBull then "Kicking" else "" , Color.WHITE  , no);



#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() #############################
def ThreeShows_79 = If (ShowSeventh == ShowSeventh.LongLeggedDoji_9 or ShowEighth == ShowEighth.LongLeggedDoji_9 or ShowNinth == ShowNinth.LongLeggedDoji_9, 1, 0);

rec LongLeggedDoji_Trig_bull = If(LongLeggedDoji().bullish , BarNumber(), LongLeggedDoji_Trig_bull[1]);

AddLabel(LongLeggedDoji_Trig_bull > 0  && showLabel_BBl  && ThreeShows_79, "9=LongLeggedDoji" , Color.RED);

Alert(LongLeggedDoji().bullish && !TurnAlertOff_BBl, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_79 , low - 6 ,  if BubNumbBull

then "9" else if BubVerbBull then "LongLeggedDoji" else "" , Color.WHITE  , no);



#Marubozu_10,
###### 10 ####################### Marubozu() #############################
def ThreeShows_80 = If (ShowSeventh == ShowSeventh.Marubozu_10 or ShowEighth == ShowEighth.Marubozu_10 or ShowNinth == ShowNinth.Marubozu_10, 1, 0);

rec Marubozu_Trig_bull = If(Marubozu().bullish , BarNumber(), Marubozu_Trig_bull[1]);

AddLabel(Marubozu_Trig_bull > 0  && showLabel_BBl  && ThreeShows_80, "10=Marubozu" , createColor(0, 202, 236));

Alert(Marubozu().bullish && !TurnAlertOff_BBl, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_80, low - 6 ,  if BubNumbBull

then "10" else if BubVerbBull then "Marubozu" else "" , createColor(0, 202, 236)  , no);



#MeetingLines_11,
###### 11 ####################### MeetingLines() #############################
def ThreeShows_81 = If (ShowSeventh == ShowSeventh.MeetingLines_11 or ShowEighth == ShowEighth.MeetingLines_11 or ShowNinth == ShowNinth.MeetingLines_11, 1, 0);

rec MeetingLines_Trig_bull = If(MeetingLines().bullish , BarNumber(), MeetingLines_Trig_bull[1]);

AddLabel(MeetingLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_81, "11=MeetingLines" , Color.GREEN);

Alert(MeetingLines().bullish && !TurnAlertOff_BBl, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_81, low - 6 ,  if BubNumbBull

then "1" else if BubVerbBull then "MeetingLines" else "" , Color.WHITE  , no);



#SeparatingLines_12,
###### 12 ####################### SeparatingLines() #############################
def ThreeShows_82 = If (ShowSeventh == ShowSeventh.SeparatingLines_12 or ShowEighth == ShowEighth.SeparatingLines_12 or ShowNinth == ShowNinth.SeparatingLines_12, 1, 0);

rec SeparatingLines_Trig_bull = If(SeparatingLines().bullish , BarNumber(), SeparatingLines_Trig_bull[1]);

AddLabel(SeparatingLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_82, "12=SeparatingLines" , createColor(0, 202, 236));

Alert(SeparatingLines().bullish && !TurnAlertOff_BBl, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_82, low - 6 ,  if BubNumbBull

then "12" else if BubVerbBull then "SeparatingLines" else "" , createColor(0, 202, 236)  , no);



#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() #############################
def ThreeShows_83 = If (ShowSeventh == ShowSeventh.SideBySideWhiteLines_13 or ShowEighth == ShowEighth.SideBySideWhiteLines_13 or ShowNinth == ShowNinth.SideBySideWhiteLines_13, 1, 0);

rec SideBySideWhiteLines_Trig_bull = If(SideBySideWhiteLines().bullish , BarNumber(), SideBySideWhiteLines_Trig_bull[1]);

AddLabel(SideBySideWhiteLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_83, "13=SideBySideWhiteLines" , createColor(0, 202, 236));

Alert(SideBySideWhiteLines().bullish && !TurnAlertOff_BBl, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_83, low - 6 ,  if BubNumbBull

then "13" else if BubVerbBull then "SideBySideWhiteLines" else "" , createColor(0, 202, 236)  , no);



#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() #############################
def ThreeShows_84 = If (ShowSeventh == ShowSeventh.ThreeLineStrike_14 or ShowEighth == ShowEighth.ThreeLineStrike_14 or ShowNinth == ShowNinth.ThreeLineStrike_14, 1, 0);

rec ThreeOutsideUp_Trig_bull = If(ThreeLineStrike().bullish , BarNumber(), ThreeOutsideUp_Trig_bull[1]);

AddLabel(ThreeOutsideUp_Trig_bull > 0  && showLabel_BBl  && ThreeShows_84 , "14=ThreeLineStrike" , createColor(0, 202, 236));

Alert(ThreeLineStrike().bullish && !TurnAlertOff_BBl, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_84, low - 6 ,  if BubNumbBull

then "14" else if BubVerbBull then "ThreeLineStrike" else "" , createColor(0, 202, 236)  , no);


#TriStar_15,
###### 15 ####################### TriStar() #############################
def ThreeShows_85 = If (ShowSeventh == ShowSeventh.TriStar_15 or ShowEighth == ShowEighth.TriStar_15 or ShowNinth == ShowNinth.TriStar_15, 1, 0);

rec TriStar_Trig_bull = If(TriStar().bullish , BarNumber(), TriStar_Trig_bull[1]);

AddLabel(TriStar_Trig_bull > 0  && showLabel_BBl  && ThreeShows_85, "15=TriStar" , Color.GREEN);

Alert(TriStar().bullish && !TurnAlertOff_BBl, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_85, low - 6 ,  if BubNumbBull

then "15" else if BubVerbBull then "TriStar" else "" , Color.WHITE  , no);



#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() #############################
#def ThreeShows_86 = If (ShowSeventh == ShowSeventh.WilliamsFractal_16 or ShowEighth == ShowEighth.WilliamsFractal_16 or ShowNinth == ShowNinth.WilliamsFractal_16, 1, 0);
#rec WilliamsFractal_Trig_upfractal = If(WilliamsFractal().upfractal , BarNumber(), WilliamsFractal_Trig_upfractal[1]);
#AddLabel(WilliamsFractal_Trig_upfractal > 0  && showLabel_BBl  && ThreeShows_86, "16=WilliamsFractal" , Color.GREEN);
#Alert(WilliamsFractal().upfractal && !TurnAlertOff_BBl, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().upfractal && (BubVerbBull or BubNumbBull) && ThreeShows_86, low - 6 ,  if BubNumbBull
#then "16" else if BubVerbBull then "WilliamsFractal" else "" , Color.WHITE  , no);


#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() #############################
#def ThreeShows_87 = If (ShowSeventh == ShowSeventh.ZigZagStepPattern_17 or ShowEighth == ShowEighth.ZigZagStepPattern_17 or ShowNinth == ShowNinth.ZigZagStepPattern_17, 1, 0);
#rec ZigZagStepPattern_Trig_upstep = If(ZigZagStepPattern().upstep , BarNumber(), ZigZagStepPattern_Trig_upstep[1]);
#AddLabel(ZigZagStepPattern_Trig_upstep > 0  && showLabel_BBl  && ThreeShows_87, "17=ZigZagStepPattern" , Color.GREEN);
#Alert(ZigZagStepPattern().upstep && !TurnAlertOff_BBl, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().upstep && (BubVerbBull or BubNumbBull) && ThreeShows_87, low - 6 ,  if BubNumbBull
#then "17" else if BubVerbBull then "ZigZagStepPattern" else "" , Color.WHITE  , no);



###############################################################################
#start bottom section

# AbandonedBaby_1,    
###### 1 ####################### AbandonedBaby() & showAll #################################
def  candleAll_71 = If(ShowAll_BBl == yes , AbandonedBaby().bullish, Double.NaN);

plot AB_bullish = candleAll_71;

AB_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

AB_bullish.SetDefaultColor(Color.BLUE);

AB_bullish.SetLineWeight(5);

rec AbandonedBaby_bullish_Trig_71 = If (AbandonedBaby().bullish, + BarNumber(), AbandonedBaby_bullish_Trig_71[1] );

AddLabel(AbandonedBaby_bullish_Trig_71 > 0 && showLabel_BBl && ShowAll_BBl, "1=AbandonedBaby" , Color.BLUE);

Alert(AbandonedBaby().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6,  if BubNumbBull

then "1" else if BubVerbBull then "AbandonedBaby" else "" ,  Color.BLUE , no);



#BeltHold_2,
###### 2 ####################### BeltHold() & showAll #################################
def  candleAll_72 = If(ShowAll_BBl == yes , BeltHold().bullish, Double.NaN);

plot BH_bullish = candleAll_72;

BH_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

BH_bullish.SetDefaultColor(Color.BLUE);

BH_bullish.SetLineWeight(5);

rec BeltHold_bullish_Trig_72 = If (BeltHold().BULLISH, + BarNumber(), BeltHold_bullish_Trig_72[1] );

AddLabel(BeltHold_bullish_Trig_72 > 0 && showLabel_BBl && ShowAll_BBl, "2=BeltHold" , Color.BLUE);

Alert(BeltHold().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "2" else if BubVerbBull then "BeltHold" else "" ,  Color.BLUE , no);


# Breakaway_3,  
###### 3 ####################### Breakaway() & showAll #################################
def  candleAll_73 = If(ShowAll_BBl == yes , Breakaway().bullish, Double.NaN);

plot BAWAY_bullish = candleAll_73;

BAWAY_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

BAWAY_bullish.SetDefaultColor(Color.BLUE);

BAWAY_bullish.SetLineWeight(5);

rec Breakaway_bullish_Trig_73 = If (Breakaway().bullish, + BarNumber(), Breakaway_bullish_Trig_73[1] );

AddLabel(Breakaway_bullish_Trig_73 > 0 && showLabel_BBl && ShowAll_BBl, "3=Breakaway" , Color.BLUE);

Alert(Breakaway().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "3" else if BubVerbBull then "Breakaway" else "" ,  Color.BLUE , no);



#Doji_4,
###### 4 ####################### Doji() & showAll #################################
#def  candleAll_74 = If(ShowAll == yes , Doji(), Double.NaN);

#plot DOJI = candleAll_74;
#DOJI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#rec DOJI_Trig_74 = If (Doji(), + BarNumber(), DOJI_Trig_74[1] );
#AddLabel(DOJI_Trig_74 > 0 && showLabel && ShowAll, "4=Doji" , Color.VIOLET);
#Alert(Doji()  && !TurnAlertOff && ShowAll, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBull or BubNumbBull) && (ShowAll) , low - 6 ,  if BubNumbBull
#then "4" else if BubVerbBull then "Doji" else "" ,  Color.VIOLET , no);



#Engulfing_5,
###### 5 ####################### Engulfing() & showAll #################################
def  candleAll_75 = If(ShowAll_BBl == yes , Engulfing().bullish, Double.NaN);

plot Engulfing_bullish = candleAll_75;

Engulfing_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Engulfing_bullish.SetDefaultColor(Color.BLUE);

Engulfing_bullish.SetLineWeight(5);

rec Engulfing_bullish_Trig_75 = If (Engulfing().bullish, + BarNumber(), Engulfing_bullish_Trig_75[1] );

AddLabel(Engulfing_bullish_Trig_75 > 0 && showLabel_BBl && ShowAll_BBl, "5=Engulfing" , Color.BLUE);

Alert(Engulfing().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "5" else if BubVerbBull then "Engulfing" else "" ,  Color.BLUE , no);


#Harami_6,
###### 6 ####################### Harami() & showAll #################################
def  candleAll_76 = If(ShowAll_BBl == yes , Harami().bullish, Double.NaN);

plot Harami_bullish = candleAll_76;

Harami_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Harami_bullish.SetDefaultColor(Color.BLUE);

Harami_bullish.SetLineWeight(5);

rec Harami_bullish_Trig_76 = If (Harami().bullish, + BarNumber(), Harami_bullish_Trig_76[1] );

AddLabel(Harami_bullish_Trig_76 > 0 && showLabel_BBl && ShowAll_BBl, "6=Harami" , Color.BLUE);

Alert(Harami().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "6" else if BubVerbBull then "Harami" else "" ,  Color.BLUE , no);



#HaramiCross_7,
###### 7 ####################### HaramiCross() & showAll #################################
def  candleAll_77 = If(ShowAll_BBl == yes , HaramiCross().bullish, Double.NaN);

plot HaramiCross_bullish = candleAll_77;

HaramiCross_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

HaramiCross_bullish.SetDefaultColor(Color.BLUE);

HaramiCross_bullish.SetLineWeight(5);

rec HaramiCross_bullish_Trig_77 = If (HaramiCross().bullish, + BarNumber(), HaramiCross_bullish_Trig_77[1] );

AddLabel(HaramiCross_bullish_Trig_77 > 0 && showLabel_BBl && ShowAll_BBl, "7=HaramiCross" , Color.BLUE);

Alert(HaramiCross().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "7" else if BubVerbBull then "HaramiCross" else "" ,  Color.BLUE , no);


#Kicking_8,
###### 8 ####################### Kicking() & showAll #################################
def  candleAll_78 = If(ShowAll_BBl == yes , Kicking().bullish, Double.NaN);

plot Kicking_bullish = candleAll_78;

Kicking_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Kicking_bullish.SetDefaultColor(Color.BLUE);

Kicking_bullish.SetLineWeight(5);

rec Kicking_bullish_Trig_78 = If (Kicking().bullish, + BarNumber(), Kicking_bullish_Trig_78[1] );

AddLabel(Kicking_bullish_Trig_78 > 0 && showLabel_BBl && ShowAll_BBl, "8=Kicking" , Color.BLUE);

Alert(Kicking().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "8" else if BubVerbBull then "Kicking" else "" ,  Color.BLUE , no);


#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() & showAll #################################
def  candleAll_79 = If(ShowAll_BBl == yes , LongLeggedDoji().bullish, Double.NaN);

plot LongLeggedDoji_bullish = candleAll_79;

LongLeggedDoji_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

LongLeggedDoji_bullish.SetDefaultColor(Color.BLUE);

LongLeggedDoji_bullish.SetLineWeight(5);

rec LongLeggedDoji_bullish_Trig_79 = If (LongLeggedDoji().bullish, + BarNumber(), LongLeggedDoji_bullish_Trig_79[1] );

AddLabel(LongLeggedDoji_bullish_Trig_79 > 0 && showLabel_BBl && ShowAll_BBl, "9=LongLeggedDoji" , Color.BLUE);

Alert(LongLeggedDoji().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "9" else if BubVerbBull then "LongLeggedDoji" else "" ,  Color.BLUE , no);


#Marubozu_10,
###### 10 ####################### Marubozu() & showAll #################################
def  candleAll_80 = If(ShowAll_BBl == yes , Marubozu().bullish, Double.NaN);

plot Marubozu_bullish = candleAll_80;

Marubozu_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Marubozu_bullish.SetDefaultColor(createColor(0, 202, 236));

Marubozu_bullish.SetLineWeight(5);

rec Marubozu_bullish_Trig_80 = If (Marubozu().bullish, + BarNumber(), Marubozu_bullish_Trig_80[1] );

AddLabel(Marubozu_bullish_Trig_80 > 0 && showLabel_BBl && ShowAll_BBl, "10=Marubozu" , createColor(0, 202, 236));

Alert(Marubozu().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "10" else if BubVerbBull then "Marubozu" else "" ,  createColor(0, 202, 236) , no);


#MeetingLines_11,
###### 11 ####################### MeetingLines() & showAll #################################
def  candleAll_81 = If(ShowAll_BBl == yes , MeetingLines().bullish, Double.NaN);

plot MeetingLines_bullish = candleAll_81;

MeetingLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MeetingLines_bullish.SetDefaultColor(Color.BLUE);

MeetingLines_bullish.SetLineWeight(5);

rec MeetingLines_bullish_Trig_81 = If (MeetingLines().bullish, + BarNumber(), MeetingLines_bullish_Trig_81[1] );

AddLabel(MeetingLines_bullish_Trig_81 > 0 && showLabel_BBl && ShowAll_BBl, "11=MeetingLines" , Color.BLUE);

Alert(MeetingLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "11" else if BubVerbBull then "MeetingLines" else "" ,  Color.BLUE , no);


#SeparatingLines_12,
###### 12 ####################### SeparatingLines() & showAll #################################
def  candleAll_82 = If(ShowAll_BBl == yes , SeparatingLines().bullish, Double.NaN);

plot SeparatingLines_bullish = candleAll_82;

SeparatingLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SeparatingLines_bullish.SetDefaultColor(createColor(0, 202, 236));

SeparatingLines_bullish.SetLineWeight(5);

rec SeparatingLines_bullish_Trig_82 = If (SeparatingLines().bullish, + BarNumber(), SeparatingLines_bullish_Trig_82[1] );

AddLabel(SeparatingLines_bullish_Trig_82 > 0 && showLabel_BBl && ShowAll_BBl, "12=SeparatingLines" , createColor(0, 202, 236));

Alert(SeparatingLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "12" else if BubVerbBull then "SeparatingLines" else "" ,  createColor(0, 202, 236) , no);


#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() & showAll #################################
def  candleAll_83 = If(ShowAll_BBl == yes , SideBySideWhiteLines().bullish, Double.NaN);

plot SideBySideWhiteLines_bullish = candleAll_83;

SideBySideWhiteLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SideBySideWhiteLines_bullish.SetDefaultColor(createColor(0, 202, 236));

SideBySideWhiteLines_bullish.SetLineWeight(5);

rec SideBySideWhiteLines_bullish_Trig_83 = If (SideBySideWhiteLines().bullish, + BarNumber(), SideBySideWhiteLines_bullish_Trig_83[1] );

AddLabel(SideBySideWhiteLines_bullish_Trig_83 > 0 && showLabel_BBl && ShowAll_BBl, "13=SideBySideWhiteLines" , createColor(0, 202, 236));

Alert(SideBySideWhiteLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "13" else if BubVerbBull then "SideBySideWhiteLines" else "" ,  createColor(0, 202, 236) , no);


#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() & showAll #################################
def  candleAll_84 = If(ShowAll_BBl == yes , ThreeLineStrike().bullish, Double.NaN);

plot ThreeLineStrike_bullish = candleAll_84;

ThreeLineStrike_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

ThreeLineStrike_bullish.SetDefaultColor(createColor(0, 202, 236));

ThreeLineStrike_bullish.SetLineWeight(5);

rec ThreeLineStrike_bullish_Trig_84 = If (ThreeLineStrike().bullish, + BarNumber(), ThreeLineStrike_bullish_Trig_84[1] );

AddLabel(ThreeLineStrike_bullish_Trig_84 > 0 && showLabel_BBl && ShowAll_BBl, "14=ThreeLineStrike" , createColor(0, 202, 236));

Alert(ThreeLineStrike().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "14" else if BubVerbBull then "ThreeLineStrike" else "" ,  createColor(0, 202, 236) , no);


#TriStar_15,
###### 15 ####################### TriStar() & showAll #################################
def  candleAll_85 = If(ShowAll_BBl == yes , TriStar(), Double.NaN);

plot TriStar_bullish = candleAll_85;

TriStar_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TriStar_bullish.SetDefaultColor(Color.BLUE);

TriStar_bullish.SetLineWeight(5);

rec TriStar_bullish_Trig_85 = If (TriStar().bullish, + BarNumber(), TriStar_bullish_Trig_85[1] );

AddLabel(TriStar_bullish_Trig_85 > 0 && showLabel_BBl && ShowAll_BBl, "15=TriStar" , Color.BLUE);

Alert(TriStar().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "15" else if BubVerbBull then "TriStar" else "" ,  Color.BLUE , no);


#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() & showAll #################################
#def  candleAll_86 = If(ShowAll_BBl == yes , WilliamsFractal().UpFractal, Double.NaN);
#plot WilliamsFractal = candleAll_86;
#WilliamsFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#WilliamsFractal.SetDefaultColor(Color.BLUE);
#WilliamsFractal.SetLineWeight(5);
#rec WilliamsFractal_Trig_86 = If (WilliamsFractal().UpFractal, + WilliamsFractal(), WilliamsFractal_Trig_86[1] );
#AddLabel(WilliamsFractal_Trig_86 > 0 && showLabel && ShowAll_BBl, "16=WilliamsFractal" , Color.VIOLET);
#Alert(WilliamsFractal().UpFractal  && !TurnAlertOff_BBl && ShowAll_BBl, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().UpFractal && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull
#then "16" else if BubVerbBull then "WilliamsFractal" else "" ,  Color.VIOLET , no);


#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() & showAll #################################
#def  candleAll_87 = If(ShowAll == yes , ZigZagStepPattern(), Double.NaN);
#plot ZigZagStepPattern = candleAll_87;
#ZigZagStepPattern.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#ZigZagStepPattern.SetDefaultColor(Color.BLUE);
#ZigZagStepPattern.SetLineWeight(5);
#rec ZigZagStepPattern_Trig_87 = If (ZigZagStepPattern().upstep, + ZigZagStepPattern(), ZigZagStepPattern_Trig_87[1]);
#AddLabel(ZigZagStepPattern_Trig_87 > 0 && showLabel && ShowAll, "17=ZigZagStepPattern" , Color.VIOLET);
#Alert(ZigZagStepPattern()  && !TurnAlertOff && ShowAll, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern() && (BubVerbBull or BubNumbBull) && (ShowAll) , low - 6 ,  if BubNumbBull
#then "17" else if BubVerbBull then "ZigZagStepPattern" else "" ,  Color.VIOLET , no);

# Bullish&&Bearish Bullish only

This is the verbose B&B Bearish only:
lvxpyCN.png


This is the ID# B&B Bearish only:
ocYwtPC.png


This is select a few only of the B&B Bearish only:
ocYwtPC.png


B&B Bear Code:
Code:
#Bullish_AND_Bearish_Bearish_Patterns_only

declare upper;

#Hint: BearishCandlesticks: Plots and identifies all 14 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#formated by mourningwood4521 on usethinkscript using the format outlined by 'StanL' on TOS' ThinkScript Lounge for bull only.

AddLabel(yes, "Bull & Bear Bearish only Reversals", CreateColor(255, 136, 12));
AddLabel(yes, "Bull & Bear Bearish only Continuations: 10, 12, 13, 14", createColor(255, 255, 153));

#shows all bearish only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.


input TurnAlertOff_BBr = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_BBr = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubbleBear = {default none_bear, Verbose_Bear, BearishID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

def BubNoneBear = If (showBubbleBear == showBubbleBear.none_bear, 1, 0);

def BubVerbBear = If (showBubbleBear == showBubbleBear.Verbose_Bear, 1, 0);

def BubNumbBear = If (showBubbleBear == showBubbleBear.BearishID_Number, 1, 0);

input ShowAll_BBr = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

#####################################################

############ Define the three selection Enums #################

#####################################################

input ShowTenth =   {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input Showeleventh =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show


input ShowThelfth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show
###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle10;

switch (ShowTenth) {
case AbandonedBaby_1:

    candle10 = If(ShowTenth.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle10 = If(ShowTenth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle10 = If(ShowTenth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle10 = If(ShowTenth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle10 = If(ShowTenth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle10 = If(ShowTenth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle10 = If(ShowTenth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle10 = If(ShowTenth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle10 = If(ShowTenth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle10 = If(ShowTenth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle10 = If(ShowTenth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle10 = If(ShowTenth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle10 = If(ShowTenth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle10 = If(ShowTenth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle10 = If(ShowTenth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle10 = If(ShowTenth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle10 = If(ShowTenth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle10 = Double.NaN;
}  # Closing of switch (ShowTenth) {

plot Show10th = candle10;

Show10th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show10th.SetDefaultColor(Color.GREEN);

Show10th.SetLineWeight(5);
###################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle11;

switch (Showeleventh) {
case AbandonedBaby_1:

    candle11 = If(Showeleventh.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle11 = If(Showeleventh.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle11 = If(Showeleventh.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle11 = If(Showeleventh.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle11 = If(Showeleventh.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle11 = If(Showeleventh.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle11 = If(Showeleventh.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle11 = If(Showeleventh.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle11 = If(Showeleventh.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle11 = If(Showeleventh.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle11 = If(Showeleventh.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle11 = If(Showeleventh.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle11 = If(Showeleventh.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle11 = If(Showeleventh.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle11 = If(Showeleventh.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle11 = If(Showeleventh.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle11 = If(Showeleventh.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle11 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show11th = candle11;

Show11th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show11th.SetDefaultColor(Color.GREEN);

Show11th.SetLineWeight(5);

###################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle12;

switch (ShowThelfth) {
case AbandonedBaby_1:

    candle12 = If(ShowThelfth.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);
# edited in .bullish.need to do this  for.bearish for all
case BeltHold_2:

    candle12 = If(ShowThelfth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle12 = If(ShowThelfth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle12 = If(ShowThelfth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle12 = If(ShowThelfth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle12 = If(ShowThelfth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle12 = If(ShowThelfth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle12 = If(ShowThelfth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle12 = If(ShowThelfth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle12 = If(ShowThelfth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle12 = If(ShowThelfth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle12 = If(ShowThelfth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle12 = If(ShowThelfth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle12 = If(ShowThelfth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle12 = If(ShowThelfth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle12 = If(ShowThelfth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle12 = If(ShowThelfth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle12 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show12th = candle12;

Show12th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show12th.SetDefaultColor(Color.GREEN);

Show12th.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################


# AbandonedBaby_1,
###### 1 ####################### AbandonedBaby() #############################
def ThreeShows_101 = If (ShowTenth == ShowTenth.AbandonedBaby_1 or Showeleventh == Showeleventh.AbandonedBaby_1 or ShowThelfth == ShowThelfth.AbandonedBaby_1, 1, 0);

rec AbandonedBaby_Trig_bear = If(AbandonedBaby().bearish , BarNumber(), AbandonedBaby_Trig_bear[1]);

AddLabel(AbandonedBaby_Trig_bear > 0  && showLabel_BBr  && ThreeShows_101, "1=AbandonedBaby" , CreateColor(255, 136, 12));

Alert(AbandonedBaby().bearish && !TurnAlertOff_BBr, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_101 , high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "AbandonedBaby" else "" , CreateColor(255, 136, 12)  , yes);  #BubVerbBear



#BeltHold_2, #Bear
###### 2 ####################### BeltHold() #############################
def ThreeShows_102 = If (ShowTenth == ShowTenth.BeltHold_2 or Showeleventh == Showeleventh.BeltHold_2 or ShowThelfth == ShowThelfth.BeltHold_2, 1, 0);

rec BeltHold_Trig_bear = If(BeltHold().bearish , BarNumber(), BeltHold_Trig_bear[1]);

AddLabel(BeltHold_Trig_bear > 0  && showLabel_BBr  && ThreeShows_102, "2=BeltHold" , CreateColor(255, 136, 12));

Alert(BeltHold().bearish && !TurnAlertOff_BBr, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_102 , high + 6 ,  if BubNumbBear

then "2" else if BubVerbBear then "BeltHold" else "" , CreateColor(255, 136, 12)  , yes);



#Breakaway_3,
###### 3 ####################### Breakaway() #############################
def ThreeShows_103 = If (ShowTenth == ShowTenth.Breakaway_3 or Showeleventh == Showeleventh.Breakaway_3 or ShowThelfth == ShowThelfth.Breakaway_3, 1, 0);

rec Breakaway_Trig_bear = If(Breakaway().bearish , BarNumber(), Breakaway_Trig_bear[1]);

AddLabel(Breakaway_Trig_bear > 0  && showLabel_BBr  && ThreeShows_103, "3=Breakaway" , CreateColor(255, 136, 12));

Alert(Breakaway().bearish && !TurnAlertOff_BBr, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_103 , high + 6 ,  if BubNumbBear

then "3" else if BubVerbBear then "Breakaway" else "" , CreateColor(255, 136, 12)  , yes);



#Doji_4,
###### 4 ####################### Doji() #############################
#def ThreeShows_104 = If (ShowTenth == ShowTenth.Doji_4 or Showeleventh == Showeleventh.Doji_4 or ShowThelfth == ShowThelfth.Doji_4, 1, 0);
#rec Doji_Trig = If(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(Doji_Trig > 0  && showLabel_BBr  && ThreeShows_104, "4=Doji" , color.yellow);
#Alert(Doji() && !TurnAlertOff_BBr, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBear or BubNumbBear) && ThreeShows_104 , high + 6 ,  if BubNumbBear
#then "4" else if BubVerbBear then "Doji" else "" , color.yellow  , yes);



#Engulfing_5,
###### 5 ####################### Engulfing() #############################
def ThreeShows_105 = If (ShowTenth == ShowTenth.Engulfing_5 or Showeleventh == Showeleventh.Engulfing_5 or ShowThelfth == ShowThelfth.Engulfing_5, 1, 0);

rec Engulfing_Trig_bear = If(Engulfing().bearish , BarNumber(), Engulfing_Trig_bear[1]);

AddLabel(Engulfing_Trig_bear > 0  && showLabel_BBr  && ThreeShows_105, "5=Engulfing" , CreateColor(255, 136, 12));

Alert(Engulfing().bearish && !TurnAlertOff_BBr, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_105 , high + 6 ,  if BubNumbBear

then "5" else if BubVerbBear then "Engulfing" else "" , CreateColor(255, 136, 12)  , yes);  #10



#Harami_6,
###### 6 ####################### Harami() #############################
def ThreeShows_106 = If (ShowTenth == ShowTenth.Harami_6 or Showeleventh == Showeleventh.Harami_6 or ShowThelfth == ShowThelfth.Harami_6, 1, 0);

rec Harami_Trig_bear = If(Harami().bearish , BarNumber(), Harami_Trig_bear[1]);

AddLabel(Harami_Trig_bear > 0  && showLabel_BBr  && ThreeShows_106, "6=Harami" , CreateColor(255, 136, 12));

Alert(Harami().bearish && !TurnAlertOff_BBr, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_106 , high + 6 ,  if BubNumbBear

then "6" else if BubVerbBear then "Harami" else "" , CreateColor(255, 136, 12)  , yes);



#HaramiCross_7,
###### 7 ####################### HaramiCross() #############################
def ThreeShows_107 = If (ShowTenth == ShowTenth.HaramiCross_7 or Showeleventh == Showeleventh.HaramiCross_7 or ShowThelfth == ShowThelfth.HaramiCross_7, 1, 0);

rec HaramiCross_Trig_bear = If(HaramiCross().bearish , BarNumber(), HaramiCross_Trig_bear[1]);

AddLabel(HaramiCross_Trig_bear > 0  && showLabel_BBr  && ThreeShows_107, "7=HaramiCross" , CreateColor(255, 136, 12));

Alert(HaramiCross().bearish && !TurnAlertOff_BBr, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_107 , high + 6 ,  if BubNumbBear

then "7" else if BubVerbBear then "HaramiCross" else "" , CreateColor(255, 136, 12)  , yes);



#Kicking_8,
###### 8 ####################### BeltHold() #############################
def ThreeShows_108 = If (ShowTenth == ShowTenth.Kicking_8 or ShowEleventh == ShowEleventh.Kicking_8 or ShowThelfth == ShowThelfth.Kicking_8, 1, 0);

rec Kicking_Trig_bear = If(Kicking().bearish , BarNumber(), Kicking_Trig_bear[1]);

AddLabel(Kicking_Trig_bear > 0  && showLabel_BBr  && ThreeShows_108, "8=Kicking" , CreateColor(255, 136, 12));

Alert(Kicking().bearish && !TurnAlertOff_BBr, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_108 , high + 6 ,  if BubNumbBear

then "8" else if BubVerbBear then "Kicking" else "" , CreateColor(255, 136, 12)  , yes);



#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() #############################
def ThreeShows_109 = If (ShowTenth == ShowTenth.LongLeggedDoji_9 or ShowEleventh == ShowEleventh.LongLeggedDoji_9 or ShowThelfth == ShowThelfth.LongLeggedDoji_9, 1, 0);

rec LongLeggedDoji_Trig_bear = If(LongLeggedDoji().bearish , BarNumber(), LongLeggedDoji_Trig_bear[1]);

AddLabel(LongLeggedDoji_Trig_bear > 0  && showLabel_BBr  && ThreeShows_109, "9=LongLeggedDoji" , CreateColor(255, 136, 12));

Alert(LongLeggedDoji().bearish && !TurnAlertOff_BBr, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_109 , high + 6 ,  if BubNumbBear

then "9" else if BubVerbBear then "LongLeggedDoji" else "" , CreateColor(255, 136, 12)  , yes);



#Marubozu_10,
###### 10 ####################### Marubozu() #############################
def ThreeShows_10 = If (ShowTenth == ShowTenth.Marubozu_10 or ShowEleventh == ShowEleventh.Marubozu_10 or ShowThelfth == ShowThelfth.Marubozu_10, 1, 0);

rec Marubozu_Trig_bear = If(Marubozu().bearish , BarNumber(), Marubozu_Trig_bear[1]);

AddLabel(Marubozu_Trig_bear > 0  && showLabel_BBr  && ThreeShows_10, "10=Marubozu" , createColor(255, 255, 153));

Alert(Marubozu().bearish && !TurnAlertOff_BBr, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_10, high + 6 ,  if BubNumbBear

then "10" else if BubVerbBear then "Marubozu" else "" , createColor(255, 255, 153)  , yes);



#MeetingLines_11,
###### 11 ####################### MeetingLines() #############################
def ThreeShows_111 = If (ShowTenth == ShowTenth.MeetingLines_11 or ShowEleventh == ShowEleventh.MeetingLines_11 or ShowThelfth == ShowThelfth.MeetingLines_11, 1, 0);

rec MeetingLines_Trig_bear = If(MeetingLines().bearish , BarNumber(), MeetingLines_Trig_bear[1]);

AddLabel(MeetingLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_111, "11=MeetingLines" , CreateColor(255, 136, 12));

Alert(MeetingLines().bearish && !TurnAlertOff_BBr, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_111, high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "MeetingLines" else "" , CreateColor(255, 136, 12)  , yes);



#SeparatingLines_12,
###### 12 ####################### SeparatingLines() #############################
def ThreeShows_112 = If (ShowTenth == ShowTenth.SeparatingLines_12 or ShowEleventh == ShowEleventh.SeparatingLines_12 or ShowThelfth == ShowThelfth.SeparatingLines_12, 1, 0);

rec SeparatingLines_Trig_bear = If(SeparatingLines().bearish , BarNumber(), SeparatingLines_Trig_bear[1]);

AddLabel(SeparatingLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_112, "12=SeparatingLines" , createColor(255, 255, 153));

Alert(SeparatingLines().bearish && !TurnAlertOff_BBr, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_112,  high + 6 ,  if BubNumbBear

then "12" else if BubVerbBear then "SeparatingLines" else "" , createColor(255, 255, 153)  , yes);



#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() #############################
def ThreeShows_113 = If (ShowTenth == ShowTenth.SideBySideWhiteLines_13 or ShowEleventh == ShowEleventh.SideBySideWhiteLines_13 or ShowThelfth == ShowThelfth.SideBySideWhiteLines_13, 1, 0);

rec SideBySideWhiteLines_Trig_bear = If(SideBySideWhiteLines().bearish , BarNumber(), SideBySideWhiteLines_Trig_bear[1]);

AddLabel(SideBySideWhiteLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_113, "13=SideBySideWhiteLines" , createColor(255, 255, 153));

Alert(SideBySideWhiteLines().bearish && !TurnAlertOff_BBr, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_113, high + 6 ,  if BubNumbBear

then "13" else if BubVerbBear then "SideBySideWhiteLines" else "" , createColor(255, 255, 153)  , yes);



#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() #############################
def ThreeShows_114 = If (ShowTenth == ShowTenth.ThreeLineStrike_14 or ShowEleventh == ShowEleventh.ThreeLineStrike_14 or ShowThelfth == ShowThelfth.ThreeLineStrike_14, 1, 0);

rec ThreeOutsideUp_Trig_bear = If(ThreeLineStrike().bearish , BarNumber(), ThreeOutsideUp_Trig_bear[1]);

AddLabel(ThreeOutsideUp_Trig_bear > 0  && showLabel_BBr  && ThreeShows_114, "14=ThreeLineStrike" , createColor(255, 255, 153));

Alert(ThreeLineStrike().bearish && !TurnAlertOff_BBr, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_114, high + 6 ,  if BubNumbBear

then "14" else if BubVerbBear then "ThreeLineStrike" else "" , createColor(255, 255, 153)  , yes);



#TriStar_15,
###### 15 ####################### TriStar() #############################
def ThreeShows_115 = If (ShowTenth == ShowTenth.TriStar_15 or ShowEleventh == ShowEleventh.TriStar_15 or ShowThelfth == ShowThelfth.TriStar_15, 1, 0);

rec TriStar_Trig_bear = If(TriStar().bearish , BarNumber(), TriStar_Trig_bear[1]);

AddLabel(TriStar_Trig_bear > 0  && showLabel_BBr  && ThreeShows_115 , "15=TriStar" , CreateColor(255, 136, 12));

Alert(TriStar().bearish && !TurnAlertOff_BBr, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_115, high + 6 ,  if BubNumbBear

then "15" else if BubVerbBear then "TriStar" else "" , CreateColor(255, 136, 12)  , yes);



#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() #############################
#def ThreeShows_116 = If (ShowTenth == ShowTenth.WilliamsFractal_16 or ShowEleventh == ShowEleventh.WilliamsFractal_16 or ShowThelfth == ShowThelfth.WilliamsFractal_16, 1, 0);
#rec WilliamsFractal_Trig_downfractal = If(WilliamsFractal().downfractal , BarNumber(), WilliamsFractal_Trig_downfractal[1]);
#AddLabel(WilliamsFractal_Trig_downfractal > 0  && showLabel_BBr  && ThreeShows_116, "16=WilliamsFractal" , color.yellow);
#Alert(WilliamsFractal().downfractal && !TurnAlertOff_BBr, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().downfractal && (BubVerbBear or BubNumbBear) && ThreeShows_116, high + 6 ,  if BubNumbBear
#then "16" else if BubVerbBear then "WilliamsFractal" else "" , color.yellow  , no);



#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() #############################
#def ThreeShows_117 = If (ShowTenth == ShowTenth.ZigZagStepPattern_17 or ShowEleventh == ShowEleventh.ZigZagStepPattern_17 or ShowThelfth == ShowThelfth.ZigZagStepPattern_17, 1, 0);
#rec ZigZagStepPattern_Trig_downstep = If(ZigZagStepPattern().downstep , BarNumber(), ZigZagStepPattern_Trig_downstep[1]);
#AddLabel(ZigZagStepPattern_Trig_downstep > 0  && showLabel_BBr  && ThreeShows_117, "17=ZigZagStepPattern" , color.yellow);
#Alert(ZigZagStepPattern().downstep && !TurnAlertOff_BBr, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().downstep && (BubVerbBear or BubNumbBear) && ThreeShows_117 , high + 6 ,  if BubNumbBear
#then "17" else if BubVerbBear then "ZigZagStepPattern" else "" , color.yellow  , no);



#####################################################################################################
#Start Main Bottom Section

# AbandonedBaby_1,    
###### 1 ####################### AbandonedBaby() & showAll ################################# 10
def  candleAll_101 = If(ShowAll_BBr == yes , AbandonedBaby().bearish, Double.NaN);

plot AB_bearish = candleAll_101;

AB_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AB_bearish.SetDefaultColor(CreateColor(255, 136, 12));

AB_bearish.SetLineWeight(5);

rec AbandonedBaby_Trig_101 = If (AbandonedBaby().bearish, + BarNumber(), AbandonedBaby_Trig_101[1] );

AddLabel(AbandonedBaby_Trig_101 > 0 && showLabel_BBr && ShowAll_BBr, "1=AbandonedBaby" , CreateColor(255, 136, 12));

Alert(AbandonedBaby().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "AbandonedBaby" else "" ,  CreateColor(255, 136, 12) , yes);



#BeltHold_2,
###### 2 ####################### BeltHold() & showAll #################################
def  candleAll_102 = If(ShowAll_BBr == yes , BeltHold().bearish, Double.NaN);

plot BH_bearish = candleAll_102;

BH_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

BH_bearish.SetDefaultColor(CreateColor(255, 136, 12));

BH_bearish.SetLineWeight(5);

rec BeltHold_Trig_102 = If (BeltHold().bearish, + BarNumber(), BeltHold_Trig_102[1] );

AddLabel(BeltHold_Trig_102 > 0 && showLabel_BBr && ShowAll_BBr, "2=BeltHold" , CreateColor(255, 136, 12));

Alert(BeltHold().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "2" else if BubVerbBear then "BeltHold" else "" ,  CreateColor(255, 136, 12) , yes);



# Breakaway_3,  
###### 3 ####################### Breakaway() & showAll #################################
def  candleAll_103 = If(ShowAll_BBr == yes , Breakaway().bearish, Double.NaN);

plot BAWAY_bearish = candleAll_103;

BAWAY_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

BAWAY_bearish.SetDefaultColor(CreateColor(255, 136, 12));

BAWAY_bearish.SetLineWeight(5);

rec Breakaway_Trig_103 = If (Breakaway().bearish, + BarNumber(), Breakaway_Trig_103[1] );

AddLabel(Breakaway_Trig_103 > 0 && showLabel_BBr && ShowAll_BBr, "3=Breakaway" , CreateColor(255, 136, 12));

Alert(Breakaway().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "3" else if BubVerbBear then "Breakaway" else "" ,  CreateColor(255, 136, 12) , yes);


#######if you want to take out or add the dojis, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.

#Doji_4,
###### 4 ####################### Doji() & showAll #################################
#def  candleAll_104 = If(ShowAll_BBr == yes , Doji(), Double.NaN);
#plot DOJI = candleAll_104;
#DOJI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#rec DOJI_Trig_104 = If (Doji(), + BarNumber(), DOJI_Trig_104[1] );
#AddLabel(DOJI_Trig_104 > 0 && showLabel_BBr && ShowAll_BBr, "4=Doji" , Color.YELLOW);
#Alert(Doji()  && !TurnAlertOff_BBr && ShowAll_BBr, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "4" else if BubVerbBear then "Doji" else "" ,  Color.YELLOW , yes);



#Engulfing_5,
###### 5 ####################### Engulfing() & showAll #################################
def  candleAll_105 = If(ShowAll_BBr == yes , Engulfing().bearish, Double.NaN);

plot Engulfing_bearish = candleAll_105;

Engulfing_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Engulfing_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Engulfing_bearish.SetLineWeight(5);

rec Engulfing_Trig_105 = If (Engulfing().bearish, + BarNumber(), Engulfing_Trig_105 [1] );

AddLabel(Engulfing_Trig_105 > 0 && showLabel_BBr && ShowAll_BBr, "5=Engulfing" , CreateColor(255, 136, 12));

Alert(Engulfing().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "5" else if BubVerbBear then "Engulfing" else "" ,  CreateColor(255, 136, 12) , yes);


#Harami_6,
###### 6 ####################### Harami() & showAll #################################
def  candleAll_106 = If(ShowAll_BBr == yes , Harami().bearish, Double.NaN);

plot Harami_bearish = candleAll_106;

Harami_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Harami_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Harami_bearish.SetLineWeight(5);

rec Harami_Trig_106 = If (Harami().bearish, + BarNumber(), Harami_Trig_106[1] );

AddLabel(Harami_Trig_106 > 0 && showLabel_BBr && ShowAll_BBr, "6=Harami" , CreateColor(255, 136, 12));

Alert(Harami().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "6" else if BubVerbBear then "Harami" else "" ,  CreateColor(255, 136, 12) , yes);



#HaramiCross_7,
###### 7 ####################### HaramiCross() & showAll #################################
def  candleAll_107 = If(ShowAll_BBr == yes , HaramiCross().bearish, Double.NaN);

plot HaramiCross_bearish = candleAll_107;

HaramiCross_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); # bearish

HaramiCross_bearish.SetDefaultColor(CreateColor(255, 136, 12));

HaramiCross_bearish.SetLineWeight(5);

rec HaramiCross_Trig_107 = If (HaramiCross().bearish, + BarNumber(), HaramiCross_Trig_107[1] );

AddLabel(HaramiCross_Trig_107 > 0 && showLabel_BBr && ShowAll_BBr, "7=HaramiCross" , CreateColor(255, 136, 12));

Alert(HaramiCross().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "7" else if BubVerbBear then "HaramiCross" else "" ,  CreateColor(255, 136, 12) , yes);


#Kicking_8,
###### 8 ####################### Kicking() & showAll #################################
def  candleAll_108 = If(ShowAll_BBr == yes , Kicking().bearish, Double.NaN);

plot Kicking_bearish = candleAll_108;

Kicking_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Kicking_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Kicking_bearish.SetLineWeight(5);

rec Kicking_Trig_108 = If (Kicking().bearish, + BarNumber(), Kicking_Trig_108[1] );

AddLabel(Kicking_Trig_108 > 0 && showLabel_BBr && ShowAll_BBr, "8=Kicking" , CreateColor(255, 136, 12));

Alert(Kicking().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "8" else if BubVerbBear then "Kicking" else "" ,  CreateColor(255, 136, 12) , yes);


#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() & showAll #################################
def  candleAll_109 = If(ShowAll_BBr == yes , LongLeggedDoji().bearish, Double.NaN);

plot LongLeggedDoji_bearish = candleAll_109;

LongLeggedDoji_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

LongLeggedDoji_bearish.SetDefaultColor(CreateColor(255, 136, 12));

LongLeggedDoji_bearish.SetLineWeight(5);

rec LongLeggedDoji_Trig_109 = If (LongLeggedDoji().bearish, + BarNumber(), LongLeggedDoji_Trig_109[1] );

AddLabel(LongLeggedDoji_Trig_109 > 0 && showLabel_BBr && ShowAll_BBr, "9=LongLeggedDoji" , CreateColor(255, 136, 12));

Alert(LongLeggedDoji().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "9" else if BubVerbBear then "LongLeggedDoji" else "" ,  CreateColor(255, 136, 12) , yes);


#Marubozu_10,
###### 10 ####################### Marubozu() & showAll #################################
def  candleAll_110 = If(ShowAll_BBr == yes , Marubozu().bearish, Double.NaN);

plot Marubozu_bearish = candleAll_110;

Marubozu_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Marubozu_bearish.SetDefaultColor(createColor(255, 255, 153));

Marubozu_bearish.SetLineWeight(5);

rec Marubozu_Trig_110 = If (Marubozu().bearish, + BarNumber(), Marubozu_Trig_110[1] );

AddLabel(Marubozu_Trig_110 > 0 && showLabel_BBr && ShowAll_BBr, "10=Marubozu" , createColor(255, 255, 153));

Alert(Marubozu().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "10" else if BubVerbBear then "Marubozu" else "" ,  createColor(255, 255, 153) , yes);


#MeetingLines_11,
###### 11 ####################### MeetingLines() & showAll #################################
def  candleAll_111 = If(ShowAll_BBr == yes , MeetingLines().bearish, Double.NaN);

plot MeetingLines_bearish = candleAll_111;

MeetingLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

MeetingLines_bearish.SetDefaultColor(CreateColor(255, 136, 12));

MeetingLines_bearish.SetLineWeight(5);

rec MeetingLines_Trig_111 = If (MeetingLines().bearish, + BarNumber(), MeetingLines_Trig_111[1] );

AddLabel(MeetingLines_Trig_111 > 0 && showLabel_BBr && ShowAll_BBr, "11=MeetingLines" , CreateColor(255, 136, 12));

Alert(MeetingLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "11" else if BubVerbBear then "MeetingLines" else "" ,  CreateColor(255, 136, 12) , yes);


#SeparatingLines_12,
###### 12 ####################### SeparatingLines() & showAll #################################
def  candleAll_112 = If(ShowAll_BBr == yes , SeparatingLines().bearish, Double.NaN);

plot SeparatingLines_bearish = candleAll_112;

SeparatingLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SeparatingLines_bearish.SetDefaultColor(createColor(255, 255, 153));

SeparatingLines_bearish.SetLineWeight(5);

rec SeparatingLines_Trig_112 = If (SeparatingLines().bearish, + BarNumber(), SeparatingLines_Trig_112[1] );

AddLabel(SeparatingLines_Trig_112 > 0 && showLabel_BBr && ShowAll_BBr, "12=SeparatingLines" , createColor(255, 255, 153));

Alert(SeparatingLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "12" else if BubVerbBear then "SeparatingLines" else "" ,  createColor(255, 255, 153) , yes);


#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() & showAll #################################
def  candleAll_113 = If(ShowAll_BBr == yes , SideBySideWhiteLines().bearish, Double.NaN);

plot SideBySideWhiteLines_bearish = candleAll_113;

SideBySideWhiteLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SideBySideWhiteLines_bearish.SetDefaultColor(createColor(255, 255, 153));

SideBySideWhiteLines_bearish.SetLineWeight(5);

rec SideBySideWhiteLines_Trig_113 = If (SideBySideWhiteLines().bearish, + BarNumber(), SideBySideWhiteLines_Trig_113[1] );

AddLabel(SideBySideWhiteLines_Trig_113 > 0 && showLabel_BBr && ShowAll_BBr, "13=SideBySideWhiteLines" , createColor(255, 255, 153));

Alert(SideBySideWhiteLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "13" else if BubVerbBear then "SideBySideWhiteLines" else "" ,  createColor(255, 255, 153) , yes);


#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() & showAll #################################
def  candleAll_114 = If(ShowAll_BBr == yes , ThreeLineStrike().bearish, Double.NaN);

plot ThreeLineStrike_bearish = candleAll_114;

ThreeLineStrike_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ThreeLineStrike_bearish.SetDefaultColor(createColor(255, 255, 153));

ThreeLineStrike_bearish.SetLineWeight(5);

rec ThreeLineStrike_Trig_114 = If (ThreeLineStrike().bearish, + BarNumber(), ThreeLineStrike_Trig_114[1] );

AddLabel(ThreeLineStrike_Trig_114 > 0 && showLabel_BBr && ShowAll_BBr, "14=ThreeLineStrike" , createColor(255, 255, 153));

Alert(ThreeLineStrike().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "14" else if BubVerbBear then "ThreeLineStrike" else "" ,  createColor(255, 255, 153) , yes);


#TriStar_15,
###### 15 ####################### TriStar() & showAll #################################
def  candleAll_115 = If(ShowAll_BBr == yes , TriStar().bearish, Double.NaN);

plot TriStar_bearish = candleAll_115;

TriStar_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TriStar_bearish.SetDefaultColor(CreateColor(255, 136, 12));

TriStar_bearish.SetLineWeight(5);

rec TriStar_Trig_115 = If (TriStar().bearish, + BarNumber(), TriStar_Trig_115[1] );

AddLabel(TriStar_Trig_115 > 0 && showLabel_BBr && ShowAll_BBr, "15=TriStar" , CreateColor(255, 136, 12));

Alert(TriStar().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "15" else if BubVerbBear then "TriStar" else "" ,  CreateColor(255, 136, 12) , yes);

#######if you want to take out or add the WilliamsFractal, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.
#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() & showAll #################################
#def  candleAll_116 = If(ShowAll_BBr == yes , WilliamsFractal().downfractal, Double.NaN);
#plot WilliamsFractal = candleAll_116;
#WilliamsFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#WilliamsFractal.SetDefaultColor(CreateColor(255, 136, 12));
#WilliamsFractal.SetLineWeight(5);
#rec WilliamsFractal_Trig_116 = If (WilliamsFractal().DownFractal, + BarNumber(), WilliamsFractal_Trig_116[1] );
#AddLabel(WilliamsFractal_Trig_116 is true && showLabel_BBr && ShowAll_BBr, "16=WilliamsFractal" , Color.YELLOW); # changed > 0 to is true
#Alert(WilliamsFractal().DownFractal  && !TurnAlertOff_BBr && ShowAll_BBr, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().DownFractal && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "16" else if BubVerbBear then "WilliamsFractal" else "" ,  Color.YELLOW , yes);

#######if you want to take out or add the ZigZagStepPattern, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.

#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() & showAll #################################
#def  candleAll_117 = If(ShowAll_BBr == yes , ZigZagStepPattern().downstep, Double.NaN);
#plot ZigZagStepPattern = candleAll_117;
#ZigZagStepPattern.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#ZigZagStepPattern.SetDefaultColor(CreateColor(255, 136, 12));
#ZigZagStepPattern.SetLineWeight(5);
#rec ZigZagStepPattern_Trig_117 = If (ZigZagStepPattern().upstep, + BarNumber(), ZigZagStepPattern_Trig_117[1]);
#AddLabel(ZigZagStepPattern_Trig_117 is true && showLabel_BBr && ShowAll_BBr, "17=ZigZagStepPattern" , Color.YELLOW); # changed > 0 to is true
#Alert(ZigZagStepPattern().downstep  && !TurnAlertOff_BBr && ShowAll_BBr, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().downstep && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "17" else if BubVerbBear then "ZigZagStepPattern" else "" ,  Color.YELLOW , yes);

Here is all 4 study patterns verbose:
XsBYuro.png


Here is all 4 study patterns ID #:
PBgLBOO.png
 
Nice work mourningwood4521. Its quite informational to look at a chart and see these arrows/texts to help understand the candle type. I am a newbie and I find this very helpful.
 
Hello everyone, this is my first big study I've worked on, been busy the last weekend so I didn't post it once I finished it. @BenTen had posted this study on this thread and I thought it was awesome, The format was started based on the 2013 patterns available and someone added on to it. I reorganized it so it's in order of the current order of available patterns on this definition list.I also changed the color so the darker shade is the reversal, and a lighter shade of the same color is signaling a continuation. All of this info is added to an addlabel for each study. As you can see, you can change the inputs to show various metrics of the patterns, just an arrow, number ID, and verbose(the pattern name). You can also select up 3 patterns which will show instead of all of them. I won't go into detail on the bull because a working version is already up at the first link on this document. Use all 4 studies together on your upper, or pick and choose which ones you want to use. Super helpful for learning which kinds of candles occur the most often, which ones will get ignored the most, etc. some I have found will be a strong reversal signal

I will post another version in the comments once I finish that it is a work in progress still. It will show just the patterns and you can't select a certain few to display, it will only show all patterns regardless of the 4 types of patterns, meaning bull, bear, B&B Bull, B&B bear.

It helps if you put the studies in the order I listed below, because I have:
Show 1st, 2nd, 3rd for bull only.
Show 3rd, 4th, 5th for bear only.
Show 7th, 8th, 9th for B&B Bull only.
Show 10th, 11th, 12th for B&B Bear only

This is verbose only bull:
0cm3aB8.png


Code Bull only:
Code:
#Bullish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021
#Report any problems to 'StanL' on TOS' ThinkScript Lounge
#Revision date 3:36 PM 9/29/2013

AddLabel(yes, "Bullish only Reversals", CreateColor(0, 255, 0));
AddLabel(yes, "Bullish only Continuations: 3, 7, 12, 19, 20", CreateColor(153, 255, 153));

input TurnAlertOff_bull = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_bull = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubble_bull = {default none_bull, Verbose_bull, ID_Number_bull};#Hint showBubble:Choice of what format the candle bubble ID should have

input ShowAll_bull = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.


def BubNone_bull = If (showBubble_bull == showBubble_bull.none_bull, 1, 0);

def BubVerb_bull = If (showBubble_bull == showBubble_bull.Verbose_bull, 1, 0);

def BubNumb_bull =  If (showBubble_bull == showBubble_bull.ID_Number_bull, 1, 0);

#####################################################
############ Define the three selection Enums #################
#####################################################

input ShowFirst =  {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

input ShowSecond = {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

input ShowThird =  {default none, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #hint ShowSecond:Select the candle to show

###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle;

switch (ShowFirst) {
case ConcealingBabySwallow_1:

    candle = If(ShowFirst.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle =  If(ShowFirst.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle = If(ShowFirst.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle = If(ShowFirst.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle = If(ShowFirst.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle = If(ShowFirst.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle = If(ShowFirst.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle = If(ShowFirst.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle = If(ShowFirst.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle = If(ShowFirst.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle = If(ShowFirst.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle = If(ShowFirst.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle = If(ShowFirst.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle = If(ShowFirst.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle = If(ShowFirst.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle = If(ShowFirst.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle = If(ShowFirst.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle = If(ShowFirst.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle = If(ShowFirst.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle = If(ShowFirst.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle;

Show1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show1st.SetDefaultColor(Color.GREEN);

Show1st.SetLineWeight(5);
#####################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle2;

switch (ShowSecond) {
case ConcealingBabySwallow_1:

    candle2 = If(ShowSecond.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle2 =  If(ShowSecond.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle2 = If(ShowSecond.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle2 = If(ShowSecond.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle2 = If(ShowSecond.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle2 = If(ShowSecond.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle2 = If(ShowSecond.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle2 = If(ShowSecond.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle2 = If(ShowSecond.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle2 = If(ShowSecond.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle2 = If(ShowSecond.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle2 = If(ShowSecond.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle2 = If(ShowSecond.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle2 = If(ShowSecond.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle2 = If(ShowSecond.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle2 = If(ShowSecond.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle2 = If(ShowSecond.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle2 = If(ShowSecond.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle2 = If(ShowSecond.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle2 = If(ShowSecond.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle2 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;

Show2nd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show2nd.SetDefaultColor(Color.GREEN);

Show2nd.SetLineWeight(5);
#####################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle3;

switch (ShowThird) {
case ConcealingBabySwallow_1:

    candle3 = If(ShowThird.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:

    candle3 =  If(ShowThird.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:

    candle3 = If(ShowThird.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:

    candle3 = If(ShowThird.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:

    candle3 = If(ShowThird.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:

    candle3 = If(ShowThird.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:

    candle3 = If(ShowThird.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:

    candle3 = If(ShowThird.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:

    candle3 = If(ShowThird.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:

    candle3 = If(ShowThird.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:

    candle3 = If(ShowThird.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:

    candle3 = If(ShowThird.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:

    candle3 = If(ShowThird.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:

    candle3 = If(ShowThird.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:

    candle3 = If(ShowThird.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:

    candle3 = If(ShowThird.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:

    candle3 = If(ShowThird.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:

    candle3 = If(ShowThird.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:

    candle3 = If(ShowThird.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:

    candle3 = If(ShowThird.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case none:
    candle3 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;

Show3rd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show3rd.SetDefaultColor(Color.GREEN);

Show3rd.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

#ConcealingBabySwallow_1,
###### 1 ####################### ConcealingBabySwallow() #############################
def ThreeShows_1 = If (ShowFirst == ShowFirst.ConcealingBabySwallow_1 or ShowSecond == ShowSecond.ConcealingBabySwallow_1 or ShowThird == ShowThird.ConcealingBabySwallow_1, 1, 0);

rec ConcealingBabySwallow_Trig = If(ConcealingBabySwallow().bullish , ConcealingBabySwallow(), ConcealingBabySwallow_Trig[1]);

AddLabel(ConcealingBabySwallow_Trig > 0  && showLabel_bull  && ThreeShows_1, "1=ConcealingBabySwallow" , CreateColor(0, 255, 0));

Alert(ConcealingBabySwallow() && !TurnAlertOff_bull, "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);

AddChartBubble(ConcealingBabySwallow() && (BubVerb_bull or BubNumb_bull) && ThreeShows_1 , low -15 ,  if BubNumb_bull

then "1" else if BubVerb_bull then "ConcealingBabySwallow" else "" , CreateColor(0, 255, 0)  , no);



#Hammer_2, 
###### 2 ####################### Hammer() #############################
def ThreeShows_2 = If (ShowFirst == ShowFirst.Hammer_2 or ShowSecond == ShowSecond.Hammer_2 or ShowThird == ShowThird.Hammer_2, 1, 0);

rec Hammer_Trig = If(Hammer().bullish , Hammer(), Hammer_Trig[1]);

AddLabel(Hammer_Trig > 0  && showLabel_bull  && ThreeShows_2, "2=Hammer" , CreateColor(0, 255, 0));

Alert(Hammer() && !TurnAlertOff_bull, "Hammer", Alert.BAR, Sound.Chimes);

AddChartBubble(Hammer() && (BubVerb_bull or BubNumb_bull) && ThreeShows_2, low -15 ,  if BubNumb_bull

then "2" else if BubVerb_bull then "Hammer" else "" , CreateColor(0, 255, 0)  , no);



#HighPriceGappingPlay_3, #C
###### 2 ####################### HighPriceGappingPlay() #############################
def ThreeShows_3 = If (ShowFirst == ShowFirst.HighPriceGappingPlay_3 or ShowSecond == ShowSecond.HighPriceGappingPlay_3 or ShowThird == ShowThird.HighPriceGappingPlay_3, 1, 0);

rec HighPriceGappingPlay_Trig = If(HighPriceGappingPlay().bullish , HighPriceGappingPlay(), HighPriceGappingPlay_Trig[1]);

AddLabel(HighPriceGappingPlay_Trig > 0  && showLabel_bull  && ThreeShows_3, "3=HighPriceGappingPlay" , CreateColor(153, 255, 153));

Alert(HighPriceGappingPlay() && !TurnAlertOff_bull, "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(HighPriceGappingPlay() && (BubVerb_bull or BubNumb_bull) && ThreeShows_3, low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "HighPriceGappingPlay" else "" , CreateColor(153, 255, 153)  , no);


#HomingPigeon_4,
###### 4 ####################### HomingPigeon() #############################
def ThreeShows_4 = If (ShowFirst == ShowFirst.HomingPigeon_4 or ShowSecond == ShowSecond.HomingPigeon_4 or ShowThird == ShowThird.HomingPigeon_4, 1, 0);

rec HomingPigeon_Trig = If(HomingPigeon().bullish , HomingPigeon(), HomingPigeon_Trig[1]);

AddLabel(HomingPigeon_Trig > 0  && showLabel_bull  && ThreeShows_4, "4=HomingPigeon" , CreateColor(0, 255, 0));

Alert(HomingPigeon() && !TurnAlertOff_bull, "HomingPigeon", Alert.BAR, Sound.Chimes);

AddChartBubble(HomingPigeon() && (BubVerb_bull or BubNumb_bull) && ThreeShows_4, low -15 ,  if BubNumb_bull

then "4" else if BubVerb_bull then "HomingPigeon" else "" , CreateColor(0, 255, 0)  , no);


#InvertedHammer_5,
###### 5 ####################### InvertedHammer() #############################
def ThreeShows_5 = If (ShowFirst == ShowFirst.InvertedHammer_5 or ShowSecond == ShowSecond.InvertedHammer_5 or ShowThird == ShowThird.InvertedHammer_5, 1, 0);

rec InvertedHammer_Trig = If(InvertedHammer().bullish , InvertedHammer(), InvertedHammer_Trig[1]);

AddLabel(InvertedHammer_Trig > 0  && showLabel_bull  && ThreeShows_5, "5=InvertedHammer" , CreateColor(0, 255, 0));

Alert(InvertedHammer() && !TurnAlertOff_bull, "InvertedHammer", Alert.BAR, Sound.Chimes);

AddChartBubble(InvertedHammer() && (BubVerb_bull or BubNumb_bull) && ThreeShows_5, low -15 ,  if BubNumb_bull

then "5" else if BubVerb_bull then "InvertedHammer" else "" , CreateColor(0, 255, 0)  , no);

#MatchingLow_6,
###### 6 ####################### MatchingLow() #############################
def ThreeShows_6 = If (ShowFirst == ShowFirst.MatchingLow_6 or ShowSecond == ShowSecond.MatchingLow_6 or ShowThird == ShowThird.MatchingLow_6, 1, 0);

rec MatchingLow_Trig = If(MatchingLow().bullish , MatchingLow(), MatchingLow_Trig[1]);

AddLabel(MatchingLow_Trig > 0  && showLabel_bull  && ThreeShows_6, "6=MatchingLow" , CreateColor(0, 255, 0));

Alert(MatchingLow() && !TurnAlertOff_bull, "MatchingLow", Alert.BAR, Sound.Chimes);

AddChartBubble(MatchingLow() && (BubVerb_bull or BubNumb_bull) && ThreeShows_6, low -15 ,  if BubNumb_bull

then "6" else if BubVerb_bull then "MatchingLow" else "" , CreateColor(0, 255, 0)  , no);

#MatHold_7,  #C
###### 7 ####################### MatHold() #############################
def ThreeShows_7 = If (ShowFirst == ShowFirst.MatHold_7 or ShowSecond == ShowSecond.MatHold_7 or ShowThird == ShowThird.MatHold_7, 1, 0);

rec MatHold_Trig = If(MatHold().bullish , MatHold(), MatHold_Trig[1]);

AddLabel(MatHold_Trig > 0  && showLabel_bull  && ThreeShows_7, "7=MatHold" , CreateColor(153, 255, 153));

Alert(MatHold() && !TurnAlertOff_bull, "MatHold", Alert.BAR, Sound.Chimes);

AddChartBubble(MatHold() && (BubVerb_bull or BubNumb_bull) && ThreeShows_7, low -15 ,  if BubNumb_bull

then "7" else if BubVerb_bull then "MatHold" else "" , CreateColor(153, 255, 153)  , no);



#MorningDojiStar_8,
###### 2 ####################### MorningDojiStar() #############################
def ThreeShows_8 = If (ShowFirst == ShowFirst.MorningDojiStar_8 or ShowSecond == ShowSecond.MorningDojiStar_8 or ShowThird == ShowThird.MorningDojiStar_8, 1, 0);

rec MorningDojiStar_Trig = If(MorningDojiStar().bullish , MorningDojiStar(), MorningDojiStar_Trig[1]);

AddLabel(MorningDojiStar_Trig > 0  && showLabel_bull  && ThreeShows_8, "8=MorningDojiStar" , CreateColor(0, 255, 0));

Alert(MorningDojiStar() && !TurnAlertOff_bull, "MorningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningDojiStar() && (BubVerb_bull or BubNumb_bull) && ThreeShows_8, low -15 ,  if BubNumb_bull

then "8" else if BubVerb_bull then "MorningDojiStar" else "" , CreateColor(0, 255, 0)  , no);



#MorningStar_9,
###### 9 ####################### MorningStar() #############################
def ThreeShows_9 = If (ShowFirst == ShowFirst.MorningStar_9 or ShowSecond == ShowSecond.MorningStar_9 or ShowThird == ShowThird.MorningStar_9, 1, 0);

rec MorningStar_Trig = If(MorningStar().bullish , MorningStar(), MorningStar_Trig[1]);

AddLabel(MorningStar_Trig > 0  && showLabel_bull  && ThreeShows_9, "9=MorningStar" , CreateColor(0, 255, 0));

Alert(MorningStar() && !TurnAlertOff_bull, "MorningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningStar() && (BubVerb_bull or BubNumb_bull) && ThreeShows_9, low -15 ,  if BubNumb_bull

then "9" else if BubVerb_bull then "MorningStar" else "" , CreateColor(0, 255, 0)  , no);



#OneWhiteSoldier_10,
###### 10 ####################### OneWhiteSoldier() #############################
def ThreeShows_10 = If (ShowFirst == ShowFirst.OneWhiteSoldier_10 or ShowSecond == ShowSecond.OneWhiteSoldier_10 or ShowThird == ShowThird.OneWhiteSoldier_10, 1, 0);

rec OneWhiteSoldier_Trig = If(OneWhiteSoldier().bullish , OneWhiteSoldier(), OneWhiteSoldier_Trig[1]);

AddLabel(OneWhiteSoldier_Trig > 0  && showLabel_bull  && ThreeShows_10, "10=OneWhiteSoldier" , CreateColor(0, 255, 0));

Alert(OneWhiteSoldier() && !TurnAlertOff_bull, "OneWhiteSoldier", Alert.BAR, Sound.Chimes);

AddChartBubble(OneWhiteSoldier() && (BubVerb_bull or BubNumb_bull) && ThreeShows_10, low -15 ,  if BubNumb_bull

then "10" else if BubVerb_bull then "OneWhiteSoldier" else "" , CreateColor(0, 255, 0)  , no);




#PiercingLine_11,
###### 11 ####################### PiercingLine() #############################
def ThreeShows_11 = If (ShowFirst == ShowFirst.PiercingLine_11 or ShowSecond == ShowSecond.PiercingLine_11 or ShowThird == ShowThird.PiercingLine_11, 1, 0);

rec PiercingLine_Trig = If(PiercingLine().bullish , PiercingLine(), Hammer_Trig[1]);

AddLabel(Hammer_Trig > 0  && showLabel_bull  && ThreeShows_11, "11=PiercingLine" , CreateColor(0, 255, 0));

Alert(PiercingLine() && !TurnAlertOff_bull, "PiercingLine", Alert.BAR, Sound.Chimes);

AddChartBubble(PiercingLine() && (BubVerb_bull or BubNumb_bull) && ThreeShows_11, low -15 ,  if BubNumb_bull

then "11" else if BubVerb_bull then "PiercingLine" else "" , CreateColor(0, 255, 0)  , no);



#RisingThreeMethods_12, #C
###### 12 ####################### RisingThreeMethods() #############################
def ThreeShows_12 = If (ShowFirst == ShowFirst.RisingThreeMethods_12 or ShowSecond == ShowSecond.RisingThreeMethods_12 or ShowThird == ShowThird.RisingThreeMethods_12, 1, 0);

rec RisingThreeMethods_Trig = If(RisingThreeMethods().bullish , RisingThreeMethods(), RisingThreeMethods_Trig[1]);

AddLabel(RisingThreeMethods_Trig > 0  && showLabel_bull  && ThreeShows_12, "3=RisingThreeMethods" , CreateColor(153, 255, 153));

Alert(RisingThreeMethods() && !TurnAlertOff_bull, "RisingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(RisingThreeMethods() && (BubVerb_bull or BubNumb_bull) && ThreeShows_12, low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "RisingThreeMethods" else "" , CreateColor(153, 255, 153)  , no);





#Sticksandwich_13,
###### 13 ####################### Sticksandwich() #############################
def ThreeShows_13 = If (ShowFirst == ShowFirst.Sticksandwich_13 or ShowSecond == ShowSecond.Sticksandwich_13 or ShowThird == ShowThird.Sticksandwich_13, 1, 0);

rec Sticksandwich_Trig = If(Sticksandwich().bullish , Sticksandwich(), Sticksandwich_Trig[1]);

AddLabel(Sticksandwich_Trig > 0  && showLabel_bull  && ThreeShows_13, "13=Sticksandwich" , CreateColor(0, 255, 0));

Alert(Sticksandwich() && !TurnAlertOff_bull, "Sticksandwich", Alert.BAR, Sound.Chimes);

AddChartBubble(Sticksandwich() && (BubVerb_bull or BubNumb_bull) && ThreeShows_13, low -15 ,  if BubNumb_bull

then "13" else if BubVerb_bull then "Sticksandwich" else "" , CreateColor(0, 255, 0)  , no);



#ThreeInsideUp_14,
###### 14 ####################### ThreeInsideUp() #############################
def ThreeShows_14 = If (ShowFirst == ShowFirst.ThreeInsideUp_14 or ShowSecond == ShowSecond.ThreeInsideUp_14 or ShowThird == ShowThird.ThreeInsideUp_14, 1, 0);

rec ThreeInsideUp_Trig = If(ThreeInsideUp().bullish , ThreeInsideUp(), ThreeInsideUp_Trig[1]);

AddLabel(ThreeInsideUp_Trig > 0  && showLabel_bull  && ThreeShows_14, "14=ThreeInsideUp" , CreateColor(0, 255, 0));

Alert(ThreeInsideUp() && !TurnAlertOff_bull, "ThreeInsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideUp() && (BubVerb_bull or BubNumb_bull) && ThreeShows_14, low -15 ,  if BubNumb_bull

then "14" else if BubVerb_bull then "ThreeInsideUp" else "" , CreateColor(0, 255, 0)  , no);




#ThreeOutsideUp_15,
###### 15 ####################### ThreeOutsideUp() #############################
def ThreeShows_15 = If (ShowFirst == ShowFirst.ThreeOutsideUp_15 or ShowSecond == ShowSecond.ThreeOutsideUp_15 or ShowThird == ShowThird.ThreeOutsideUp_15, 1, 0);

rec ThreeOutsideUp_Trig = If(ThreeOutsideUp().bullish , ThreeOutsideUp(), ThreeOutsideUp_Trig[1]);

AddLabel(ThreeOutsideUp_Trig > 0  && showLabel_bull  && ThreeShows_15, "15=ThreeOutsideUp" , CreateColor(0, 255, 0));

Alert(ThreeOutsideUp() && !TurnAlertOff_bull, "ThreeOutsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideUp() && (BubVerb_bull or BubNumb_bull) && ThreeShows_15, low -15 ,  if BubNumb_bull

then "15" else if BubVerb_bull then "ThreeOutsideUp" else "" , CreateColor(0, 255, 0)  , no);




#ThreeStarsInTheSouth_16,
###### 2 ####################### ThreeStarsInTheSouth() #############################
def ThreeShows_16 = If (ShowFirst == ShowFirst.ThreeStarsInTheSouth_16 or ShowSecond == ShowSecond.ThreeStarsInTheSouth_16 or ShowThird == ShowThird.ThreeStarsInTheSouth_16, 1, 0);

rec ThreeStarsInTheSouth_Trig = If(ThreeStarsInTheSouth().bullish , ThreeStarsInTheSouth(), ThreeStarsInTheSouth_Trig[1]);

AddLabel(ThreeStarsInTheSouth_Trig > 0  && showLabel_bull  && ThreeShows_16, "16=ThreeStarsInTheSouth" , CreateColor(0, 255, 0));

Alert(ThreeStarsInTheSouth() && !TurnAlertOff_bull, "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeStarsInTheSouth() && (BubVerb_bull or BubNumb_bull) && ThreeShows_16, low -15 ,  if BubNumb_bull

then "16" else if BubVerb_bull then "ThreeStarsInTheSouth" else "" , CreateColor(0, 255, 0)  , no);




#ThreeWhiteSoldiers_17,
###### 1 ####################### ThreeWhiteSoldiers() #############################
def ThreeShows_17 = If (ShowFirst == ShowFirst.ThreeWhiteSoldiers_17 or ShowSecond == ShowSecond.ThreeWhiteSoldiers_17 or ShowThird == ShowThird.ThreeWhiteSoldiers_17, 1, 0);

rec ThreeWhiteSoldiers_Trig = If(ThreeWhiteSoldiers().bullish , ThreeWhiteSoldiers(), ThreeWhiteSoldiers_Trig[1]);

AddLabel(ThreeWhiteSoldiers_Trig > 0  && showLabel_bull  && ThreeShows_17, "17=ThreeWhiteSoldiers" , CreateColor(0, 255, 0));

Alert(ThreeWhiteSoldiers() && !TurnAlertOff_bull, "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeWhiteSoldiers() && (BubVerb_bull or BubNumb_bull) && ThreeShows_17 , low -15 ,  if BubNumb_bull

then "17" else if BubVerb_bull then "ThreeWhiteSoldiers" else "" , CreateColor(0, 255, 0)  , no);




#UniqueThreeRiverBottom_18,
###### 18 ####################### UniqueThreeRiverBottom() #############################
def ThreeShows_18 = If (ShowFirst == ShowFirst.UniqueThreeRiverBottom_18 or ShowSecond == ShowSecond.UniqueThreeRiverBottom_18 or ShowThird == ShowThird.UniqueThreeRiverBottom_18, 1, 0);

rec UniqueThreeRiverBottom_Trig = If(UniqueThreeRiverBottom().bullish , UniqueThreeRiverBottom(), UniqueThreeRiverBottom_Trig[1]);

AddLabel(UniqueThreeRiverBottom_Trig > 0  && showLabel_bull  && ThreeShows_18, "18=UniqueThreeRiverBottom" , CreateColor(0, 255, 0));

Alert(UniqueThreeRiverBottom() && !TurnAlertOff_bull, "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);

AddChartBubble(UniqueThreeRiverBottom() && (BubVerb_bull or BubNumb_bull) && ThreeShows_1 , low -15 ,  if BubNumb_bull

then "18" else if BubVerb_bull then "UniqueThreeRiverBottom" else "" , CreateColor(0, 255, 0)  , no);



#UpsideGapThreeMethods_19, #C
###### 19 ####################### UpsideGapThreeMethods() #############################
def ThreeShows_19 = If (ShowFirst == ShowFirst.UpsideGapThreeMethods_19 or ShowSecond == ShowSecond.UpsideGapThreeMethods_19 or ShowThird == ShowThird.UpsideGapThreeMethods_19, 1, 0);

rec UpsideGapThreeMethods_Trig = If(UpsideGapThreeMethods().bullish , UpsideGapThreeMethods(), UpsideGapThreeMethods_Trig[1]);

AddLabel(UpsideGapThreeMethods_Trig > 0  && showLabel_bull  && ThreeShows_19, "19=UpsideGapThreeMethods" , CreateColor(153, 255, 153));

Alert(UpsideGapThreeMethods() && !TurnAlertOff_bull, "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapThreeMethods() && (BubVerb_bull or BubNumb_bull) && ThreeShows_19 , low -15 ,  if BubNumb_bull

then "19" else if BubVerb_bull then "UpsideGapThreeMethods" else "" , CreateColor(153, 255, 153)  , no);



#UpsideTasukiGap_20,    #C
###### 20 ####################### UpsideTasukiGap() #############################
def ThreeShows_20 = If (ShowFirst == ShowFirst.UpsideTasukiGap_20 or ShowSecond == ShowSecond.UpsideTasukiGap_20 or ShowThird == ShowThird.UpsideTasukiGap_20, 1, 0);

rec UpsideTasukiGap_Trig = If(UpsideTasukiGap().bullish , UpsideTasukiGap(), UpsideTasukiGap_Trig[1]);

AddLabel(UpsideTasukiGap_Trig > 0  && showLabel_bull  && ThreeShows_20, "20=UpsideTasukiGap" , CreateColor(153, 255, 153));

Alert(UpsideTasukiGap() && !TurnAlertOff_bull, "UpsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideTasukiGap() && (BubVerb_bull or BubNumb_bull) && ThreeShows_20 , low -15 ,  if BubNumb_bull

then "20" else if BubVerb_bull then "UpsideTasukiGap" else "" , CreateColor(153, 255, 153)  , no);


##################################################################################################################################


#ConcealingBabySwallow_1, # R
###### 1 ####################### ConcealingBabySwallow() #############################
def candleAll_1 =  If(ShowAll_bull == yes , ConcealingBabySwallow(), Double.NaN);

plot CBS = candleAll_1;

CBS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

CBS.SetDefaultColor(CreateColor(0, 255, 0));

CBS.SetLineWeight(5);

rec ConcealingBabySwallow_Trig_1 = If (ConcealingBabySwallow().bullish , + BarNumber(), ConcealingBabySwallow_Trig_1[1] );

AddLabel(ConcealingBabySwallow_Trig_1 > 0 && showLabel_bull && ShowAll_bull,  "1=ConcealingBabySwallow" , CreateColor(0, 255, 0));

Alert(ConcealingBabySwallow()  && !TurnAlertOff_bull && ShowAll_bull, "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);

AddChartBubble(ConcealingBabySwallow() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "1" else if BubVerb_bull then "ConcealingBabySwallow" else "" ,  CreateColor(0, 255, 0) , no);



#Hammer_2,    # R
###### 2 ####################### Hammer() #############################
def candleAll_2 =  If(ShowAll_bull == yes , Hammer(), Double.NaN);

plot Hammer = candleAll_2;

Hammer.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Hammer.SetDefaultColor(CreateColor(0, 255, 0));

Hammer.SetLineWeight(5);

rec Hammer_Trig_2 = If (Hammer().bullish , + BarNumber(), Hammer_Trig_2[1] );

AddLabel(Hammer_Trig_2 > 0 && showLabel_bull && ShowAll_bull,  "2=Hammer" , CreateColor(0, 255, 0));

Alert(Hammer()  && !TurnAlertOff_bull && ShowAll_bull, "Hammer", Alert.BAR, Sound.Chimes);

AddChartBubble(Hammer() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "2" else if BubVerb_bull then "Hammer" else "" ,  CreateColor(0, 255, 0) , no);




#HighPriceGappingPlay_3, #C
###### 3 ####################### HighPriceGappingPlay() & showAll #################################
def  candleAll_3 = If(ShowAll_bull == yes , HighPriceGappingPlay(), Double.NaN);

plot AB = candleAll_3;

AB.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

AB.SetDefaultColor(CreateColor(153, 255, 153));

AB.SetLineWeight(5);

rec HighPriceGappingPlay_Trig_3 = If (HighPriceGappingPlay().bullish, + BarNumber(), HighPriceGappingPlay_Trig_3[1] );

AddLabel(HighPriceGappingPlay_Trig_3 > 0 && showLabel_bull && ShowAll_bull, "3=HighPriceGappingPlay" , CreateColor(153, 255, 153));

Alert(HighPriceGappingPlay()  && !TurnAlertOff_bull && ShowAll_bull, "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(HighPriceGappingPlay() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "3" else if BubVerb_bull then "HighPriceGappingPlay" else "" ,  CreateColor(153, 255, 153) , no);





#HomingPigeon_4, #R
###### 4 ####################### HomingPigeon() & showAll #################################
def candleAll_4 =  If(ShowAll_bull == yes , HomingPigeon(), Double.NaN);

plot HP = candleAll_4;

HP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

HP.SetDefaultColor(CreateColor(0, 255, 0));

HP.SetLineWeight(5);

rec HomingPigeon_Trig_4 = If (HomingPigeon().bullish , + BarNumber(), HomingPigeon_Trig_4[1] );

AddLabel(HomingPigeon_Trig_4 > 0 && showLabel_bull && ShowAll_bull,  "4=HomingPigeon" , CreateColor(0, 255, 0));

Alert(HomingPigeon()  && !TurnAlertOff_bull && ShowAll_bull, "HomingPigeon", Alert.BAR, Sound.Chimes);

AddChartBubble(HomingPigeon() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "4" else if BubVerb_bull then "HomingPigeon" else "" ,  CreateColor(0, 255, 0) , no);



#InvertedHammer_5,
###### 5 ####################### InvertedHammer() #############################
def candleAll_5 =  If(ShowAll_bull == yes , InvertedHammer(), Double.NaN);

plot INVHammer = candleAll_5;

INVHammer.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

INVHammer.SetDefaultColor(CreateColor(0, 255, 0));

INVHammer.SetLineWeight(5);

rec InvertedHammer_Trig_5 = If (InvertedHammer().bullish , + BarNumber(), InvertedHammer_Trig_5[1] );

AddLabel(InvertedHammer_Trig_5 > 0 && showLabel_bull && ShowAll_bull,  "5=InvertedHammer" , CreateColor(0, 255, 0));

Alert(InvertedHammer()  && !TurnAlertOff_bull && ShowAll_bull, "InvertedHammer", Alert.BAR, Sound.Chimes);

AddChartBubble(InvertedHammer() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "5" else if BubVerb_bull then "InvertedHammer" else "" ,  CreateColor(0, 255, 0) , no);



#MatchingLow_6,
###### 6 ####################### MatchingLow() #############################
def candleAll_6 =  If(ShowAll_bull == yes , MatchingLow(), Double.NaN);

plot ML = candleAll_6;

ML.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

ML.SetDefaultColor(CreateColor(0, 255, 0));

ML.SetLineWeight(5);

rec MatchingLow_Trig_6 = If (MatchingLow().bullish , + BarNumber(), MatchingLow_Trig_6[1] );

AddLabel(MatchingLow_Trig_6 > 0 && showLabel_bull && ShowAll_bull,  "6=MatchingLow" , CreateColor(0, 255, 0));

Alert(MatchingLow()  && !TurnAlertOff_bull && ShowAll_bull, "MatchingLow", Alert.BAR, Sound.Chimes);

AddChartBubble(MatchingLow() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "6" else if BubVerb_bull then "MatchingLow" else "" ,  CreateColor(0, 255, 0) , no);





#MatHold_7, #C
###### 7 ####################### MatHold() #############################
def  candleAll_7 = If(ShowAll_bull == yes , MatHold(), Double.NaN);

plot MH = candleAll_7;

MH.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MH.SetDefaultColor(CreateColor(153, 255, 153));

MH.SetLineWeight(5);

rec MatHold_Trig_7 = If (MatHold().bullish, + BarNumber(), MatHold_Trig_7[1] );

AddLabel(MatHold_Trig_7 > 0 && showLabel_bull && ShowAll_bull, "7=MatHold" , CreateColor(153, 255, 153));

Alert(MatHold()  && !TurnAlertOff_bull && ShowAll_bull, "MatHold", Alert.BAR, Sound.Chimes);

AddChartBubble(MatHold() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "7" else if BubVerb_bull then "MatHold" else "" ,  CreateColor(153, 255, 153) , no);

#MorningDojiStar_8,
###### 2 ####################### MorningDojiStar() #############################
def candleAll_8 =  If(ShowAll_bull == yes , MorningDojiStar(), Double.NaN);

plot MDS = candleAll_8;

MDS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MDS.SetDefaultColor(CreateColor(0, 255, 0));

MDS.SetLineWeight(5);

rec MorningDojiStar_Trig_8 = If (MorningDojiStar().bullish , + BarNumber(), MorningDojiStar_Trig_8[1] );

AddLabel(MorningDojiStar_Trig_8 > 0 && showLabel_bull && ShowAll_bull,  "8=MorningDojiStar" , CreateColor(0, 255, 0));

Alert(MorningDojiStar()  && !TurnAlertOff_bull && ShowAll_bull, "MorningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningDojiStar() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "8" else if BubVerb_bull then "MorningDojiStar" else "" ,  CreateColor(0, 255, 0) , no);




#MorningStar_9,
###### 9 ####################### MorningStar() #############################
def candleAll_9 =  If(ShowAll_bull == yes , MorningStar(), Double.NaN);

plot MS = candleAll_9;

MS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MS.SetDefaultColor(CreateColor(0, 255, 0));

MS.SetLineWeight(5);

rec MorningStar_Trig_9 = If (MorningStar().bullish , + BarNumber(), MorningStar_Trig_9[1] );

AddLabel(MorningStar_Trig_9 > 0 && showLabel_bull && ShowAll_bull,  "9=MorningStar" , CreateColor(0, 255, 0));

Alert(MorningStar()  && !TurnAlertOff_bull && ShowAll_bull, "MorningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(MorningStar() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "9" else if BubVerb_bull then "MorningStar" else "" ,  CreateColor(0, 255, 0) , no);


#OneWhiteSoldier_10,
###### 10 ####################### OneWhiteSoldier() #############################
def candleAll_10 =  If(ShowAll_bull == yes , OneWhiteSoldier(), Double.NaN);

plot OWS = candleAll_10;

OWS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

OWS.SetDefaultColor(CreateColor(0, 255, 0));

OWS.SetLineWeight(5);

rec OneWhiteSoldier_Trig_10 = If (OneWhiteSoldier().bullish , + BarNumber(), OneWhiteSoldier_Trig_10[1] );

AddLabel(OneWhiteSoldier_Trig_10 > 0 && showLabel_bull && ShowAll_bull,  "10=OneWhiteSoldier" , CreateColor(0, 255, 0));

Alert(OneWhiteSoldier()  && !TurnAlertOff_bull && ShowAll_bull, "OneWhiteSoldier", Alert.BAR, Sound.Chimes);

AddChartBubble(OneWhiteSoldier() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "10" else if BubVerb_bull then "OneWhiteSoldier" else "" ,  CreateColor(0, 255, 0) , no);



#PiercingLine_11,
###### 11 ####################### PiercingLine() #############################
def candleAll_11 =  If(ShowAll_bull == yes , PiercingLine(), Double.NaN);

plot PL = candleAll_11;

PL.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

PL.SetDefaultColor(CreateColor(0, 255, 0));

PL.SetLineWeight(5);

rec PiercingLine_Trig_11 = If (PiercingLine().bullish , + BarNumber(), PiercingLine_Trig_11[1] );

AddLabel(PiercingLine_Trig_11 > 0 && showLabel_bull && ShowAll_bull,  "11=PiercingLine" , CreateColor(0, 255, 0));

Alert(PiercingLine()  && !TurnAlertOff_bull && ShowAll_bull, "PiercingLine", Alert.BAR, Sound.Chimes);

AddChartBubble(PiercingLine() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "11" else if BubVerb_bull then "PiercingLine" else "" ,  CreateColor(0, 255, 0) , no);



#RisingThreeMethods_12, #C
###### 12 ####################### RisingThreeMethods() #############################
def  candleAll_12 = If(ShowAll_bull == yes , RisingThreeMethods(), Double.NaN);

plot RTM = candleAll_12;

RTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

RTM.SetDefaultColor(CreateColor(153, 255, 153));

RTM.SetLineWeight(5);

rec RisingThreeMethods_Trig_12 = If (RisingThreeMethods().bullish, + BarNumber(), RisingThreeMethods_Trig_12[1] );

AddLabel(RisingThreeMethods_Trig_12 > 0 && showLabel_bull && ShowAll_bull, "12=RisingThreeMethods" , CreateColor(153, 255, 153));

Alert(RisingThreeMethods()  && !TurnAlertOff_bull && ShowAll_bull, "RisingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(RisingThreeMethods() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "12" else if BubVerb_bull then "RisingThreeMethods" else "" ,  CreateColor(153, 255, 153) , no);



#Sticksandwich_13,
###### 13 ####################### Sticksandwich() #############################
def candleAll_13 =  If(ShowAll_bull == yes , Sticksandwich(), Double.NaN);

plot SS = candleAll_13;

SS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SS.SetDefaultColor(CreateColor(0, 255, 0));

SS.SetLineWeight(5);

rec Sticksandwich_Trig_13 = If (Sticksandwich().bullish , + BarNumber(), Sticksandwich_Trig_13[1] );

AddLabel(Sticksandwich_Trig_13 > 0 && showLabel_bull && ShowAll_bull,  "13=Sticksandwich" , CreateColor(0, 255, 0));

Alert(Sticksandwich()  && !TurnAlertOff_bull && ShowAll_bull, "Sticksandwich", Alert.BAR, Sound.Chimes);

AddChartBubble(Sticksandwich() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "13" else if BubVerb_bull then "Sticksandwich" else "" ,  CreateColor(0, 255, 0) , no);



#ThreeInsideUp_14,
###### 14 ####################### ThreeInsideUp() #############################
def candleAll_14 =  If(ShowAll_bull == yes , ThreeInsideUp(), Double.NaN);

plot TIU = candleAll_14;

TIU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TIU.SetDefaultColor(CreateColor(0, 255, 0));

TIU.SetLineWeight(5);

rec ThreeInsideUp_Trig_14 = If (ThreeInsideUp().bullish , + BarNumber(), ThreeInsideUp_Trig_14[1] );

AddLabel(ThreeInsideUp_Trig_14 > 0 && showLabel_bull && ShowAll_bull,  "14=ThreeInsideUp" , CreateColor(0, 255, 0));

Alert(ThreeInsideUp()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeInsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideUp() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "14" else if BubVerb_bull then "ThreeInsideUp" else "" ,  CreateColor(0, 255, 0) , no);



#ThreeOutsideUp_15,
###### 15 ####################### ThreeOutsideUp() #############################
def candleAll_15 =  If(ShowAll_bull == yes , ThreeOutsideUp(), Double.NaN);

plot TOU = candleAll_15;

TOU.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TOU.SetDefaultColor(CreateColor(0, 255, 0));

TOU.SetLineWeight(5);

rec ThreeOutsideUp_Trig_15 = If (ThreeOutsideUp().bullish , + BarNumber(), ThreeOutsideUp_Trig_15[1] );

AddLabel(ThreeOutsideUp_Trig_15 > 0 && showLabel_bull && ShowAll_bull,  "15=ThreeOutsideUp" , CreateColor(0, 255, 0));

Alert(ThreeOutsideUp()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeOutsideUp", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideUp() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "15" else if BubVerb_bull then "ThreeOutsideUp" else "" ,  CreateColor(0, 255, 0) , no);




#ThreeStarsInTheSouth_16,
###### 16 ####################### ThreeStarsInTheSouth() #############################
def candleAll_16 =  If(ShowAll_bull == yes , ThreeStarsInTheSouth(), Double.NaN);

plot TSITS = candleAll_16;

TSITS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TSITS.SetDefaultColor(CreateColor(0, 255, 0));

TSITS.SetLineWeight(5);

rec ThreeStarsInTheSouth_Trig_16 = If (ThreeStarsInTheSouth().bullish , + BarNumber(), ThreeStarsInTheSouth_Trig_16[1] );

AddLabel(ThreeStarsInTheSouth_Trig_16 > 0 && showLabel_bull && ShowAll_bull,  "16=ThreeStarsInTheSouth" , CreateColor(0, 255, 0));

Alert(ThreeStarsInTheSouth()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeStarsInTheSouth() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "16" else if BubVerb_bull then "ThreeStarsInTheSouth" else "" ,  CreateColor(0, 255, 0) , no);


#ThreeWhiteSoldiers_17,
###### 17 ####################### ThreeWhiteSoldiers() #############################
def candleAll_17 =  If(ShowAll_bull == yes , ThreeWhiteSoldiers(), Double.NaN);

plot TWS = candleAll_17;

TWS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TWS.SetDefaultColor(CreateColor(0, 255, 0));

TWS.SetLineWeight(5);

rec ThreeWhiteSoldiers_Trig_17 = If (ThreeWhiteSoldiers().bullish , + BarNumber(), ThreeWhiteSoldiers_Trig_17[1] );

AddLabel(ThreeWhiteSoldiers_Trig_17 > 0 && showLabel_bull && ShowAll_bull,  "17=ThreeWhiteSoldiers" , CreateColor(0, 255, 0));

Alert(ThreeWhiteSoldiers()  && !TurnAlertOff_bull && ShowAll_bull, "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeWhiteSoldiers() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "17" else if BubVerb_bull then "ThreeWhiteSoldiers" else "" ,  CreateColor(0, 255, 0) , no);



#UniqueThreeRiverBottom_18,
###### 18 ####################### UniqueThreeRiverBottom() #############################
def candleAll_18 =  If(ShowAll_bull == yes , UniqueThreeRiverBottom(), Double.NaN);

plot UTRB = candleAll_18;

UTRB.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UTRB.SetDefaultColor(CreateColor(0, 255, 0));

UTRB.SetLineWeight(5);

rec UniqueThreeRiverBottom_Trig_18 = If (UniqueThreeRiverBottom().bullish, + BarNumber(), UniqueThreeRiverBottom_Trig_18[1] );

AddLabel(UniqueThreeRiverBottom_Trig_18 > 0 && showLabel_bull && ShowAll_bull,  "18=UniqueThreeRiverBottom" , CreateColor(0, 255, 0));

Alert(UniqueThreeRiverBottom()  && !TurnAlertOff_bull && ShowAll_bull, "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);

AddChartBubble(UniqueThreeRiverBottom() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "18" else if BubVerb_bull then "UniqueThreeRiverBottom" else "" ,  CreateColor(0, 255, 0) , no);



#UpsideGapThreeMethods_19, #C
###### 19 ####################### UpsideGapThreeMethods() #############################
def  candleAll_19 = If(ShowAll_bull == yes , UpsideGapThreeMethods(), Double.NaN);

plot UGTM = candleAll_19;

UGTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UGTM.SetDefaultColor(CreateColor(153, 255, 153));

UGTM.SetLineWeight(5);

rec UpsideGapThreeMethods_Trig_19 = If (UpsideGapThreeMethods().bullish, + BarNumber(), UpsideGapThreeMethods_Trig_19[1] );

AddLabel(UpsideGapThreeMethods_Trig_19 > 0 && showLabel_bull && ShowAll_bull, "19=UpsideGapThreeMethods" , CreateColor(153, 255, 153));

Alert(UpsideGapThreeMethods()  && !TurnAlertOff_bull && ShowAll_bull, "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapThreeMethods() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "19" else if BubVerb_bull then "UpsideGapThreeMethods" else "" ,  CreateColor(153, 255, 153) , no);




#UpsideTasukiGap_20  #C
###### 20 ####################### UpsideTasukiGap() #############################
def  candleAll_20 = If(ShowAll_bull == yes , UpsideTasukiGap().bullish, Double.NaN);

plot UTG = candleAll_20;

UTG.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

UTG.SetDefaultColor(CreateColor(153, 255, 153));

UTG.SetLineWeight(5);

rec UpsideTasukiGap_Trig_20 = If (UpsideTasukiGap().bullish, + BarNumber(), UpsideTasukiGap_Trig_20[1] );

AddLabel(UpsideTasukiGap_Trig_20 > 0 && showLabel_bull && ShowAll_bull, "20=UpsideTasukiGap" , CreateColor(153, 255, 153));

Alert(UpsideTasukiGap()  && !TurnAlertOff_bull && ShowAll_bull, "UpsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideTasukiGap() && (BubVerb_bull or BubNumb_bull) && (ShowAll_bull) , low -15 ,  if BubNumb_bull

then "20" else if BubVerb_bull then "UpsideTasukiGap" else "" ,  CreateColor(153, 255, 153) , no);

The bear pattern is here but it needed a lot of work. So I stripped it down and started from scratch using the basic format, and here is the final product.

This is verbose bear only:
fOvmmzo.png


This is ID # bear only:
GjJ6mz8.png


This is select 3 to show example 1-verbose:
aodyGJ2.png


This is select 3 to show example 2-ID #: as you can see the choose display format works for both show all or pick n choose.
oNnav0N.png


Code Bear only:
Code:
#Bearish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021
#Report any problems to 'StanL' on TOS' ThinkScript Lounge
#Revision date 3:36 PM 9/29/2013


addlabel(yes, "Bearish Only Reversals",  createcolor(255, 0, 0));
addlabel(yes, "Bearish only Continuations: 4, 5, 8, 11, 12, 14, 19", createcolor(255, 153, 153));


input TurnAlertOff = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubble = {default none, Verbose, ID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.


def BubNone = If (showBubble == showBubble.none, 1, 0);

def BubVerb = If (showBubble == showBubble.Verbose, 1, 0);

def BubNumb =  If (showBubble == showBubble.ID_Number, 1, 0);

#####################################################

############ Define the three selection Enums #################

#####################################################

input ShowFirst =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show


input ShowSecond =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show


input ShowThird =  {default none, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4,  DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #hint ShowSecond:Select the candle to show

###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle;

switch (ShowFirst) {
case AdvanceBlock_1:

    candle = If(ShowFirst.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle =  If(ShowFirst.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle = If(ShowFirst.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle = If(ShowFirst.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle = If(ShowFirst.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle = If(ShowFirst.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle = If(ShowFirst.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle = If(ShowFirst.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle = If(ShowFirst.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle = If(ShowFirst.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle = If(ShowFirst.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle = If(ShowFirst.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle = If(ShowFirst.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle = If(ShowFirst.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle = If(ShowFirst.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle = If(ShowFirst.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle = If(ShowFirst.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle = If(ShowFirst.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle = If(ShowFirst.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle = If(ShowFirst.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle = If(ShowFirst.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle;

Show1st.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show1st.SetDefaultColor(Color.GREEN);

Show1st.SetLineWeight(5);
#####################################################

############ Process Input 'ShowSecond' Enum #################

#####################################################
def candle2;

switch (ShowSecond) {
case AdvanceBlock_1:

    candle2 = If(ShowSecond.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle2 =  If(ShowSecond.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle2 = If(ShowSecond.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle2 = If(ShowSecond.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle2 = If(ShowSecond.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle2 = If(ShowSecond.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle2 = If(ShowSecond.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle2 = If(ShowSecond.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle2 = If(ShowSecond.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle2 = If(ShowSecond.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle2 = If(ShowSecond.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle2 = If(ShowSecond.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle2 = If(ShowSecond.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle2 = If(ShowSecond.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle2 = If(ShowSecond.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle2 = If(ShowSecond.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle2 = If(ShowSecond.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle2 = If(ShowSecond.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle2 = If(ShowSecond.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle2 = If(ShowSecond.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle2 = If(ShowSecond.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle2 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;

Show2nd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show2nd.SetDefaultColor(Color.GREEN);

Show2nd.SetLineWeight(5);
###########################################################

############ Process Input 'Showthird' Enum ###############

###########################################################
def candle3;

switch (ShowThird) {
case AdvanceBlock_1:

    candle3 = If(ShowThird.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:

    candle3 =  If(ShowThird.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:

    candle3 = If(ShowThird.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:

    candle3 = If(ShowThird.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:

    candle3 = If(ShowThird.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:

    candle3 = If(ShowThird.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:

    candle3 = If(ShowThird.EveningStar() , EveningStar(), Double.NaN);
case FallingThreeMethods_8:

    candle3 = If(ShowThird.FallingThreeMethods() , FallingThreeMethods(), Double.NaN);
case HangingMan_9:

    candle3 = If(ShowThird.HangingMan()   , HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:

    candle3 = If(ShowThird.IdenticalThreeCrows()   , IdenticalThreeCrows(), Double.NaN);
case InNeck_11:

    candle3 = If(ShowThird.InNeck()   , InNeck(), Double.NaN);
case LowPriceGappingPlay_12:

    candle3 = If(ShowThird.LowPriceGappingPlay()   , LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:

    candle3 = If(ShowThird.OneBlackCrow()  , OneBlackCrow(), Double.NaN);
case OnNeck_14:

    candle3 = If(ShowThird.OnNeck()   , OnNeck(), Double.NaN);
case ShootingStar_15:

    candle3 = If(ShowThird.ShootingStar() , ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:

    candle3 = If(ShowThird.ThreeBlackCrows()  , ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:

    candle3 = If(ShowThird.ThreeInsideDown()  , ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:

    candle3 = If(ShowThird.ThreeOutsideDown()  , ThreeOutsideDown(), Double.NaN);
case Thrusting_19:

    candle3 = If(ShowThird.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:

    candle3 = If(ShowThird.TwoCrows()  , TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:

    candle3 = If(ShowThird.UpsideGapTwoCrows()  , UpsideGapTwoCrows(), Double.NaN);
case none:

    candle3 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;

Show3rd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show3rd.SetDefaultColor(Color.GREEN);

Show3rd.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

#AdvanceBlock_1,
###### 1 ####################### AdvanceBlock() #############################
def ThreeShows_1 = If (ShowFirst == ShowFirst.AdvanceBlock_1 or ShowSecond == ShowSecond.AdvanceBlock_1 or ShowThird == ShowThird.AdvanceBlock_1, 1, 0);

rec AdvancedB_Trig = If(AdvanceBlock().bearish , BarNumber(), AdvancedB_Trig[1]);

#Def AB_label = if(Trig_bar > 0, 1, 0);

AddLabel(AdvancedB_Trig > 0  && showLabel  && ThreeShows_1, "1=AdvanceBlock" , CreateColor(255, 0, 0));

Alert(AdvanceBlock() && !TurnAlertOff, "AdvanceBlockAlert", Alert.BAR, Sound.Chimes);

AddChartBubble(AdvanceBlock() && (BubVerb or BubNumb) && ThreeShows_1 , 15 + high ,  if BubNumb

then "1" else if BubVerb then "AdvanceBlock" else "" , CreateColor(255, 0, 0)  , yes);



#DarkcloudCover_2,
###### 2 ####################### DarkCloudCover() #################################
def ThreeShows_2 = If (ShowFirst == ShowFirst.DarkCloudCover_2 or ShowSecond == ShowSecond.DarkCloudCover_2 or ShowThird == ShowThird.DarkCloudCover_2, 1, 0);

rec DarkCloudCover_Trig = If(DarkCloudCover().bearish , BarNumber(), DarkCloudCover_Trig[1]);

AddLabel(DarkCloudCover_Trig > 0  && showLabel  && ThreeShows_2, "2=DarkCloudCover", CreateColor(255, 0, 0));

Alert(DarkCloudCover() && !TurnAlertOff, "DarkCloudCover Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DarkCloudCover() && (BubVerb or BubNumb) && ThreeShows_2, 15 + high ,  if BubNumb

then "2" else if BubVerb then "DarkCloudCover" else "" , CreateColor(255, 0, 0) , yes);



#Deliberation_3,
###### 3 ####################### Deliberation() #################################
def ThreeShows_3 = If (ShowFirst == ShowFirst.Deliberation_3 or ShowSecond == ShowSecond.Deliberation_3 or ShowThird == ShowThird.Deliberation_3, 1, 0);

rec Deliberation_Trig = If(Deliberation().bearish , BarNumber(), Deliberation_Trig[1]);

AddLabel(Deliberation_Trig > 0  && showLabel  && ThreeShows_3, "3=Deliberation", CreateColor(255, 0, 0));

Alert(Deliberation() && !TurnAlertOff, "Deliberation Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(Deliberation() && (BubVerb or BubNumb) && ThreeShows_3, 15 + high ,  if BubNumb

then "3" else if BubVerb then "Deliberation" else "" , CreateColor(255, 0, 0) , yes);




# DownsideGapThreeMethods_4,   #C
###### 4 ####################### DownsideGapThreeMethods() #################################
def ThreeShows_4 = If (ShowFirst == ShowFirst.DownsideGapThreeMethods_4 or ShowSecond == ShowSecond.DownsideGapThreeMethods_4 or ShowThird == ShowThird.DownsideGapThreeMethods_4, 1, 0);

rec DownsideGapThreeMethods_Trig = If(DownsideGapThreeMethods().bearish , BarNumber(), DownsideGapThreeMethods_Trig[1]);

AddLabel(DownsideGapThreeMethods_Trig > 0  && showLabel  && ThreeShows_4, "4=DownsideGapThreeMethods", CreateColor(255, 153, 153));

Alert(DownsideGapThreeMethods() && !TurnAlertOff, "DownsideGapThreeMethods Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideGapThreeMethods() && (BubVerb or BubNumb) && ThreeShows_4, 15 + high ,  if BubNumb

then "4" else if BubVerb then "DownsideGapThreeMethods" else "" , CreateColor(255, 153, 153) , yes);




#DownsideTasukiGap_5, #C
###### 5 ####################### DownsideTasukiGap() #################################
def ThreeShows_5 = If (ShowFirst == ShowFirst.DownsideTasukiGap_5 or ShowSecond == ShowSecond.DownsideTasukiGap_5 or ShowThird == ShowThird.DownsideTasukiGap_5, 1, 0);

rec DownsideTasukiGap_Trig = If(DownsideTasukiGap().bearish , BarNumber(), DownsideTasukiGap_Trig[1]);

AddLabel(DownsideTasukiGap_Trig > 0  && showLabel  && ThreeShows_5, "5=DownsideTasukiGap", CreateColor(255, 153, 153));

Alert(DownsideTasukiGap() && !TurnAlertOff, "DownsideTasukiGap Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideTasukiGap() && (BubVerb or BubNumb) && ThreeShows_5, 15 + high ,  if BubNumb

then "5" else if BubVerb then "DownsideTasukiGap" else "" , CreateColor(255, 153, 153) , yes);


#EveningDojiStar_6, 
###### 6 ####################### EveningDojiStar() #################################
def ThreeShows_6 = If (ShowFirst == ShowFirst.EveningDojiStar_6 or ShowSecond == ShowSecond.EveningDojiStar_6 or ShowThird == ShowThird.EveningDojiStar_6, 1, 0);

rec EveningDojiStar_Trig = If(EveningDojiStar().bearish , BarNumber(), EveningDojiStar_Trig[1]);

AddLabel(EveningDojiStar_Trig > 0  && showLabel  && ThreeShows_6, "6=EveningDojiStar", CreateColor(255, 0, 0));

Alert(EveningDojiStar() && !TurnAlertOff, "EveningDojiStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningDojiStar() && (BubVerb or BubNumb) && ThreeShows_6, 15 + high ,  if BubNumb

then "6" else if BubVerb then "EveningDojiStar" else "" , CreateColor(255, 0, 0) , yes);



#EveningStar_7, 
###### 7 ####################### EveningStar() #################################
def ThreeShows_7 = If (ShowFirst == ShowFirst.EveningStar_7 or ShowSecond == ShowSecond.EveningStar_7 or ShowThird == ShowThird.EveningStar_7, 1, 0);

rec EveningStar_Trig = If(EveningStar().bearish , BarNumber(), EveningStar_Trig[1]);

AddLabel(EveningStar_Trig > 0  && showLabel  && ThreeShows_7, "7=EveningStar", CreateColor(255, 0, 0));

Alert(EveningStar() && !TurnAlertOff, "EveningStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningStar() && (BubVerb or BubNumb) && ThreeShows_7, 15 + high ,  if BubNumb

then "7" else if BubVerb then "EveningStar" else "" , CreateColor(255, 0, 0) , yes);



#FallingThreeMethods_8, #C
###### 8 ####################### FallingThreeMethods() #################################
def ThreeShows_8 = If (ShowFirst == ShowFirst.FallingThreeMethods_8 or ShowSecond == ShowSecond.FallingThreeMethods_8 or ShowThird == ShowThird.FallingThreeMethods_8, 1, 0);

rec FallingThreeMethods_Trig = If(FallingThreeMethods().bearish , BarNumber(), FallingThreeMethods_Trig[1]);

AddLabel(FallingThreeMethods_Trig > 0  && showLabel  && ThreeShows_8, "8=FallingThreeMethods", CreateColor(255, 153, 153));

Alert(FallingThreeMethods() && !TurnAlertOff, "FallingThreeMethods Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(FallingThreeMethods() && (BubVerb or BubNumb) && ThreeShows_8, 15 + high ,  if BubNumb

then "8" else if BubVerb then "FallingThreeMethods" else "" , CreateColor(255, 153, 153) , yes);




#HangingMan_9, 
###### 9 ####################### HangingMan() #################################
def ThreeShows_9 = If (ShowFirst == ShowFirst.HangingMan_9 or ShowSecond == ShowSecond.HangingMan_9 or ShowThird == ShowThird.HangingMan_9, 1, 0);

rec HangingMan_Trig = If(HangingMan().bearish , BarNumber(), HangingMan_Trig[1]);

AddLabel(HangingMan_Trig > 0  && showLabel  && ThreeShows_9, "9=HangingMan", CreateColor(255, 0, 0));

Alert(HangingMan() && !TurnAlertOff, "HangingMan Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(HangingMan() && (BubVerb or BubNumb) && ThreeShows_9,  15 + high,  if BubNumb

then "9" else if BubVerb then "HangingMan" else "" , CreateColor(255, 0, 0), yes);



#IdenticalThreeCrows_10, 
###### 10 ####################### IdenticalThreeCrows() #################################
def ThreeShows_10 = If (ShowFirst == ShowFirst.IdenticalThreeCrows_10 or ShowSecond == ShowSecond.IdenticalThreeCrows_10 or ShowThird == ShowThird.IdenticalThreeCrows_10, 1, 0);

rec IdenticalThreeCrows_Trig = If(IdenticalThreeCrows().bearish , BarNumber(), IdenticalThreeCrows_Trig[1]);

AddLabel(IdenticalThreeCrows_Trig > 0  && showLabel  && ThreeShows_10, "10=IdenticalThreeCrows", CreateColor(255, 0, 0));

Alert(IdenticalThreeCrows() && !TurnAlertOff, "IdenticalThreeCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(IdenticalThreeCrows() && (BubVerb or BubNumb) && ThreeShows_10, 15 + high ,  if BubNumb

then "10" else if BubVerb then "IdenticalThreeCrows" else "" , CreateColor(255, 0, 0) , yes);



#InNeck_11,    #C
###### 11 ####################### InNeck() #################################
def ThreeShows_11 = If (ShowFirst == ShowFirst.InNeck_11 or ShowSecond == ShowSecond.InNeck_11 or ShowThird == ShowThird.InNeck_11, 1, 0);

rec InNeck_Trig = If(InNeck().bearish , BarNumber(), InNeck_Trig[1]);

AddLabel(InNeck_Trig > 0  && showLabel  && ThreeShows_11, "11=InNeck", CreateColor(255, 153, 153));

Alert(InNeck() && !TurnAlertOff, "InNeck Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(InNeck() && (BubVerb or BubNumb) && ThreeShows_11, 15 + high ,  if BubNumb

then "11" else if BubVerb then "InNeck" else "" , CreateColor(255, 153, 153) , yes);




#LowPriceGappingPlay_12, #C
###### 12 ####################### LowPriceGappingPlay() #################################
def ThreeShows_12 = If (ShowFirst == ShowFirst.LowPriceGappingPlay_12 or ShowSecond == ShowSecond.LowPriceGappingPlay_12 or ShowThird == ShowThird.LowPriceGappingPlay_12, 1, 0);

rec LowPriceGappingPlay_Trig = If(LowPriceGappingPlay().bearish , BarNumber(), LowPriceGappingPlay_Trig[1]);

AddLabel(LowPriceGappingPlay_Trig > 0  && showLabel  && ThreeShows_12, "12=LowPriceGappingPlay", CreateColor(255, 153, 153));

Alert(LowPriceGappingPlay() && !TurnAlertOff, "LowPriceGappingPlay Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(LowPriceGappingPlay() && (BubVerb or BubNumb) && ThreeShows_12, 15 + high ,  if BubNumb

then "12" else if BubVerb then "LowPriceGappingPlay" else "" , CreateColor(255, 153, 153) , yes);



#OneBlackCrow_13,
###### 13 ####################### OneBlackCrow() #################################
def ThreeShows_13 = If (ShowFirst == ShowFirst.OneBlackCrow_13 or ShowSecond == ShowSecond.OneBlackCrow_13 or ShowThird == ShowThird.OneBlackCrow_13, 1, 0);

rec OneBlackCrow_Trig = If(OneBlackCrow().bearish , BarNumber(), OneBlackCrow_Trig[1]);

AddLabel(OneBlackCrow_Trig > 0  && showLabel  && ThreeShows_13, "13=OneBlackCrow", CreateColor(255, 0, 0));

Alert(OneBlackCrow() && !TurnAlertOff, "OneBlackCrow Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(OneBlackCrow() && (BubVerb or BubNumb) && ThreeShows_13, 15 + high ,  if BubNumb

then "13" else if BubVerb then "OneBlackCrow" else "" , CreateColor(255, 0, 0) , yes);



#OnNeck_14, #C
###### 14 ####################### OnNeck() #################################
def ThreeShows_14 = If (ShowFirst == ShowFirst.OnNeck_14 or ShowSecond == ShowSecond.OnNeck_14 or ShowThird == ShowThird.OnNeck_14, 1, 0);

rec OnNeck_Trig = If(OnNeck().bearish , BarNumber(), OnNeck_Trig[1]);

AddLabel(OnNeck_Trig > 0  && showLabel  && ThreeShows_14, "14=OnNeck", CreateColor(255, 153, 153));

Alert(OnNeck() && !TurnAlertOff, "OnNeck Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(OnNeck() && (BubVerb or BubNumb) && ThreeShows_14, 15 + high ,  if BubNumb

then "14" else if BubVerb then "OnNeck" else "" , CreateColor(255, 153, 153) , yes);



#ShootingStar_15,
###### 15 ####################### ShootingStar() #################################
def ThreeShows_15 = If (ShowFirst == ShowFirst.ShootingStar_15 or ShowSecond == ShowSecond.ShootingStar_15 or ShowThird == ShowThird.ShootingStar_15, 1, 0);

rec ShootingStar_Trig = If(ShootingStar().bearish , BarNumber(), ShootingStar_Trig[1]);

AddLabel(ShootingStar_Trig > 0  && showLabel  && ThreeShows_15, "15=ShootingStar", CreateColor(255, 0, 0));

Alert(ShootingStar() && !TurnAlertOff, "ShootingStar Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ShootingStar() && (BubVerb or BubNumb) && ThreeShows_15, 15 + high ,  if BubNumb

then "15" else if BubVerb then "ShootingStar" else "" , CreateColor(255, 0, 0) , yes);



#ThreeBlackCrows_16,
###### 16 ####################### ThreeBlackCrows() #################################
def ThreeShows_16 = If (ShowFirst == ShowFirst.ThreeBlackCrows_16 or ShowSecond == ShowSecond.ThreeBlackCrows_16 or ShowThird == ShowThird.ThreeBlackCrows_16, 1, 0);

rec ThreeBlackCrows_Trig = If(ThreeBlackCrows().bearish , BarNumber(), ThreeBlackCrows_Trig[1]);

AddLabel(ThreeBlackCrows_Trig > 0  && showLabel  && ThreeShows_16, "16=ThreeBlackCrows", CreateColor(255, 0, 0));

Alert(ThreeBlackCrows() && !TurnAlertOff, "ThreeBlackCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeBlackCrows() && (BubVerb or BubNumb) && ThreeShows_16, 15 + high ,  if BubNumb

then "16" else if BubVerb then "ThreeBlackCrows" else "" , CreateColor(255, 0, 0) , yes);




#ThreeInsideDown_17,
###### 17 ####################### ThreeInsideDown() #################################
def ThreeShows_17 = If (ShowFirst == ShowFirst.ThreeInsideDown_17 or ShowSecond == ShowSecond.ThreeInsideDown_17 or ShowThird == ShowThird.ThreeInsideDown_17, 1, 0);

rec ThreeInsideDown_Trig = If(DarkCloudCover().bearish , BarNumber(), ThreeInsideDown_Trig[1]);

AddLabel(ThreeInsideDown_Trig > 0  && showLabel  && ThreeShows_17, "17=ThreeInsideDown", Color.GREEN);

Alert(ThreeInsideDown() && !TurnAlertOff, "ThreeInsideDown Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideDown() && (BubVerb or BubNumb) && ThreeShows_17, 15 + high ,  if BubNumb

then "17" else if BubVerb then "ThreeInsideDown" else "" , CreateColor(255, 0, 0) , yes);



#ThreeOutsideDown_18,
###### 18 ####################### ThreeOutsideDown() #################################
def ThreeShows_18 = If (ShowFirst == ShowFirst.ThreeOutsideDown_18 or ShowSecond == ShowSecond.ThreeOutsideDown_18 or ShowThird == ShowThird.ThreeOutsideDown_18, 1, 0);

rec ThreeOutsideDown_Trig = If(DarkCloudCover().bearish , BarNumber(), ThreeOutsideDown_Trig[1]);

AddLabel(ThreeOutsideDown_Trig > 0  && showLabel  && ThreeShows_18, "18=ThreeOutsideDown", CreateColor(255, 0, 0));

Alert(ThreeOutsideDown() && !TurnAlertOff, "ThreeOutsideDown Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideDown() && (BubVerb or BubNumb) && ThreeShows_18, 15 + high ,  if BubNumb

then "18" else if BubVerb then "ThreeOutsideDown" else "" , CreateColor(255, 0, 0) , yes);






#Thrusting_19, #C
###### 19 ####################### Thrusting() #################################
def ThreeShows_19 = If (ShowFirst == ShowFirst.Thrusting_19 or ShowSecond == ShowSecond.Thrusting_19 or ShowThird == ShowThird.Thrusting_19, 1, 0);

rec Thrusting_Trig = If(DarkCloudCover().bearish , BarNumber(), Thrusting_Trig[1]);

AddLabel(Thrusting_Trig > 0  && showLabel  && ThreeShows_19, "19=Thrusting", CreateColor(255, 153, 153));

Alert(Thrusting() && !TurnAlertOff, "Thrusting Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(Thrusting() && (BubVerb or BubNumb) && ThreeShows_19, 15 + high ,  if BubNumb

then "19" else if BubVerb then "Thrusting" else "" , CreateColor(255, 153, 153) , yes);



#TwoCrows_20,
###### 20 ####################### TwoCrows() #################################
def ThreeShows_20 = If (ShowFirst == ShowFirst.TwoCrows_20 or ShowSecond == ShowSecond.TwoCrows_20 or ShowThird == ShowThird.TwoCrows_20, 1, 0);

rec TwoCrows_Trig = If(TwoCrows().bearish , BarNumber(), TwoCrows_Trig[1]);

AddLabel(TwoCrows_Trig > 0  && showLabel  && ThreeShows_20, "20=TwoCrows", CreateColor(255, 0, 0));

Alert(TwoCrows() && !TurnAlertOff, "TwoCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(TwoCrows() && (BubVerb or BubNumb) && ThreeShows_20, 15 + high ,  if BubNumb

then "20" else if BubVerb then "TwoCrows" else "" , CreateColor(255, 0, 0) , yes);



#UpsideGapTwoCrows_21};
###### 21 ####################### UpsideGapTwoCrows() #################################
def ThreeShows_21 = If (ShowFirst == ShowFirst.UpsideGapTwoCrows_21 or ShowSecond == ShowSecond.UpsideGapTwoCrows_21 or ShowThird == ShowThird.UpsideGapTwoCrows_21, 1, 0);

rec UpsideGapTwoCrows_Trig = If(DarkCloudCover().bearish , BarNumber(), UpsideGapTwoCrows_Trig[1]);

AddLabel(UpsideGapTwoCrows_Trig > 0  && showLabel  && ThreeShows_21, "21=UpsideGapTwoCrows", CreateColor(255, 0, 0));

Alert(UpsideGapTwoCrows() && !TurnAlertOff, "UpsideGapTwoCrows Alert", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapTwoCrows() && (BubVerb or BubNumb) && ThreeShows_21, 15 + high ,  if BubNumb

then "21" else if BubVerb then "UpsideGapTwoCrows" else "" , CreateColor(255, 0, 0) , yes);




#############################################################################

############## Processing 'Show All' = yes #######################

#############################################################################
###all adjustments to bubble locations are imput using this second section and the placement is in the second section



# AdvanceBlock_1, #R
###### 1 ####################### AdvanceBlock() & showAll #################################
def  candleAll_41 = If(ShowAll == yes , AdvanceBlock(), Double.NaN);

plot AdvBlk = candleAll_41;

AdvBlk.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AdvBlk.SetDefaultColor(CreateColor(255, 0, 0));

AdvBlk.SetLineWeight(5);

rec AdvanceBlock_Trig_41 = If (AdvanceBlock().bearish, + BarNumber(), AdvanceBlock_Trig_41[1] );

AddLabel(AdvanceBlock_Trig_41 > 0 && showLabel && ShowAll, "1=AdvanceBlock" , CreateColor(255, 0, 0));

Alert(AdvanceBlock()  && !TurnAlertOff && ShowAll, "AdvanceBlock", Alert.BAR, Sound.Chimes);

AddChartBubble(AdvanceBlock() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "1" else if BubVerb then "AdvanceBlock" else "" ,  CreateColor(255, 0, 0) , yes);



#DarkCloudCover_2, #R
###### 2 ####################### DarkCloudCover() & showAll #################################
def candleAll_42 =  If(ShowAll == yes , DarkCloudCover(), Double.NaN);

plot DCC = candleAll_42;

DCC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DCC.SetDefaultColor(CreateColor(255, 0, 0));

DCC.SetLineWeight(5);

rec DarkCloudCover_Trig_42 = If (DarkCloudCover().bearish , + BarNumber(), DarkCloudCover_Trig_42[1] );

AddLabel(DarkCloudCover_Trig_42 > 0 && showLabel && ShowAll,  "2=DarkCloudCover" , CreateColor(255, 0, 0));

Alert(DarkCloudCover()  && !TurnAlertOff && ShowAll, "DarkCloudCover", Alert.BAR, Sound.Chimes);

AddChartBubble(DarkCloudCover() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "2" else if BubVerb then "DarkCloudCover" else "" ,  CreateColor(255, 0, 0) , yes);



#Deliberation_3, #R
###### 3 ####################### Deliberation() & showAll #################################
def  candleAll_43 = If(ShowAll == yes , Deliberation(), Double.NaN);

plot Delib = candleAll_43;

Delib.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Delib.SetDefaultColor(CreateColor(255, 0, 0));

Delib.SetLineWeight(5);

rec Deliberation_Trig_43 = If (Deliberation().bearish, + BarNumber(), Deliberation_Trig_43[1] );

AddLabel(Deliberation_Trig_43 > 0 && showLabel && ShowAll, "3=Deliberation" , CreateColor(255, 0, 0));

Alert(Deliberation()  && !TurnAlertOff && ShowAll, "Deliberation", Alert.BAR, Sound.Chimes);

AddChartBubble(Deliberation() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "3" else if BubVerb then "Deliberation" else "" ,  CreateColor(255, 0, 0) , yes);



#DownsideGapThreeMethods_4, #C
###### 4 ####################### DownsideGapThreeMethods() & showAll #################################
def candleAll_44 =  If(ShowAll == yes , DownsideGapThreeMethods(), Double.NaN);

plot DGTM = candleAll_44;

DGTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DGTM.SetDefaultColor(CreateColor(255, 153, 153));

DGTM.SetLineWeight(5);

rec DownsideGapThreeMethods_Trig_44 = If (DownsideGapThreeMethods().bearish , + BarNumber(), DownsideGapThreeMethods_Trig_44[1] );

AddLabel(DownsideGapThreeMethods_Trig_44 > 0 && showLabel && ShowAll,  "4=DownsideGapThreeMethods" , CreateColor(255, 153, 153));

Alert(DownsideGapThreeMethods()  && !TurnAlertOff && ShowAll, "DownsideGapThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideGapThreeMethods() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "4" else if BubVerb then "DownsideGapThreeMethods" else "" ,  CreateColor(255, 153, 153) , yes);



# DownsideTasukiGap_5, #C
###### 5 ####################### DownsideTasukiGap() & showAll #################################
def candleAll_45 =  If(ShowAll == yes , DownsideTasukiGap(), Double.NaN);

plot DTG = candleAll_45;

DTG.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

DTG.SetDefaultColor(CreateColor(255, 153, 153));

DTG.SetLineWeight(5);

rec DownsideTasukiGap_Trig_45 = If (DownsideTasukiGap().bearish , + BarNumber(), DownsideTasukiGap_Trig_45[1] );

AddLabel(DownsideTasukiGap_Trig_45 > 0 && showLabel && ShowAll,  "5=DownsideTasukiGap" , CreateColor(255, 153, 153));

Alert(DownsideTasukiGap()  && !TurnAlertOff && ShowAll, "DownsideTasukiGap", Alert.BAR, Sound.Chimes);

AddChartBubble(DownsideTasukiGap() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "5" else if BubVerb then "DownsideTasukiGap" else "" ,  CreateColor(255, 153, 153) , yes);


#EveningDojiStar_6, #R
###### 6 ####################### EveningDojiStar() & showAll #################################
def candleAll_46 =  If(ShowAll == yes , EveningDojiStar(), Double.NaN);

plot EDS = candleAll_46;

EDS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

EDS.SetDefaultColor(CreateColor(255, 0, 0));

EDS.SetLineWeight(5);

rec EveningDojiStar_Trig_46 = If (EveningDojiStar().bearish , + BarNumber(), EveningDojiStar_Trig_46[1] );

AddLabel(EveningDojiStar_Trig_46 > 0 && showLabel && ShowAll,  "6=EveningDojiStar" , CreateColor(255, 0, 0));

Alert(EveningDojiStar()  && !TurnAlertOff && ShowAll, "EveningDojiStar", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningDojiStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "6" else if BubVerb then "EveningDojiStar" else "" ,  CreateColor(255, 0, 0) , yes);



#EveningStar_7, #R
###### 7 ####################### EveningStar() & showAll #################################
def candleAll_47 =  If(ShowAll == yes , EveningStar(), Double.NaN);

plot ES = candleAll_47;

ES.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ES.SetDefaultColor(CreateColor(255, 0, 0));

ES.SetLineWeight(5);

rec EveningStar_Trig_47 = If (EveningStar().bearish , + BarNumber(), EveningStar_Trig_47[1] );

AddLabel(EveningStar_Trig_47 > 0 && showLabel && ShowAll,  "7=EveningStar" , CreateColor(255, 0, 0));

Alert(EveningStar()  && !TurnAlertOff && ShowAll, "EveningStar", Alert.BAR, Sound.Chimes);

AddChartBubble(EveningStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "7" else if BubVerb then "EveningStar" else "" ,  CreateColor(255, 0, 0) , yes);



#FallingThreeMethods_8,   #C
###### 8 ####################### FallingThreeMethods() & showAll #################################
def candleAll_48 =  If(ShowAll == yes , FallingThreeMethods(), Double.NaN);

plot FTM = candleAll_48;

FTM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

FTM.SetDefaultColor(CreateColor(255, 153, 153));

FTM.SetLineWeight(5);

rec FallingThreeMethods_Trig_48 = If (FallingThreeMethods().bearish , + BarNumber(), FallingThreeMethods_Trig_48[1] );

AddLabel(FallingThreeMethods_Trig_48 > 0 && showLabel && ShowAll,  "8=FallingThreeMethods" , CreateColor(255, 153, 153));

Alert(FallingThreeMethods()  && !TurnAlertOff && ShowAll, "FallingThreeMethods", Alert.BAR, Sound.Chimes);

AddChartBubble(FallingThreeMethods() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "8" else if BubVerb then "FallingThreeMethods" else "" ,  CreateColor(255, 153, 153) , yes);



#HangingMan_9, #R
###### 9 ####################### HangingMan() & showAll #################################
def candleAll_49 =  If(ShowAll == yes , HangingMan(), Double.NaN);

plot HM = candleAll_49;

HM.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

HM.SetDefaultColor(CreateColor(255, 0, 0));

HM.SetLineWeight(5);

rec HangingMan_Trig_49 = If (HangingMan().bearish , + BarNumber(), HangingMan_Trig_49[1] );

AddLabel(HangingMan_Trig_49 > 0 && showLabel && ShowAll,  "9=HangingMan" , CreateColor(255, 0, 0));

Alert(HangingMan()  && !TurnAlertOff && ShowAll, "HangingMan", Alert.BAR, Sound.Chimes);

AddChartBubble(HangingMan() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "9" else if BubVerb then "HangingMan" else "" ,  CreateColor(255, 0, 0) , yes);



#IdenticalThreeCrows_10, #R
###### 10 ####################### IdenticalThreeCrows() & showAll #################################
def candleAll_50 =  If(ShowAll == yes , IdenticalThreeCrows(), Double.NaN);

plot ITC = candleAll_50;

ITC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ITC.SetDefaultColor(CreateColor(255, 0, 0));

ITC.SetLineWeight(5);

rec IdenticalThreeCrows_Trig_50 = If (IdenticalThreeCrows().bearish , + BarNumber(), IdenticalThreeCrows_Trig_50[1] );

AddLabel(IdenticalThreeCrows_Trig_50 > 0 && showLabel && ShowAll,  "10=IdenticalThreeCrows" , CreateColor(255, 0, 0));

Alert(IdenticalThreeCrows()  && !TurnAlertOff && ShowAll, "IdenticalThreeCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(IdenticalThreeCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "10" else if BubVerb then "IdenticalThreeCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#InNeck_11, # C
###### 11 ####################### InNeck() & showAll #################################
def candleAll_51 =  If(ShowAll == yes , InNeck(), Double.NaN);

plot IN = candleAll_51;

IN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

IN.SetDefaultColor(CreateColor(255, 153, 153));

IN.SetLineWeight(5);

rec InNeck_Trig_52 = If (InNeck().bearish , + BarNumber(), InNeck_Trig_52[1] );

AddLabel(InNeck_Trig_52 > 0 && showLabel && ShowAll,  "11=InNeck" , CreateColor(255, 153, 153));

Alert(InNeck()  && !TurnAlertOff && ShowAll, "InNeck", Alert.BAR, Sound.Chimes);

AddChartBubble(InNeck() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "11" else if BubVerb then "InNeck" else "" ,  CreateColor(255, 153, 153) , yes);



#LowPriceGappingPlay_12, # C
###### 12 ####################### LowPriceGappingPlay() & showAll #################################
def candleAll_52 =  If(ShowAll == yes , LowPriceGappingPlay(), Double.NaN);

plot LPGP = candleAll_52;

LPGP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

LPGP.SetDefaultColor(CreateColor(255, 153, 153));

LPGP.SetLineWeight(5);

rec LowPriceGappingPlay_Trig_52 = If (LowPriceGappingPlay().bearish , + BarNumber(), LowPriceGappingPlay_Trig_52[1] );

AddLabel(LowPriceGappingPlay_Trig_52 > 0 && showLabel && ShowAll,  "12=LowPriceGappingPlay" , CreateColor(255, 153, 153));

Alert(LowPriceGappingPlay()  && !TurnAlertOff && ShowAll, "LowPriceGappingPlay", Alert.BAR, Sound.Chimes);

AddChartBubble(LowPriceGappingPlay() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "12" else if BubVerb then "LowPriceGappingPlay" else "" ,  CreateColor(255, 153, 153) , yes);



#OneBlackCrow_13, # R
###### 13 ####################### OneBlackCrow() & showAll #################################
def candleAll_53 =  If(ShowAll == yes , OneBlackCrow(), Double.NaN);

plot OBC = candleAll_53;

OBC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

OBC.SetDefaultColor(CreateColor(255, 0, 0));

OBC.SetLineWeight(5);

rec OneBlackCrow_Trig_53 = If (OneBlackCrow().bearish , + BarNumber(), OneBlackCrow_Trig_53[1] );

AddLabel(OneBlackCrow_Trig_53 > 0 && showLabel && ShowAll,  "13=OneBlackCrow" , CreateColor(255, 0, 0));

Alert(OneBlackCrow()  && !TurnAlertOff && ShowAll, "OneBlackCrow", Alert.BAR, Sound.Chimes);

AddChartBubble(OneBlackCrow() && (BubVerb or BubNumb) && (ShowAll) , 15 +  high ,  if BubNumb

then "13" else if BubVerb then "OneBlackCrow" else "" ,  CreateColor(255, 0, 0) , yes);



#OnNeck_14, # C
###### 14 ####################### OnNeck() & showAll #################################
def candleAll_54 =  If(ShowAll == yes , OnNeck(), Double.NaN);

plot ON = candleAll_54;

ON.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ON.SetDefaultColor(CreateColor(255, 153, 153));

ON.SetLineWeight(5);

rec OnNeck_Trig_54 = If (OnNeck().bearish , + BarNumber(), OnNeck_Trig_54[1] );

AddLabel(OnNeck_Trig_54 > 0 && showLabel && ShowAll,  "14=OnNeck" , CreateColor(255, 153, 153));

Alert(OnNeck()  && !TurnAlertOff && ShowAll, "OnNeck", Alert.BAR, Sound.Chimes);

AddChartBubble(OnNeck() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "14" else if BubVerb then "OnNeck" else "" ,  CreateColor(255, 153, 153) , yes);



#ShootingStar_15,
###### 15 ####################### ShootingStar() & showAll #################################
def candleAll_55 =  If(ShowAll == yes , ShootingStar(), Double.NaN);

plot SS = candleAll_55;

SS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SS.SetDefaultColor(CreateColor(255, 0, 0));

SS.SetLineWeight(5);

rec ShootingStar_Trig_55 = If (ShootingStar().bearish , + BarNumber(), ShootingStar_Trig_55[1] );

AddLabel(ShootingStar_Trig_55 > 0 && showLabel && ShowAll,  "15=ShootingStar" , CreateColor(255, 0, 0));

Alert(ShootingStar()  && !TurnAlertOff && ShowAll, "ShootingStar", Alert.BAR, Sound.Chimes);

AddChartBubble(ShootingStar() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "15" else if BubVerb then "ShootingStar" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeBlackCrows_16,
###### 16 ####################### ThreeBlackCrows() & showAll #################################
def candleAll_56 =  If(ShowAll == yes , ThreeBlackCrows(), Double.NaN);

plot TBC = candleAll_56;

TBC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TBC.SetDefaultColor(CreateColor(255, 0, 0));

TBC.SetLineWeight(5);

rec ThreeBlackCrows_Trig_56 = If (ThreeBlackCrows().bearish , + BarNumber(), ThreeBlackCrows_Trig_56[1] );

AddLabel(ThreeBlackCrows_Trig_56 > 0 && showLabel && ShowAll,  "16=ThreeBlackCrows" , CreateColor(255, 0, 0));

Alert(ThreeBlackCrows()  && !TurnAlertOff && ShowAll, "ThreeBlackCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeBlackCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high  ,  if BubNumb

then "16" else if BubVerb then "ThreeBlackCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeInsideDown_17,
###### 17 ####################### ThreeInsideDown() & showAll #################################
def candleAll_57 =  If(ShowAll == yes , ThreeInsideDown(), Double.NaN);

plot TID = candleAll_57;

TID.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TID.SetDefaultColor(CreateColor(255, 0, 0));

TID.SetLineWeight(5);

rec ThreeInsideDown_Trig_57 = If (ThreeInsideDown().bearish , + BarNumber(), ThreeInsideDown_Trig_57[1] );

AddLabel(ThreeInsideDown_Trig_57 > 0 && showLabel && ShowAll,  "17=ThreeInsideDown" , CreateColor(255, 0, 0));

Alert(ThreeInsideDown()  && !TurnAlertOff && ShowAll, "ThreeInsideDown", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeInsideDown() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "17" else if BubVerb then "ThreeInsideDown" else "" ,  CreateColor(255, 0, 0) , yes);



#ThreeOutsideDown_18,
###### 18 ####################### ThreeOutsideDown() & showAll #################################
def candleAll_58 =  If(ShowAll == yes , ThreeOutsideDown(), Double.NaN);

plot TOD = candleAll_58;

TOD.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TOD.SetDefaultColor(CreateColor(255, 0, 0));

TOD.SetLineWeight(5);

rec ThreeOutsideDown_Trig_58 = If (ThreeOutsideDown().bearish , + BarNumber(), ThreeOutsideDown_Trig_58[1] );

AddLabel(ThreeOutsideDown_Trig_58 > 0 && showLabel && ShowAll,  "18=ThreeOutsideDown" , CreateColor(255, 0, 0));

Alert(ThreeOutsideDown()  && !TurnAlertOff && ShowAll, "ThreeOutsideDown", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeOutsideDown() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "18" else if BubVerb then "ThreeOutsideDown" else "" ,  CreateColor(255, 0, 0) , yes);



#Thrusting_19, # C
###### 19 ####################### Thrusting() & showAll #################################
def candleAll_59 =  If(ShowAll == yes , Thrusting(), Double.NaN);

plot Thrust = candleAll_59;

Thrust.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Thrust.SetDefaultColor(CreateColor(255, 153, 153));

Thrust.SetLineWeight(5);

rec Thrusting_Trig_59 = If (Thrusting().bearish , + BarNumber(), Thrusting_Trig_59[1] );

AddLabel(Thrusting_Trig_59 > 0 && showLabel && ShowAll,  "19=Thrusting" , CreateColor(255, 153, 153));

Alert(Thrusting()  && !TurnAlertOff && ShowAll, "Thrusting", Alert.BAR, Sound.Chimes);

AddChartBubble(Thrusting() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "19" else if BubVerb then "Thrusting" else "" ,  CreateColor(255, 153, 153) , yes);



#TwoCrows_20,
###### 20 ####################### TwoCrows() & showAll #################################
def candleAll_60 =  If(ShowAll == yes , TwoCrows(), Double.NaN);

plot TC = candleAll_60;

TC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TC.SetDefaultColor(CreateColor(255, 0, 0));

TC.SetLineWeight(5);

rec TwoCrows_Trig_60 = If (TwoCrows().bearish , + BarNumber(), TwoCrows_Trig_60[1] );

AddLabel(TwoCrows_Trig_60 > 0 && showLabel && ShowAll,  "20=TwoCrows" , CreateColor(255, 0, 0));

Alert(TwoCrows()  && !TurnAlertOff && ShowAll, "TwoCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(TwoCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "20" else if BubVerb then "TwoCrows" else "" ,  CreateColor(255, 0, 0) , yes);



#UpsideGapTwoCrows_21,
###### 21 ####################### UpsideGapTwoCrows() & showAll #################################
def candleAll_61 =  If(ShowAll == yes , UpsideGapTwoCrows(), Double.NaN);

plot UGTC = candleAll_61;

UGTC.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

UGTC.SetDefaultColor(CreateColor(255, 0, 0));

UGTC.SetLineWeight(5);

rec UpsideGapTwoCrows_Trig_61 = If (UpsideGapTwoCrows().bearish , + BarNumber(), UpsideGapTwoCrows_Trig_61[1] );

AddLabel(UpsideGapTwoCrows_Trig_61 > 0 && showLabel && ShowAll,  "21=UpsideGapTwoCrows" , CreateColor(255, 0, 0));

Alert(UpsideGapTwoCrows()  && !TurnAlertOff && ShowAll, "UpsideGapTwoCrows", Alert.BAR, Sound.Chimes);

AddChartBubble(UpsideGapTwoCrows() && (BubVerb or BubNumb) && (ShowAll) , 15 + high ,  if BubNumb

then "21" else if BubVerb then "UpsideGapTwoCrows" else "" ,  CreateColor(255, 0, 0) , yes);

The next 2 sections took me the longest. I had to make the system know each pattern was either bullish only or bearish only since each study will plot both a bullish arrow and bearish arrow unless you state otherwise, which is what I have done.
One thing to note, which I noted in the top of both of these studies, I took out 3 of the studies with # in front of but the format is there if you want to mess around with it.
I've taken out #Diji, #Williams Fractal & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.
Here is why I have #'ed out the Williams Fractal and zig zag:
Adzc2Bi.png


# Bullish&&Bearish Bullish only

This is the verbose B&B Bullish only:
NlQZh8p.png


This is the ID# B&B Bullish only:
bBcTwJV.png


B&B Bull Code:
Code:
#Bullish_AND_Bearish_Bullish_Patterns_only

declare upper;

#Hint: BullishCandlesticks: Plots and identifies all 14 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#formated by mourningwood4521 on usethinkscript using the format outlined by 'StanL' on TOS' ThinkScript Lounge for bull only.

AddLabel(yes, "Bull & Bear Bullish only Reversals", color.blue);
AddLabel(yes, "Bull & Bear Bullish only Continuations: 10, 12, 13, 14", createColor(0, 202, 236));

#shows all bullish only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.


input TurnAlertOff_BBl = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_BBl = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubbleBull = {default none_Bull, Verbose_Bull, BullishID_Number}; #Hint showBubble:Choice of what format the candle bubble ID should have

def BubNoneBull = If (showBubbleBull == showBubbleBull.none_Bull, 1, 0);

def BubVerbBull = If (showBubbleBull == showBubbleBull.Verbose_Bull, 1, 0);

def BubNumbBull = If (showBubbleBull == showBubbleBull.BullishID_Number, 1, 0);

input ShowAll_BBl = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

#####################################################
############ Define the three selection Enums #################
#####################################################

input ShowSeventh =   {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input ShowEighth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input ShowNinth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show
###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle7;

switch (ShowSeventh) {
case AbandonedBaby_1:

    candle7 = If(ShowSeventh.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle7 = If(ShowSeventh.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle7 = If(ShowSeventh.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle7 = If(ShowSeventh.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle7 = If(ShowSeventh.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle7 = If(ShowSeventh.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle7 = If(ShowSeventh.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle7 = If(ShowSeventh.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle7 = If(ShowSeventh.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle7 = If(ShowSeventh.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle7 = If(ShowSeventh.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle7 = If(ShowSeventh.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle7 = If(ShowSeventh.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle7 = If(ShowSeventh.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle7 = If(ShowSeventh.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle7 = If(ShowSeventh.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle7 = If(ShowSeventh.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle7 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show7th = candle7;

Show7th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show7th.SetDefaultColor(Color.GREEN);

Show7th.SetLineWeight(5);
###################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle8;

switch (ShowEighth) {
case AbandonedBaby_1:

    candle8 = If(ShowEighth.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle8 = If(ShowEighth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle8 = If(ShowEighth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle8 = If(ShowEighth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle8 = If(ShowEighth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle8 = If(ShowEighth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle8 = If(ShowEighth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle8 = If(ShowEighth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle8 = If(ShowEighth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle8 = If(ShowEighth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle8 = If(ShowEighth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle8 = If(ShowEighth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle8 = If(ShowEighth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle8 = If(ShowEighth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle8 = If(ShowEighth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle8 = If(ShowEighth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle8 = If(ShowEighth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle8 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show8th = candle8;

Show8th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show8th.SetDefaultColor(Color.GREEN);

Show8th.SetLineWeight(5);

###################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle9;

switch (ShowNinth) {
case AbandonedBaby_1:

    candle9 = If(ShowNinth.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);   # edited in .bullish.need to do this  for.bearish for all
case BeltHold_2:

    candle9 = If(ShowNinth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle9 = If(ShowNinth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle9 = If(ShowNinth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle9 = If(ShowNinth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle9 = If(ShowNinth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle9 = If(ShowNinth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle9 = If(ShowNinth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle9 = If(ShowNinth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle9 = If(ShowNinth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle9 = If(ShowNinth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle9 = If(ShowNinth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle9 = If(ShowNinth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle9 = If(ShowNinth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle9 = If(ShowNinth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle9 = If(ShowNinth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle9 = If(ShowNinth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle9 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show9th = candle9;

Show9th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show9th.SetDefaultColor(Color.GREEN);

Show9th.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################

###### 1 ####################### AbandonedBaby() #############################
def ThreeShows_71 = If (ShowSeventh == ShowSeventh.AbandonedBaby_1 or ShowEighth == ShowEighth.AbandonedBaby_1 or ShowNinth == ShowNinth.AbandonedBaby_1, 1, 0);

rec AbandonedBaby_Trig_bull = If(AbandonedBaby().bullish , BarNumber(), AbandonedBaby_Trig_bull[1]);

AddLabel(AbandonedBaby_Trig_bull > 0  && showLabel_BBl  && ThreeShows_71, "1=AbandonedBaby" , Color.GREEN);

Alert(AbandonedBaby().bullish && !TurnAlertOff_BBl, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_71 , low - 6 ,  if BubNumbBull

then "1" else if BubVerbBull then "AbandonedBaby" else "" , color.white  , no);



#BeltHold_2, #Bear
###### 2 ####################### BeltHold() #############################
def ThreeShows_72 = If (ShowSeventh == ShowSeventh.BeltHold_2 or ShowEighth == ShowEighth.BeltHold_2 or ShowNinth == ShowNinth.BeltHold_2, 1, 0);

rec BeltHold_Trig_bull = If(BeltHold().bullish , BarNumber(), BeltHold_Trig_bull[1]);

AddLabel(BeltHold_Trig_bull > 0  && showLabel_BBl  && ThreeShows_72, "2=BeltHold" , Color.RED);

Alert(BeltHold().bullish && !TurnAlertOff_BBl, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_72 , low - 6 ,  if BubNumbBull

then "2" else if BubVerbBull then "BeltHold" else "" , Color.WHITE  , no);



#Breakaway_3,
###### 3 ####################### Breakaway() #############################
def ThreeShows_73 = If (ShowSeventh == ShowSeventh.Breakaway_3 or ShowEighth == ShowEighth.Breakaway_3 or ShowNinth == ShowNinth.Breakaway_3, 1, 0);

rec Breakaway_Trig_bull = If(Breakaway().bullish , BarNumber(), Breakaway_Trig_bull[1]);

AddLabel(Breakaway_Trig_bull > 0  && showLabel_BBl  && ThreeShows_73, "3=Breakaway" , Color.RED);

Alert(Breakaway().bullish && !TurnAlertOff_BBl, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway() && (BubVerbBull or BubNumbBull) && ThreeShows_73 , low - 6 ,  if BubNumbBull

then "3" else if BubVerbBull then "Breakaway" else "" , Color.WHITE  , no);


#Doji_4,
###### 4 ####################### Doji() #############################
#def ThreeShows_84 = If (ShowSeventh == ShowSeventh.Doji_4 or ShowEighth == ShowEighth.Doji_4 or ShowNinth == ShowNinth.Doji_4, 1, 0);
#rec Doji_Trig_bull = If(Doji(), BarNumber(), Doji_Trig_bull[1]);
#AddLabel(Doji_Trig_bull > 0  && showLabel_BBl  && ThreeShows_84, "4=Doji" , Color.RED);
#Alert(Doji() && !TurnAlertOff_BBl, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBull or BubNumbBull) && ThreeShows_84 , low - 6  ,  if BubNumbBull
#then "4" else if BubVerbBull then "Doji" else "" , Color.WHITE  , no);


#Engulfing_5,
###### 5 ####################### Engulfing() #############################
def ThreeShows_75 = If (ShowSeventh == ShowSeventh.Engulfing_5 or ShowEighth == ShowEighth.Engulfing_5 or ShowNinth == ShowNinth.Engulfing_5, 1, 0);

rec Engulfing_Trig_bull = If(Engulfing().bullish , BarNumber(), Engulfing_Trig_bull[1]);

AddLabel(Engulfing_Trig_bull > 0  && showLabel_BBl  && ThreeShows_75, "5=Engulfing" , Color.RED);

Alert(Engulfing().bullish && !TurnAlertOff_BBl, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_75 , low - 6 ,  if BubNumbBull

then "5" else if BubVerbBull then "Engulfing" else "" , Color.WHITE  , no);



#Harami_6,
###### 6 ####################### Harami() #############################
def ThreeShows_76 = If (ShowSeventh == ShowSeventh.Harami_6 or ShowEighth == ShowEighth.Harami_6 or ShowNinth == ShowNinth.Harami_6, 1, 0);

rec Harami_Trig_bull = If(Harami().bullish , BarNumber(), Harami_Trig_bull[1]);

AddLabel(Harami_Trig_bull > 0  && showLabel_BBl  && ThreeShows_76, "6=Harami" , Color.RED);

Alert(Harami().bullish && !TurnAlertOff_BBl, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_76 , low - 6 ,  if BubNumbBull

then "6" else if BubVerbBull then "Harami" else "" , Color.WHITE  , no);



#HaramiCross_7,
###### 7 ####################### HaramiCross() #############################
def ThreeShows_77 = If (ShowSeventh == ShowSeventh.HaramiCross_7 or ShowEighth == ShowEighth.HaramiCross_7 or ShowNinth == ShowNinth.HaramiCross_7, 1, 0);

rec HaramiCross_Trig_bull = If(HaramiCross().bullish , BarNumber(), HaramiCross_Trig_bull[1]);

AddLabel(HaramiCross_Trig_bull > 0  && showLabel_BBl  && ThreeShows_77, "7=HaramiCross" , Color.RED);

Alert(HaramiCross().bullish && !TurnAlertOff_BBl, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_77 , low - 6 ,  if BubNumbBull

then "7" else if BubVerbBull then "HaramiCross" else "" , Color.WHITE  , no);



#Kicking_8,
###### 8 ####################### BeltHold() #############################
def ThreeShows_78 = If (ShowSeventh == ShowSeventh.Kicking_8 or ShowEighth == ShowEighth.Kicking_8 or ShowNinth == ShowNinth.Kicking_8, 1, 0);

rec Kicking_Trig_bull = If(Kicking().bullish , BarNumber(), Kicking_Trig_bull[1]);

AddLabel(Kicking_Trig_bull > 0  && showLabel_BBl  && ThreeShows_78, "8=Kicking" , Color.RED);

Alert(Kicking().bullish && !TurnAlertOff_BBl, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_78 , low - 6 ,  if BubNumbBull

then "8" else if BubVerbBull then "Kicking" else "" , Color.WHITE  , no);



#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() #############################
def ThreeShows_79 = If (ShowSeventh == ShowSeventh.LongLeggedDoji_9 or ShowEighth == ShowEighth.LongLeggedDoji_9 or ShowNinth == ShowNinth.LongLeggedDoji_9, 1, 0);

rec LongLeggedDoji_Trig_bull = If(LongLeggedDoji().bullish , BarNumber(), LongLeggedDoji_Trig_bull[1]);

AddLabel(LongLeggedDoji_Trig_bull > 0  && showLabel_BBl  && ThreeShows_79, "9=LongLeggedDoji" , Color.RED);

Alert(LongLeggedDoji().bullish && !TurnAlertOff_BBl, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_79 , low - 6 ,  if BubNumbBull

then "9" else if BubVerbBull then "LongLeggedDoji" else "" , Color.WHITE  , no);



#Marubozu_10,
###### 10 ####################### Marubozu() #############################
def ThreeShows_80 = If (ShowSeventh == ShowSeventh.Marubozu_10 or ShowEighth == ShowEighth.Marubozu_10 or ShowNinth == ShowNinth.Marubozu_10, 1, 0);

rec Marubozu_Trig_bull = If(Marubozu().bullish , BarNumber(), Marubozu_Trig_bull[1]);

AddLabel(Marubozu_Trig_bull > 0  && showLabel_BBl  && ThreeShows_80, "10=Marubozu" , createColor(0, 202, 236));

Alert(Marubozu().bullish && !TurnAlertOff_BBl, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_80, low - 6 ,  if BubNumbBull

then "10" else if BubVerbBull then "Marubozu" else "" , createColor(0, 202, 236)  , no);



#MeetingLines_11,
###### 11 ####################### MeetingLines() #############################
def ThreeShows_81 = If (ShowSeventh == ShowSeventh.MeetingLines_11 or ShowEighth == ShowEighth.MeetingLines_11 or ShowNinth == ShowNinth.MeetingLines_11, 1, 0);

rec MeetingLines_Trig_bull = If(MeetingLines().bullish , BarNumber(), MeetingLines_Trig_bull[1]);

AddLabel(MeetingLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_81, "11=MeetingLines" , Color.GREEN);

Alert(MeetingLines().bullish && !TurnAlertOff_BBl, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_81, low - 6 ,  if BubNumbBull

then "1" else if BubVerbBull then "MeetingLines" else "" , Color.WHITE  , no);



#SeparatingLines_12,
###### 12 ####################### SeparatingLines() #############################
def ThreeShows_82 = If (ShowSeventh == ShowSeventh.SeparatingLines_12 or ShowEighth == ShowEighth.SeparatingLines_12 or ShowNinth == ShowNinth.SeparatingLines_12, 1, 0);

rec SeparatingLines_Trig_bull = If(SeparatingLines().bullish , BarNumber(), SeparatingLines_Trig_bull[1]);

AddLabel(SeparatingLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_82, "12=SeparatingLines" , createColor(0, 202, 236));

Alert(SeparatingLines().bullish && !TurnAlertOff_BBl, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_82, low - 6 ,  if BubNumbBull

then "12" else if BubVerbBull then "SeparatingLines" else "" , createColor(0, 202, 236)  , no);



#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() #############################
def ThreeShows_83 = If (ShowSeventh == ShowSeventh.SideBySideWhiteLines_13 or ShowEighth == ShowEighth.SideBySideWhiteLines_13 or ShowNinth == ShowNinth.SideBySideWhiteLines_13, 1, 0);

rec SideBySideWhiteLines_Trig_bull = If(SideBySideWhiteLines().bullish , BarNumber(), SideBySideWhiteLines_Trig_bull[1]);

AddLabel(SideBySideWhiteLines_Trig_bull > 0  && showLabel_BBl  && ThreeShows_83, "13=SideBySideWhiteLines" , createColor(0, 202, 236));

Alert(SideBySideWhiteLines().bullish && !TurnAlertOff_BBl, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_83, low - 6 ,  if BubNumbBull

then "13" else if BubVerbBull then "SideBySideWhiteLines" else "" , createColor(0, 202, 236)  , no);



#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() #############################
def ThreeShows_84 = If (ShowSeventh == ShowSeventh.ThreeLineStrike_14 or ShowEighth == ShowEighth.ThreeLineStrike_14 or ShowNinth == ShowNinth.ThreeLineStrike_14, 1, 0);

rec ThreeOutsideUp_Trig_bull = If(ThreeLineStrike().bullish , BarNumber(), ThreeOutsideUp_Trig_bull[1]);

AddLabel(ThreeOutsideUp_Trig_bull > 0  && showLabel_BBl  && ThreeShows_84 , "14=ThreeLineStrike" , createColor(0, 202, 236));

Alert(ThreeLineStrike().bullish && !TurnAlertOff_BBl, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_84, low - 6 ,  if BubNumbBull

then "14" else if BubVerbBull then "ThreeLineStrike" else "" , createColor(0, 202, 236)  , no);


#TriStar_15,
###### 15 ####################### TriStar() #############################
def ThreeShows_85 = If (ShowSeventh == ShowSeventh.TriStar_15 or ShowEighth == ShowEighth.TriStar_15 or ShowNinth == ShowNinth.TriStar_15, 1, 0);

rec TriStar_Trig_bull = If(TriStar().bullish , BarNumber(), TriStar_Trig_bull[1]);

AddLabel(TriStar_Trig_bull > 0  && showLabel_BBl  && ThreeShows_85, "15=TriStar" , Color.GREEN);

Alert(TriStar().bullish && !TurnAlertOff_BBl, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bullish && (BubVerbBull or BubNumbBull) && ThreeShows_85, low - 6 ,  if BubNumbBull

then "15" else if BubVerbBull then "TriStar" else "" , Color.WHITE  , no);



#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() #############################
#def ThreeShows_86 = If (ShowSeventh == ShowSeventh.WilliamsFractal_16 or ShowEighth == ShowEighth.WilliamsFractal_16 or ShowNinth == ShowNinth.WilliamsFractal_16, 1, 0);
#rec WilliamsFractal_Trig_upfractal = If(WilliamsFractal().upfractal , BarNumber(), WilliamsFractal_Trig_upfractal[1]);
#AddLabel(WilliamsFractal_Trig_upfractal > 0  && showLabel_BBl  && ThreeShows_86, "16=WilliamsFractal" , Color.GREEN);
#Alert(WilliamsFractal().upfractal && !TurnAlertOff_BBl, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().upfractal && (BubVerbBull or BubNumbBull) && ThreeShows_86, low - 6 ,  if BubNumbBull
#then "16" else if BubVerbBull then "WilliamsFractal" else "" , Color.WHITE  , no);


#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() #############################
#def ThreeShows_87 = If (ShowSeventh == ShowSeventh.ZigZagStepPattern_17 or ShowEighth == ShowEighth.ZigZagStepPattern_17 or ShowNinth == ShowNinth.ZigZagStepPattern_17, 1, 0);
#rec ZigZagStepPattern_Trig_upstep = If(ZigZagStepPattern().upstep , BarNumber(), ZigZagStepPattern_Trig_upstep[1]);
#AddLabel(ZigZagStepPattern_Trig_upstep > 0  && showLabel_BBl  && ThreeShows_87, "17=ZigZagStepPattern" , Color.GREEN);
#Alert(ZigZagStepPattern().upstep && !TurnAlertOff_BBl, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().upstep && (BubVerbBull or BubNumbBull) && ThreeShows_87, low - 6 ,  if BubNumbBull
#then "17" else if BubVerbBull then "ZigZagStepPattern" else "" , Color.WHITE  , no);



###############################################################################
#start bottom section

# AbandonedBaby_1,   
###### 1 ####################### AbandonedBaby() & showAll #################################
def  candleAll_71 = If(ShowAll_BBl == yes , AbandonedBaby().bullish, Double.NaN);

plot AB_bullish = candleAll_71;

AB_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

AB_bullish.SetDefaultColor(Color.BLUE);

AB_bullish.SetLineWeight(5);

rec AbandonedBaby_bullish_Trig_71 = If (AbandonedBaby().bullish, + BarNumber(), AbandonedBaby_bullish_Trig_71[1] );

AddLabel(AbandonedBaby_bullish_Trig_71 > 0 && showLabel_BBl && ShowAll_BBl, "1=AbandonedBaby" , Color.BLUE);

Alert(AbandonedBaby().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6,  if BubNumbBull

then "1" else if BubVerbBull then "AbandonedBaby" else "" ,  Color.BLUE , no);



#BeltHold_2,
###### 2 ####################### BeltHold() & showAll #################################
def  candleAll_72 = If(ShowAll_BBl == yes , BeltHold().bullish, Double.NaN);

plot BH_bullish = candleAll_72;

BH_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

BH_bullish.SetDefaultColor(Color.BLUE);

BH_bullish.SetLineWeight(5);

rec BeltHold_bullish_Trig_72 = If (BeltHold().BULLISH, + BarNumber(), BeltHold_bullish_Trig_72[1] );

AddLabel(BeltHold_bullish_Trig_72 > 0 && showLabel_BBl && ShowAll_BBl, "2=BeltHold" , Color.BLUE);

Alert(BeltHold().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "2" else if BubVerbBull then "BeltHold" else "" ,  Color.BLUE , no);


# Breakaway_3, 
###### 3 ####################### Breakaway() & showAll #################################
def  candleAll_73 = If(ShowAll_BBl == yes , Breakaway().bullish, Double.NaN);

plot BAWAY_bullish = candleAll_73;

BAWAY_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

BAWAY_bullish.SetDefaultColor(Color.BLUE);

BAWAY_bullish.SetLineWeight(5);

rec Breakaway_bullish_Trig_73 = If (Breakaway().bullish, + BarNumber(), Breakaway_bullish_Trig_73[1] );

AddLabel(Breakaway_bullish_Trig_73 > 0 && showLabel_BBl && ShowAll_BBl, "3=Breakaway" , Color.BLUE);

Alert(Breakaway().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "3" else if BubVerbBull then "Breakaway" else "" ,  Color.BLUE , no);



#Doji_4,
###### 4 ####################### Doji() & showAll #################################
#def  candleAll_74 = If(ShowAll == yes , Doji(), Double.NaN);

#plot DOJI = candleAll_74;
#DOJI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#rec DOJI_Trig_74 = If (Doji(), + BarNumber(), DOJI_Trig_74[1] );
#AddLabel(DOJI_Trig_74 > 0 && showLabel && ShowAll, "4=Doji" , Color.VIOLET);
#Alert(Doji()  && !TurnAlertOff && ShowAll, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBull or BubNumbBull) && (ShowAll) , low - 6 ,  if BubNumbBull
#then "4" else if BubVerbBull then "Doji" else "" ,  Color.VIOLET , no);



#Engulfing_5,
###### 5 ####################### Engulfing() & showAll #################################
def  candleAll_75 = If(ShowAll_BBl == yes , Engulfing().bullish, Double.NaN);

plot Engulfing_bullish = candleAll_75;

Engulfing_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Engulfing_bullish.SetDefaultColor(Color.BLUE);

Engulfing_bullish.SetLineWeight(5);

rec Engulfing_bullish_Trig_75 = If (Engulfing().bullish, + BarNumber(), Engulfing_bullish_Trig_75[1] );

AddLabel(Engulfing_bullish_Trig_75 > 0 && showLabel_BBl && ShowAll_BBl, "5=Engulfing" , Color.BLUE);

Alert(Engulfing().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "5" else if BubVerbBull then "Engulfing" else "" ,  Color.BLUE , no);


#Harami_6,
###### 6 ####################### Harami() & showAll #################################
def  candleAll_76 = If(ShowAll_BBl == yes , Harami().bullish, Double.NaN);

plot Harami_bullish = candleAll_76;

Harami_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Harami_bullish.SetDefaultColor(Color.BLUE);

Harami_bullish.SetLineWeight(5);

rec Harami_bullish_Trig_76 = If (Harami().bullish, + BarNumber(), Harami_bullish_Trig_76[1] );

AddLabel(Harami_bullish_Trig_76 > 0 && showLabel_BBl && ShowAll_BBl, "6=Harami" , Color.BLUE);

Alert(Harami().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "6" else if BubVerbBull then "Harami" else "" ,  Color.BLUE , no);



#HaramiCross_7,
###### 7 ####################### HaramiCross() & showAll #################################
def  candleAll_77 = If(ShowAll_BBl == yes , HaramiCross().bullish, Double.NaN);

plot HaramiCross_bullish = candleAll_77;

HaramiCross_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

HaramiCross_bullish.SetDefaultColor(Color.BLUE);

HaramiCross_bullish.SetLineWeight(5);

rec HaramiCross_bullish_Trig_77 = If (HaramiCross().bullish, + BarNumber(), HaramiCross_bullish_Trig_77[1] );

AddLabel(HaramiCross_bullish_Trig_77 > 0 && showLabel_BBl && ShowAll_BBl, "7=HaramiCross" , Color.BLUE);

Alert(HaramiCross().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "7" else if BubVerbBull then "HaramiCross" else "" ,  Color.BLUE , no);


#Kicking_8,
###### 8 ####################### Kicking() & showAll #################################
def  candleAll_78 = If(ShowAll_BBl == yes , Kicking().bullish, Double.NaN);

plot Kicking_bullish = candleAll_78;

Kicking_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Kicking_bullish.SetDefaultColor(Color.BLUE);

Kicking_bullish.SetLineWeight(5);

rec Kicking_bullish_Trig_78 = If (Kicking().bullish, + BarNumber(), Kicking_bullish_Trig_78[1] );

AddLabel(Kicking_bullish_Trig_78 > 0 && showLabel_BBl && ShowAll_BBl, "8=Kicking" , Color.BLUE);

Alert(Kicking().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "8" else if BubVerbBull then "Kicking" else "" ,  Color.BLUE , no);


#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() & showAll #################################
def  candleAll_79 = If(ShowAll_BBl == yes , LongLeggedDoji().bullish, Double.NaN);

plot LongLeggedDoji_bullish = candleAll_79;

LongLeggedDoji_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

LongLeggedDoji_bullish.SetDefaultColor(Color.BLUE);

LongLeggedDoji_bullish.SetLineWeight(5);

rec LongLeggedDoji_bullish_Trig_79 = If (LongLeggedDoji().bullish, + BarNumber(), LongLeggedDoji_bullish_Trig_79[1] );

AddLabel(LongLeggedDoji_bullish_Trig_79 > 0 && showLabel_BBl && ShowAll_BBl, "9=LongLeggedDoji" , Color.BLUE);

Alert(LongLeggedDoji().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "9" else if BubVerbBull then "LongLeggedDoji" else "" ,  Color.BLUE , no);


#Marubozu_10,
###### 10 ####################### Marubozu() & showAll #################################
def  candleAll_80 = If(ShowAll_BBl == yes , Marubozu().bullish, Double.NaN);

plot Marubozu_bullish = candleAll_80;

Marubozu_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Marubozu_bullish.SetDefaultColor(createColor(0, 202, 236));

Marubozu_bullish.SetLineWeight(5);

rec Marubozu_bullish_Trig_80 = If (Marubozu().bullish, + BarNumber(), Marubozu_bullish_Trig_80[1] );

AddLabel(Marubozu_bullish_Trig_80 > 0 && showLabel_BBl && ShowAll_BBl, "10=Marubozu" , createColor(0, 202, 236));

Alert(Marubozu().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "10" else if BubVerbBull then "Marubozu" else "" ,  createColor(0, 202, 236) , no);


#MeetingLines_11,
###### 11 ####################### MeetingLines() & showAll #################################
def  candleAll_81 = If(ShowAll_BBl == yes , MeetingLines().bullish, Double.NaN);

plot MeetingLines_bullish = candleAll_81;

MeetingLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

MeetingLines_bullish.SetDefaultColor(Color.BLUE);

MeetingLines_bullish.SetLineWeight(5);

rec MeetingLines_bullish_Trig_81 = If (MeetingLines().bullish, + BarNumber(), MeetingLines_bullish_Trig_81[1] );

AddLabel(MeetingLines_bullish_Trig_81 > 0 && showLabel_BBl && ShowAll_BBl, "11=MeetingLines" , Color.BLUE);

Alert(MeetingLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "11" else if BubVerbBull then "MeetingLines" else "" ,  Color.BLUE , no);


#SeparatingLines_12,
###### 12 ####################### SeparatingLines() & showAll #################################
def  candleAll_82 = If(ShowAll_BBl == yes , SeparatingLines().bullish, Double.NaN);

plot SeparatingLines_bullish = candleAll_82;

SeparatingLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SeparatingLines_bullish.SetDefaultColor(createColor(0, 202, 236));

SeparatingLines_bullish.SetLineWeight(5);

rec SeparatingLines_bullish_Trig_82 = If (SeparatingLines().bullish, + BarNumber(), SeparatingLines_bullish_Trig_82[1] );

AddLabel(SeparatingLines_bullish_Trig_82 > 0 && showLabel_BBl && ShowAll_BBl, "12=SeparatingLines" , createColor(0, 202, 236));

Alert(SeparatingLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "12" else if BubVerbBull then "SeparatingLines" else "" ,  createColor(0, 202, 236) , no);


#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() & showAll #################################
def  candleAll_83 = If(ShowAll_BBl == yes , SideBySideWhiteLines().bullish, Double.NaN);

plot SideBySideWhiteLines_bullish = candleAll_83;

SideBySideWhiteLines_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

SideBySideWhiteLines_bullish.SetDefaultColor(createColor(0, 202, 236));

SideBySideWhiteLines_bullish.SetLineWeight(5);

rec SideBySideWhiteLines_bullish_Trig_83 = If (SideBySideWhiteLines().bullish, + BarNumber(), SideBySideWhiteLines_bullish_Trig_83[1] );

AddLabel(SideBySideWhiteLines_bullish_Trig_83 > 0 && showLabel_BBl && ShowAll_BBl, "13=SideBySideWhiteLines" , createColor(0, 202, 236));

Alert(SideBySideWhiteLines().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "13" else if BubVerbBull then "SideBySideWhiteLines" else "" ,  createColor(0, 202, 236) , no);


#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() & showAll #################################
def  candleAll_84 = If(ShowAll_BBl == yes , ThreeLineStrike().bullish, Double.NaN);

plot ThreeLineStrike_bullish = candleAll_84;

ThreeLineStrike_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

ThreeLineStrike_bullish.SetDefaultColor(createColor(0, 202, 236));

ThreeLineStrike_bullish.SetLineWeight(5);

rec ThreeLineStrike_bullish_Trig_84 = If (ThreeLineStrike().bullish, + BarNumber(), ThreeLineStrike_bullish_Trig_84[1] );

AddLabel(ThreeLineStrike_bullish_Trig_84 > 0 && showLabel_BBl && ShowAll_BBl, "14=ThreeLineStrike" , createColor(0, 202, 236));

Alert(ThreeLineStrike().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "14" else if BubVerbBull then "ThreeLineStrike" else "" ,  createColor(0, 202, 236) , no);


#TriStar_15,
###### 15 ####################### TriStar() & showAll #################################
def  candleAll_85 = If(ShowAll_BBl == yes , TriStar(), Double.NaN);

plot TriStar_bullish = candleAll_85;

TriStar_bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

TriStar_bullish.SetDefaultColor(Color.BLUE);

TriStar_bullish.SetLineWeight(5);

rec TriStar_bullish_Trig_85 = If (TriStar().bullish, + BarNumber(), TriStar_bullish_Trig_85[1] );

AddLabel(TriStar_bullish_Trig_85 > 0 && showLabel_BBl && ShowAll_BBl, "15=TriStar" , Color.BLUE);

Alert(TriStar().bullish  && !TurnAlertOff_BBl && ShowAll_BBl, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bullish && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull

then "15" else if BubVerbBull then "TriStar" else "" ,  Color.BLUE , no);


#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() & showAll #################################
#def  candleAll_86 = If(ShowAll_BBl == yes , WilliamsFractal().UpFractal, Double.NaN);
#plot WilliamsFractal = candleAll_86;
#WilliamsFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#WilliamsFractal.SetDefaultColor(Color.BLUE);
#WilliamsFractal.SetLineWeight(5);
#rec WilliamsFractal_Trig_86 = If (WilliamsFractal().UpFractal, + WilliamsFractal(), WilliamsFractal_Trig_86[1] );
#AddLabel(WilliamsFractal_Trig_86 > 0 && showLabel && ShowAll_BBl, "16=WilliamsFractal" , Color.VIOLET);
#Alert(WilliamsFractal().UpFractal  && !TurnAlertOff_BBl && ShowAll_BBl, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().UpFractal && (BubVerbBull or BubNumbBull) && (ShowAll_BBl) , low - 6 ,  if BubNumbBull
#then "16" else if BubVerbBull then "WilliamsFractal" else "" ,  Color.VIOLET , no);


#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() & showAll #################################
#def  candleAll_87 = If(ShowAll == yes , ZigZagStepPattern(), Double.NaN);
#plot ZigZagStepPattern = candleAll_87;
#ZigZagStepPattern.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#ZigZagStepPattern.SetDefaultColor(Color.BLUE);
#ZigZagStepPattern.SetLineWeight(5);
#rec ZigZagStepPattern_Trig_87 = If (ZigZagStepPattern().upstep, + ZigZagStepPattern(), ZigZagStepPattern_Trig_87[1]);
#AddLabel(ZigZagStepPattern_Trig_87 > 0 && showLabel && ShowAll, "17=ZigZagStepPattern" , Color.VIOLET);
#Alert(ZigZagStepPattern()  && !TurnAlertOff && ShowAll, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern() && (BubVerbBull or BubNumbBull) && (ShowAll) , low - 6 ,  if BubNumbBull
#then "17" else if BubVerbBull then "ZigZagStepPattern" else "" ,  Color.VIOLET , no);

# Bullish&&Bearish Bullish only

This is the verbose B&B Bearish only:
lvxpyCN.png


This is the ID# B&B Bearish only:
ocYwtPC.png


This is select a few only of the B&B Bearish only:
ocYwtPC.png


B&B Bear Code:
Code:
#Bullish_AND_Bearish_Bearish_Patterns_only

declare upper;

#Hint: BearishCandlesticks: Plots and identifies all 14 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, bubbles and labels may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#formated by mourningwood4521 on usethinkscript using the format outlined by 'StanL' on TOS' ThinkScript Lounge for bull only.

AddLabel(yes, "Bull & Bear Bearish only Reversals", CreateColor(255, 136, 12));
AddLabel(yes, "Bull & Bear Bearish only Continuations: 10, 12, 13, 14", createColor(255, 255, 153));

#shows all bearish only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bullish. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.


input TurnAlertOff_BBr = yes;#hint TurnAlertOff:Turns on and off the alerts for any selected label that shows

input showLabel_BBr = yes;#hint showLabel:Turns on and off the showing of candle names in labels atop the plot

input showBubbleBear = {default none_bear, Verbose_Bear, BearishID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

def BubNoneBear = If (showBubbleBear == showBubbleBear.none_bear, 1, 0);

def BubVerbBear = If (showBubbleBear == showBubbleBear.Verbose_Bear, 1, 0);

def BubNumbBear = If (showBubbleBear == showBubbleBear.BearishID_Number, 1, 0);

input ShowAll_BBr = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

#####################################################

############ Define the three selection Enums #################

#####################################################

input ShowTenth =   {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show

input Showeleventh =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show


input ShowThelfth =  {default none, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #hint ShowSecond:Select the candle to show
###################################################
############ Process Input 'ShowFirst' Enum ##################
###################################################
def candle10;

switch (ShowTenth) {
case AbandonedBaby_1:

    candle10 = If(ShowTenth.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle10 = If(ShowTenth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle10 = If(ShowTenth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle10 = If(ShowTenth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle10 = If(ShowTenth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle10 = If(ShowTenth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle10 = If(ShowTenth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle10 = If(ShowTenth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle10 = If(ShowTenth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle10 = If(ShowTenth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle10 = If(ShowTenth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle10 = If(ShowTenth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle10 = If(ShowTenth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle10 = If(ShowTenth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle10 = If(ShowTenth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle10 = If(ShowTenth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle10 = If(ShowTenth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle10 = Double.NaN;
}  # Closing of switch (ShowTenth) {

plot Show10th = candle10;

Show10th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show10th.SetDefaultColor(Color.GREEN);

Show10th.SetLineWeight(5);
###################################################
############ Process Input 'ShowSecond' Enum ##################
###################################################
def candle11;

switch (Showeleventh) {
case AbandonedBaby_1:

    candle11 = If(Showeleventh.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:

    candle11 = If(Showeleventh.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle11 = If(Showeleventh.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle11 = If(Showeleventh.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle11 = If(Showeleventh.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle11 = If(Showeleventh.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle11 = If(Showeleventh.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle11 = If(Showeleventh.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle11 = If(Showeleventh.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle11 = If(Showeleventh.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle11 = If(Showeleventh.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle11 = If(Showeleventh.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle11 = If(Showeleventh.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle11 = If(Showeleventh.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle11 = If(Showeleventh.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle11 = If(Showeleventh.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle11 = If(Showeleventh.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle11 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show11th = candle11;

Show11th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show11th.SetDefaultColor(Color.GREEN);

Show11th.SetLineWeight(5);

###################################################
############ Process Input 'ShowThird' Enum ##################
###################################################
def candle12;

switch (ShowThelfth) {
case AbandonedBaby_1:

    candle12 = If(ShowThelfth.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);
# edited in .bullish.need to do this  for.bearish for all
case BeltHold_2:

    candle12 = If(ShowThelfth.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:

    candle12 = If(ShowThelfth.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:

    candle12 = If(ShowThelfth.Doji(), Doji(), Double.NaN);
case Engulfing_5:

    candle12 = If(ShowThelfth.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:

    candle12 = If(ShowThelfth.Harami(), Harami(), Double.NaN);
case HaramiCross_7:

    candle12 = If(ShowThelfth.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:

    candle12 = If(ShowThelfth.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:

    candle12 = If(ShowThelfth.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:

    candle12 = If(ShowThelfth.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:

    candle12 = If(ShowThelfth.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:

    candle12 = If(ShowThelfth.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:

    candle12 = If(ShowThelfth.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:

    candle12 = If(ShowThelfth.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:

    candle12 = If(ShowThelfth.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:

    candle12 = If(ShowThelfth.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:

    candle12 = If(ShowThelfth.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case none:

    candle12 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show12th = candle12;

Show12th.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Show12th.SetDefaultColor(Color.GREEN);

Show12th.SetLineWeight(5);
#########################################################################################

      ### Then following applies to Show1st, Show2nd & Show3rd plots ##########

     ########## The conditions for all 3 plots are implemented #################

#########################################################################################


# AbandonedBaby_1,
###### 1 ####################### AbandonedBaby() #############################
def ThreeShows_101 = If (ShowTenth == ShowTenth.AbandonedBaby_1 or Showeleventh == Showeleventh.AbandonedBaby_1 or ShowThelfth == ShowThelfth.AbandonedBaby_1, 1, 0);

rec AbandonedBaby_Trig_bear = If(AbandonedBaby().bearish , BarNumber(), AbandonedBaby_Trig_bear[1]);

AddLabel(AbandonedBaby_Trig_bear > 0  && showLabel_BBr  && ThreeShows_101, "1=AbandonedBaby" , CreateColor(255, 136, 12));

Alert(AbandonedBaby().bearish && !TurnAlertOff_BBr, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_101 , high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "AbandonedBaby" else "" , CreateColor(255, 136, 12)  , yes);  #BubVerbBear



#BeltHold_2, #Bear
###### 2 ####################### BeltHold() #############################
def ThreeShows_102 = If (ShowTenth == ShowTenth.BeltHold_2 or Showeleventh == Showeleventh.BeltHold_2 or ShowThelfth == ShowThelfth.BeltHold_2, 1, 0);

rec BeltHold_Trig_bear = If(BeltHold().bearish , BarNumber(), BeltHold_Trig_bear[1]);

AddLabel(BeltHold_Trig_bear > 0  && showLabel_BBr  && ThreeShows_102, "2=BeltHold" , CreateColor(255, 136, 12));

Alert(BeltHold().bearish && !TurnAlertOff_BBr, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_102 , high + 6 ,  if BubNumbBear

then "2" else if BubVerbBear then "BeltHold" else "" , CreateColor(255, 136, 12)  , yes);



#Breakaway_3,
###### 3 ####################### Breakaway() #############################
def ThreeShows_103 = If (ShowTenth == ShowTenth.Breakaway_3 or Showeleventh == Showeleventh.Breakaway_3 or ShowThelfth == ShowThelfth.Breakaway_3, 1, 0);

rec Breakaway_Trig_bear = If(Breakaway().bearish , BarNumber(), Breakaway_Trig_bear[1]);

AddLabel(Breakaway_Trig_bear > 0  && showLabel_BBr  && ThreeShows_103, "3=Breakaway" , CreateColor(255, 136, 12));

Alert(Breakaway().bearish && !TurnAlertOff_BBr, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_103 , high + 6 ,  if BubNumbBear

then "3" else if BubVerbBear then "Breakaway" else "" , CreateColor(255, 136, 12)  , yes);



#Doji_4,
###### 4 ####################### Doji() #############################
#def ThreeShows_104 = If (ShowTenth == ShowTenth.Doji_4 or Showeleventh == Showeleventh.Doji_4 or ShowThelfth == ShowThelfth.Doji_4, 1, 0);
#rec Doji_Trig = If(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(Doji_Trig > 0  && showLabel_BBr  && ThreeShows_104, "4=Doji" , color.yellow);
#Alert(Doji() && !TurnAlertOff_BBr, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBear or BubNumbBear) && ThreeShows_104 , high + 6 ,  if BubNumbBear
#then "4" else if BubVerbBear then "Doji" else "" , color.yellow  , yes);



#Engulfing_5,
###### 5 ####################### Engulfing() #############################
def ThreeShows_105 = If (ShowTenth == ShowTenth.Engulfing_5 or Showeleventh == Showeleventh.Engulfing_5 or ShowThelfth == ShowThelfth.Engulfing_5, 1, 0);

rec Engulfing_Trig_bear = If(Engulfing().bearish , BarNumber(), Engulfing_Trig_bear[1]);

AddLabel(Engulfing_Trig_bear > 0  && showLabel_BBr  && ThreeShows_105, "5=Engulfing" , CreateColor(255, 136, 12));

Alert(Engulfing().bearish && !TurnAlertOff_BBr, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_105 , high + 6 ,  if BubNumbBear

then "5" else if BubVerbBear then "Engulfing" else "" , CreateColor(255, 136, 12)  , yes);  #10



#Harami_6,
###### 6 ####################### Harami() #############################
def ThreeShows_106 = If (ShowTenth == ShowTenth.Harami_6 or Showeleventh == Showeleventh.Harami_6 or ShowThelfth == ShowThelfth.Harami_6, 1, 0);

rec Harami_Trig_bear = If(Harami().bearish , BarNumber(), Harami_Trig_bear[1]);

AddLabel(Harami_Trig_bear > 0  && showLabel_BBr  && ThreeShows_106, "6=Harami" , CreateColor(255, 136, 12));

Alert(Harami().bearish && !TurnAlertOff_BBr, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_106 , high + 6 ,  if BubNumbBear

then "6" else if BubVerbBear then "Harami" else "" , CreateColor(255, 136, 12)  , yes);



#HaramiCross_7,
###### 7 ####################### HaramiCross() #############################
def ThreeShows_107 = If (ShowTenth == ShowTenth.HaramiCross_7 or Showeleventh == Showeleventh.HaramiCross_7 or ShowThelfth == ShowThelfth.HaramiCross_7, 1, 0);

rec HaramiCross_Trig_bear = If(HaramiCross().bearish , BarNumber(), HaramiCross_Trig_bear[1]);

AddLabel(HaramiCross_Trig_bear > 0  && showLabel_BBr  && ThreeShows_107, "7=HaramiCross" , CreateColor(255, 136, 12));

Alert(HaramiCross().bearish && !TurnAlertOff_BBr, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_107 , high + 6 ,  if BubNumbBear

then "7" else if BubVerbBear then "HaramiCross" else "" , CreateColor(255, 136, 12)  , yes);



#Kicking_8,
###### 8 ####################### BeltHold() #############################
def ThreeShows_108 = If (ShowTenth == ShowTenth.Kicking_8 or ShowEleventh == ShowEleventh.Kicking_8 or ShowThelfth == ShowThelfth.Kicking_8, 1, 0);

rec Kicking_Trig_bear = If(Kicking().bearish , BarNumber(), Kicking_Trig_bear[1]);

AddLabel(Kicking_Trig_bear > 0  && showLabel_BBr  && ThreeShows_108, "8=Kicking" , CreateColor(255, 136, 12));

Alert(Kicking().bearish && !TurnAlertOff_BBr, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_108 , high + 6 ,  if BubNumbBear

then "8" else if BubVerbBear then "Kicking" else "" , CreateColor(255, 136, 12)  , yes);



#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() #############################
def ThreeShows_109 = If (ShowTenth == ShowTenth.LongLeggedDoji_9 or ShowEleventh == ShowEleventh.LongLeggedDoji_9 or ShowThelfth == ShowThelfth.LongLeggedDoji_9, 1, 0);

rec LongLeggedDoji_Trig_bear = If(LongLeggedDoji().bearish , BarNumber(), LongLeggedDoji_Trig_bear[1]);

AddLabel(LongLeggedDoji_Trig_bear > 0  && showLabel_BBr  && ThreeShows_109, "9=LongLeggedDoji" , CreateColor(255, 136, 12));

Alert(LongLeggedDoji().bearish && !TurnAlertOff_BBr, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_109 , high + 6 ,  if BubNumbBear

then "9" else if BubVerbBear then "LongLeggedDoji" else "" , CreateColor(255, 136, 12)  , yes);



#Marubozu_10,
###### 10 ####################### Marubozu() #############################
def ThreeShows_10 = If (ShowTenth == ShowTenth.Marubozu_10 or ShowEleventh == ShowEleventh.Marubozu_10 or ShowThelfth == ShowThelfth.Marubozu_10, 1, 0);

rec Marubozu_Trig_bear = If(Marubozu().bearish , BarNumber(), Marubozu_Trig_bear[1]);

AddLabel(Marubozu_Trig_bear > 0  && showLabel_BBr  && ThreeShows_10, "10=Marubozu" , createColor(255, 255, 153));

Alert(Marubozu().bearish && !TurnAlertOff_BBr, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_10, high + 6 ,  if BubNumbBear

then "10" else if BubVerbBear then "Marubozu" else "" , createColor(255, 255, 153)  , yes);



#MeetingLines_11,
###### 11 ####################### MeetingLines() #############################
def ThreeShows_111 = If (ShowTenth == ShowTenth.MeetingLines_11 or ShowEleventh == ShowEleventh.MeetingLines_11 or ShowThelfth == ShowThelfth.MeetingLines_11, 1, 0);

rec MeetingLines_Trig_bear = If(MeetingLines().bearish , BarNumber(), MeetingLines_Trig_bear[1]);

AddLabel(MeetingLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_111, "11=MeetingLines" , CreateColor(255, 136, 12));

Alert(MeetingLines().bearish && !TurnAlertOff_BBr, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_111, high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "MeetingLines" else "" , CreateColor(255, 136, 12)  , yes);



#SeparatingLines_12,
###### 12 ####################### SeparatingLines() #############################
def ThreeShows_112 = If (ShowTenth == ShowTenth.SeparatingLines_12 or ShowEleventh == ShowEleventh.SeparatingLines_12 or ShowThelfth == ShowThelfth.SeparatingLines_12, 1, 0);

rec SeparatingLines_Trig_bear = If(SeparatingLines().bearish , BarNumber(), SeparatingLines_Trig_bear[1]);

AddLabel(SeparatingLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_112, "12=SeparatingLines" , createColor(255, 255, 153));

Alert(SeparatingLines().bearish && !TurnAlertOff_BBr, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_112,  high + 6 ,  if BubNumbBear

then "12" else if BubVerbBear then "SeparatingLines" else "" , createColor(255, 255, 153)  , yes);



#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() #############################
def ThreeShows_113 = If (ShowTenth == ShowTenth.SideBySideWhiteLines_13 or ShowEleventh == ShowEleventh.SideBySideWhiteLines_13 or ShowThelfth == ShowThelfth.SideBySideWhiteLines_13, 1, 0);

rec SideBySideWhiteLines_Trig_bear = If(SideBySideWhiteLines().bearish , BarNumber(), SideBySideWhiteLines_Trig_bear[1]);

AddLabel(SideBySideWhiteLines_Trig_bear > 0  && showLabel_BBr  && ThreeShows_113, "13=SideBySideWhiteLines" , createColor(255, 255, 153));

Alert(SideBySideWhiteLines().bearish && !TurnAlertOff_BBr, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_113, high + 6 ,  if BubNumbBear

then "13" else if BubVerbBear then "SideBySideWhiteLines" else "" , createColor(255, 255, 153)  , yes);



#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() #############################
def ThreeShows_114 = If (ShowTenth == ShowTenth.ThreeLineStrike_14 or ShowEleventh == ShowEleventh.ThreeLineStrike_14 or ShowThelfth == ShowThelfth.ThreeLineStrike_14, 1, 0);

rec ThreeOutsideUp_Trig_bear = If(ThreeLineStrike().bearish , BarNumber(), ThreeOutsideUp_Trig_bear[1]);

AddLabel(ThreeOutsideUp_Trig_bear > 0  && showLabel_BBr  && ThreeShows_114, "14=ThreeLineStrike" , createColor(255, 255, 153));

Alert(ThreeLineStrike().bearish && !TurnAlertOff_BBr, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_114, high + 6 ,  if BubNumbBear

then "14" else if BubVerbBear then "ThreeLineStrike" else "" , createColor(255, 255, 153)  , yes);



#TriStar_15,
###### 15 ####################### TriStar() #############################
def ThreeShows_115 = If (ShowTenth == ShowTenth.TriStar_15 or ShowEleventh == ShowEleventh.TriStar_15 or ShowThelfth == ShowThelfth.TriStar_15, 1, 0);

rec TriStar_Trig_bear = If(TriStar().bearish , BarNumber(), TriStar_Trig_bear[1]);

AddLabel(TriStar_Trig_bear > 0  && showLabel_BBr  && ThreeShows_115 , "15=TriStar" , CreateColor(255, 136, 12));

Alert(TriStar().bearish && !TurnAlertOff_BBr, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bearish && (BubVerbBear or BubNumbBear) && ThreeShows_115, high + 6 ,  if BubNumbBear

then "15" else if BubVerbBear then "TriStar" else "" , CreateColor(255, 136, 12)  , yes);



#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() #############################
#def ThreeShows_116 = If (ShowTenth == ShowTenth.WilliamsFractal_16 or ShowEleventh == ShowEleventh.WilliamsFractal_16 or ShowThelfth == ShowThelfth.WilliamsFractal_16, 1, 0);
#rec WilliamsFractal_Trig_downfractal = If(WilliamsFractal().downfractal , BarNumber(), WilliamsFractal_Trig_downfractal[1]);
#AddLabel(WilliamsFractal_Trig_downfractal > 0  && showLabel_BBr  && ThreeShows_116, "16=WilliamsFractal" , color.yellow);
#Alert(WilliamsFractal().downfractal && !TurnAlertOff_BBr, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().downfractal && (BubVerbBear or BubNumbBear) && ThreeShows_116, high + 6 ,  if BubNumbBear
#then "16" else if BubVerbBear then "WilliamsFractal" else "" , color.yellow  , no);



#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() #############################
#def ThreeShows_117 = If (ShowTenth == ShowTenth.ZigZagStepPattern_17 or ShowEleventh == ShowEleventh.ZigZagStepPattern_17 or ShowThelfth == ShowThelfth.ZigZagStepPattern_17, 1, 0);
#rec ZigZagStepPattern_Trig_downstep = If(ZigZagStepPattern().downstep , BarNumber(), ZigZagStepPattern_Trig_downstep[1]);
#AddLabel(ZigZagStepPattern_Trig_downstep > 0  && showLabel_BBr  && ThreeShows_117, "17=ZigZagStepPattern" , color.yellow);
#Alert(ZigZagStepPattern().downstep && !TurnAlertOff_BBr, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().downstep && (BubVerbBear or BubNumbBear) && ThreeShows_117 , high + 6 ,  if BubNumbBear
#then "17" else if BubVerbBear then "ZigZagStepPattern" else "" , color.yellow  , no);



#####################################################################################################
#Start Main Bottom Section

# AbandonedBaby_1,   
###### 1 ####################### AbandonedBaby() & showAll ################################# 10
def  candleAll_101 = If(ShowAll_BBr == yes , AbandonedBaby().bearish, Double.NaN);

plot AB_bearish = candleAll_101;

AB_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

AB_bearish.SetDefaultColor(CreateColor(255, 136, 12));

AB_bearish.SetLineWeight(5);

rec AbandonedBaby_Trig_101 = If (AbandonedBaby().bearish, + BarNumber(), AbandonedBaby_Trig_101[1] );

AddLabel(AbandonedBaby_Trig_101 > 0 && showLabel_BBr && ShowAll_BBr, "1=AbandonedBaby" , CreateColor(255, 136, 12));

Alert(AbandonedBaby().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "AbandonedBaby", Alert.BAR, Sound.Chimes);

AddChartBubble(AbandonedBaby().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "1" else if BubVerbBear then "AbandonedBaby" else "" ,  CreateColor(255, 136, 12) , yes);



#BeltHold_2,
###### 2 ####################### BeltHold() & showAll #################################
def  candleAll_102 = If(ShowAll_BBr == yes , BeltHold().bearish, Double.NaN);

plot BH_bearish = candleAll_102;

BH_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

BH_bearish.SetDefaultColor(CreateColor(255, 136, 12));

BH_bearish.SetLineWeight(5);

rec BeltHold_Trig_102 = If (BeltHold().bearish, + BarNumber(), BeltHold_Trig_102[1] );

AddLabel(BeltHold_Trig_102 > 0 && showLabel_BBr && ShowAll_BBr, "2=BeltHold" , CreateColor(255, 136, 12));

Alert(BeltHold().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "BeltHold", Alert.BAR, Sound.Chimes);

AddChartBubble(BeltHold().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "2" else if BubVerbBear then "BeltHold" else "" ,  CreateColor(255, 136, 12) , yes);



# Breakaway_3, 
###### 3 ####################### Breakaway() & showAll #################################
def  candleAll_103 = If(ShowAll_BBr == yes , Breakaway().bearish, Double.NaN);

plot BAWAY_bearish = candleAll_103;

BAWAY_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

BAWAY_bearish.SetDefaultColor(CreateColor(255, 136, 12));

BAWAY_bearish.SetLineWeight(5);

rec Breakaway_Trig_103 = If (Breakaway().bearish, + BarNumber(), Breakaway_Trig_103[1] );

AddLabel(Breakaway_Trig_103 > 0 && showLabel_BBr && ShowAll_BBr, "3=Breakaway" , CreateColor(255, 136, 12));

Alert(Breakaway().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Breakaway", Alert.BAR, Sound.Chimes);

AddChartBubble(Breakaway().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "3" else if BubVerbBear then "Breakaway" else "" ,  CreateColor(255, 136, 12) , yes);


#######if you want to take out or add the dojis, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.

#Doji_4,
###### 4 ####################### Doji() & showAll #################################
#def  candleAll_104 = If(ShowAll_BBr == yes , Doji(), Double.NaN);
#plot DOJI = candleAll_104;
#DOJI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#rec DOJI_Trig_104 = If (Doji(), + BarNumber(), DOJI_Trig_104[1] );
#AddLabel(DOJI_Trig_104 > 0 && showLabel_BBr && ShowAll_BBr, "4=Doji" , Color.YELLOW);
#Alert(Doji()  && !TurnAlertOff_BBr && ShowAll_BBr, "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble(Doji() && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "4" else if BubVerbBear then "Doji" else "" ,  Color.YELLOW , yes);



#Engulfing_5,
###### 5 ####################### Engulfing() & showAll #################################
def  candleAll_105 = If(ShowAll_BBr == yes , Engulfing().bearish, Double.NaN);

plot Engulfing_bearish = candleAll_105;

Engulfing_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Engulfing_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Engulfing_bearish.SetLineWeight(5);

rec Engulfing_Trig_105 = If (Engulfing().bearish, + BarNumber(), Engulfing_Trig_105 [1] );

AddLabel(Engulfing_Trig_105 > 0 && showLabel_BBr && ShowAll_BBr, "5=Engulfing" , CreateColor(255, 136, 12));

Alert(Engulfing().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Engulfing", Alert.BAR, Sound.Chimes);

AddChartBubble(Engulfing().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "5" else if BubVerbBear then "Engulfing" else "" ,  CreateColor(255, 136, 12) , yes);


#Harami_6,
###### 6 ####################### Harami() & showAll #################################
def  candleAll_106 = If(ShowAll_BBr == yes , Harami().bearish, Double.NaN);

plot Harami_bearish = candleAll_106;

Harami_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Harami_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Harami_bearish.SetLineWeight(5);

rec Harami_Trig_106 = If (Harami().bearish, + BarNumber(), Harami_Trig_106[1] );

AddLabel(Harami_Trig_106 > 0 && showLabel_BBr && ShowAll_BBr, "6=Harami" , CreateColor(255, 136, 12));

Alert(Harami().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Harami", Alert.BAR, Sound.Chimes);

AddChartBubble(Harami().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "6" else if BubVerbBear then "Harami" else "" ,  CreateColor(255, 136, 12) , yes);



#HaramiCross_7,
###### 7 ####################### HaramiCross() & showAll #################################
def  candleAll_107 = If(ShowAll_BBr == yes , HaramiCross().bearish, Double.NaN);

plot HaramiCross_bearish = candleAll_107;

HaramiCross_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); # bearish

HaramiCross_bearish.SetDefaultColor(CreateColor(255, 136, 12));

HaramiCross_bearish.SetLineWeight(5);

rec HaramiCross_Trig_107 = If (HaramiCross().bearish, + BarNumber(), HaramiCross_Trig_107[1] );

AddLabel(HaramiCross_Trig_107 > 0 && showLabel_BBr && ShowAll_BBr, "7=HaramiCross" , CreateColor(255, 136, 12));

Alert(HaramiCross().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "HaramiCross", Alert.BAR, Sound.Chimes);

AddChartBubble(HaramiCross().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "7" else if BubVerbBear then "HaramiCross" else "" ,  CreateColor(255, 136, 12) , yes);


#Kicking_8,
###### 8 ####################### Kicking() & showAll #################################
def  candleAll_108 = If(ShowAll_BBr == yes , Kicking().bearish, Double.NaN);

plot Kicking_bearish = candleAll_108;

Kicking_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Kicking_bearish.SetDefaultColor(CreateColor(255, 136, 12));

Kicking_bearish.SetLineWeight(5);

rec Kicking_Trig_108 = If (Kicking().bearish, + BarNumber(), Kicking_Trig_108[1] );

AddLabel(Kicking_Trig_108 > 0 && showLabel_BBr && ShowAll_BBr, "8=Kicking" , CreateColor(255, 136, 12));

Alert(Kicking().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Kicking", Alert.BAR, Sound.Chimes);

AddChartBubble(Kicking().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "8" else if BubVerbBear then "Kicking" else "" ,  CreateColor(255, 136, 12) , yes);


#LongLeggedDoji_9,
###### 9 ####################### LongLeggedDoji() & showAll #################################
def  candleAll_109 = If(ShowAll_BBr == yes , LongLeggedDoji().bearish, Double.NaN);

plot LongLeggedDoji_bearish = candleAll_109;

LongLeggedDoji_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

LongLeggedDoji_bearish.SetDefaultColor(CreateColor(255, 136, 12));

LongLeggedDoji_bearish.SetLineWeight(5);

rec LongLeggedDoji_Trig_109 = If (LongLeggedDoji().bearish, + BarNumber(), LongLeggedDoji_Trig_109[1] );

AddLabel(LongLeggedDoji_Trig_109 > 0 && showLabel_BBr && ShowAll_BBr, "9=LongLeggedDoji" , CreateColor(255, 136, 12));

Alert(LongLeggedDoji().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "LongLeggedDoji", Alert.BAR, Sound.Chimes);

AddChartBubble(LongLeggedDoji().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "9" else if BubVerbBear then "LongLeggedDoji" else "" ,  CreateColor(255, 136, 12) , yes);


#Marubozu_10,
###### 10 ####################### Marubozu() & showAll #################################
def  candleAll_110 = If(ShowAll_BBr == yes , Marubozu().bearish, Double.NaN);

plot Marubozu_bearish = candleAll_110;

Marubozu_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Marubozu_bearish.SetDefaultColor(createColor(255, 255, 153));

Marubozu_bearish.SetLineWeight(5);

rec Marubozu_Trig_110 = If (Marubozu().bearish, + BarNumber(), Marubozu_Trig_110[1] );

AddLabel(Marubozu_Trig_110 > 0 && showLabel_BBr && ShowAll_BBr, "10=Marubozu" , createColor(255, 255, 153));

Alert(Marubozu().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "Marubozu", Alert.BAR, Sound.Chimes);

AddChartBubble(Marubozu().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "10" else if BubVerbBear then "Marubozu" else "" ,  createColor(255, 255, 153) , yes);


#MeetingLines_11,
###### 11 ####################### MeetingLines() & showAll #################################
def  candleAll_111 = If(ShowAll_BBr == yes , MeetingLines().bearish, Double.NaN);

plot MeetingLines_bearish = candleAll_111;

MeetingLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

MeetingLines_bearish.SetDefaultColor(CreateColor(255, 136, 12));

MeetingLines_bearish.SetLineWeight(5);

rec MeetingLines_Trig_111 = If (MeetingLines().bearish, + BarNumber(), MeetingLines_Trig_111[1] );

AddLabel(MeetingLines_Trig_111 > 0 && showLabel_BBr && ShowAll_BBr, "11=MeetingLines" , CreateColor(255, 136, 12));

Alert(MeetingLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "MeetingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(MeetingLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "11" else if BubVerbBear then "MeetingLines" else "" ,  CreateColor(255, 136, 12) , yes);


#SeparatingLines_12,
###### 12 ####################### SeparatingLines() & showAll #################################
def  candleAll_112 = If(ShowAll_BBr == yes , SeparatingLines().bearish, Double.NaN);

plot SeparatingLines_bearish = candleAll_112;

SeparatingLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SeparatingLines_bearish.SetDefaultColor(createColor(255, 255, 153));

SeparatingLines_bearish.SetLineWeight(5);

rec SeparatingLines_Trig_112 = If (SeparatingLines().bearish, + BarNumber(), SeparatingLines_Trig_112[1] );

AddLabel(SeparatingLines_Trig_112 > 0 && showLabel_BBr && ShowAll_BBr, "12=SeparatingLines" , createColor(255, 255, 153));

Alert(SeparatingLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "SeparatingLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SeparatingLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "12" else if BubVerbBear then "SeparatingLines" else "" ,  createColor(255, 255, 153) , yes);


#SideBySideWhiteLines_13,
###### 13 ####################### SideBySideWhiteLines() & showAll #################################
def  candleAll_113 = If(ShowAll_BBr == yes , SideBySideWhiteLines().bearish, Double.NaN);

plot SideBySideWhiteLines_bearish = candleAll_113;

SideBySideWhiteLines_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

SideBySideWhiteLines_bearish.SetDefaultColor(createColor(255, 255, 153));

SideBySideWhiteLines_bearish.SetLineWeight(5);

rec SideBySideWhiteLines_Trig_113 = If (SideBySideWhiteLines().bearish, + BarNumber(), SideBySideWhiteLines_Trig_113[1] );

AddLabel(SideBySideWhiteLines_Trig_113 > 0 && showLabel_BBr && ShowAll_BBr, "13=SideBySideWhiteLines" , createColor(255, 255, 153));

Alert(SideBySideWhiteLines().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);

AddChartBubble(SideBySideWhiteLines().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "13" else if BubVerbBear then "SideBySideWhiteLines" else "" ,  createColor(255, 255, 153) , yes);


#ThreeLineStrike_14,
###### 14 ####################### ThreeLineStrike() & showAll #################################
def  candleAll_114 = If(ShowAll_BBr == yes , ThreeLineStrike().bearish, Double.NaN);

plot ThreeLineStrike_bearish = candleAll_114;

ThreeLineStrike_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

ThreeLineStrike_bearish.SetDefaultColor(createColor(255, 255, 153));

ThreeLineStrike_bearish.SetLineWeight(5);

rec ThreeLineStrike_Trig_114 = If (ThreeLineStrike().bearish, + BarNumber(), ThreeLineStrike_Trig_114[1] );

AddLabel(ThreeLineStrike_Trig_114 > 0 && showLabel_BBr && ShowAll_BBr, "14=ThreeLineStrike" , createColor(255, 255, 153));

Alert(ThreeLineStrike().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "ThreeLineStrike", Alert.BAR, Sound.Chimes);

AddChartBubble(ThreeLineStrike().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "14" else if BubVerbBear then "ThreeLineStrike" else "" ,  createColor(255, 255, 153) , yes);


#TriStar_15,
###### 15 ####################### TriStar() & showAll #################################
def  candleAll_115 = If(ShowAll_BBr == yes , TriStar().bearish, Double.NaN);

plot TriStar_bearish = candleAll_115;

TriStar_bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

TriStar_bearish.SetDefaultColor(CreateColor(255, 136, 12));

TriStar_bearish.SetLineWeight(5);

rec TriStar_Trig_115 = If (TriStar().bearish, + BarNumber(), TriStar_Trig_115[1] );

AddLabel(TriStar_Trig_115 > 0 && showLabel_BBr && ShowAll_BBr, "15=TriStar" , CreateColor(255, 136, 12));

Alert(TriStar().bearish  && !TurnAlertOff_BBr && ShowAll_BBr, "TriStar", Alert.BAR, Sound.Chimes);

AddChartBubble(TriStar().bearish && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear

then "15" else if BubVerbBear then "TriStar" else "" ,  CreateColor(255, 136, 12) , yes);

#######if you want to take out or add the WilliamsFractal, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.
#WilliamsFractal_16,
###### 16 ####################### WilliamsFractal() & showAll #################################
#def  candleAll_116 = If(ShowAll_BBr == yes , WilliamsFractal().downfractal, Double.NaN);
#plot WilliamsFractal = candleAll_116;
#WilliamsFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#WilliamsFractal.SetDefaultColor(CreateColor(255, 136, 12));
#WilliamsFractal.SetLineWeight(5);
#rec WilliamsFractal_Trig_116 = If (WilliamsFractal().DownFractal, + BarNumber(), WilliamsFractal_Trig_116[1] );
#AddLabel(WilliamsFractal_Trig_116 is true && showLabel_BBr && ShowAll_BBr, "16=WilliamsFractal" , Color.YELLOW); # changed > 0 to is true
#Alert(WilliamsFractal().DownFractal  && !TurnAlertOff_BBr && ShowAll_BBr, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble(WilliamsFractal().DownFractal && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "16" else if BubVerbBear then "WilliamsFractal" else "" ,  Color.YELLOW , yes);

#######if you want to take out or add the ZigZagStepPattern, just hit return between the  first word and the # so you dont have to keep deleting and adding #'s when you change your mind.

#ZigZagStepPattern_17,
###### 17 ####################### ZigZagStepPattern() & showAll #################################
#def  candleAll_117 = If(ShowAll_BBr == yes , ZigZagStepPattern().downstep, Double.NaN);
#plot ZigZagStepPattern = candleAll_117;
#ZigZagStepPattern.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#ZigZagStepPattern.SetDefaultColor(CreateColor(255, 136, 12));
#ZigZagStepPattern.SetLineWeight(5);
#rec ZigZagStepPattern_Trig_117 = If (ZigZagStepPattern().upstep, + BarNumber(), ZigZagStepPattern_Trig_117[1]);
#AddLabel(ZigZagStepPattern_Trig_117 is true && showLabel_BBr && ShowAll_BBr, "17=ZigZagStepPattern" , Color.YELLOW); # changed > 0 to is true
#Alert(ZigZagStepPattern().downstep  && !TurnAlertOff_BBr && ShowAll_BBr, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble(ZigZagStepPattern().downstep && (BubVerbBear or BubNumbBear) && (ShowAll_BBr) , high + 6 ,  if BubNumbBear
#then "17" else if BubVerbBear then "ZigZagStepPattern" else "" ,  Color.YELLOW , yes);

Here is all 4 study patterns verbose:
XsBYuro.png


Here is all 4 study patterns ID #:
PBgLBOO.png

is there a way to move the titles closer to the arrows?

https://ibb.co/thcfx58
 
is there a way to move the titles closer to the arrows?

https://ibb.co/thcfx58
I am having this same issue. I am enjoying using this study as a learning and research tool.

But the bubbles are sooo far down that I can't both see the bubbles and have the candlesticks at the proper size for meaningful interpretation.

Any idea how to move the bubbles right up underneath the candlesticks?

EDIT: interestingly, this issue only seems to happen on certain stocks, and not others. Why might this be?
 
is there a way to move the titles closer to the arrows?

https://ibb.co/thcfx58
I am having this same issue. I am enjoying using this study as a learning and research tool.

But the bubbles are sooo far down that I can't both see the bubbles and have the candlesticks at the proper size for meaningful interpretation.

Any idea how to move the bubbles right up underneath the candlesticks?

EDIT: interestingly, this issue only seems to happen on certain stocks, and not others. Why might this be?
Not totally sure what your questions are, but does this help?
https://usethinkscript.com/threads/addchartbubble-tutorial-for-thinkorswim.10297/
 
Is it possible to make this as a lower indicator that shows when there is a bullish (or bearish) candlestick pattern. Like a dot or something, or a ribbon that shows a different color when they occur like green dots for bullish and red dots for bearish. I see this as a trigger to enter when other indicators already show a directional bias. Such as- all your indicators say market looks bullish, then get a bullish candlestick payyern as the trigger. Any assistance is appreciated
 
Is it possible to make this as a lower indicator that shows when there is a bullish (or bearish) candlestick pattern. Like a dot or something, or a ribbon that shows a different color when they occur like green dots for bullish and red dots for bearish. I see this as a trigger to enter when other indicators already show a directional bias. Such as- all your indicators say market looks bullish, then get a bullish candlestick payyern as the trigger. Any assistance is appreciated
I attempted such a thing once. It was ugly and not successful.
 
I am having this same issue. I am enjoying using this study as a learning and research tool.

But the bubbles are sooo far down that I can't both see the bubbles and have the candlesticks at the proper size for meaningful interpretation.

Any idea how to move the bubbles right up underneath the candlesticks?

EDIT: interestingly, this issue only seems to happen on certain stocks, and not others. Why might this be?
Probably too long ago to matter but for anyone else, the issue is the OP is adding an offset to the bubbles (which is based on the stock price), if you search for "high +15" "low - 15" "high + 6" "low - 6" you'll see what i mean

I modified the original scripts with the following changes (leaving credit to previous authors):
Code:
# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

Bullish_Patterns_Only http://tos.mx/!LB9oKT5r
Bullish_Patterns_Only-labels.png

Code:
# Bullish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bearish_Patterns_Only: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

#DefineGlobalColor("BearishReversal",     CreateColor(230, 104, 104));
DefineGlobalColor("BullishReversal",     CreateColor(104, 230, 104));
#DefineGlobalColor("BearishContinuation", CreateColor(255, 174, 174));
DefineGlobalColor("BullishContinuation", CreateColor(174, 255, 174));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bullish Only Reversals", GlobalColor("BullishReversal"));
AddLabel(ShowMainLabel, "Bullish Only Continuations: 3, 7, 12, 19, 20", GlobalColor("BullishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint ShowBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, low, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFourth, ShowFifth or ShowSixth.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case ConcealingBabySwallow_1:
    candle1 = if(ShowFirst.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle1 = if(ShowFirst.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle1 = if(ShowFirst.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle1 = if(ShowFirst.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle1 = if(ShowFirst.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle1 = if(ShowFirst.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle1 = if(ShowFirst.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle1 = if(ShowFirst.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle1 = if(ShowFirst.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle1 = if(ShowFirst.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle1 = if(ShowFirst.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle1 = if(ShowFirst.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle1 = if(ShowFirst.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle1 = if(ShowFirst.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle1 = if(ShowFirst.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle1 = if(ShowFirst.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle1 = if(ShowFirst.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle1 = if(ShowFirst.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle1 = if(ShowFirst.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle1 = if(ShowFirst.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case ConcealingBabySwallow_1:
    candle2 = if(ShowSecond.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle2 = if(ShowSecond.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle2 = if(ShowSecond.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle2 = if(ShowSecond.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle2 = if(ShowSecond.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle2 = if(ShowSecond.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle2 = if(ShowSecond.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle2 = if(ShowSecond.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle2 = if(ShowSecond.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle2 = if(ShowSecond.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle2 = if(ShowSecond.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle2 = if(ShowSecond.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle2 = if(ShowSecond.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle2 = if(ShowSecond.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle2 = if(ShowSecond.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle2 = if(ShowSecond.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle2 = if(ShowSecond.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle2 = if(ShowSecond.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle2 = if(ShowSecond.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle2 = if(ShowSecond.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case ConcealingBabySwallow_1:
    candle3 = if(ShowThird.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle3 = if(ShowThird.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle3 = if(ShowThird.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle3 = if(ShowThird.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle3 = if(ShowThird.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle3 = if(ShowThird.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle3 = if(ShowThird.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle3 = if(ShowThird.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle3 = if(ShowThird.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle3 = if(ShowThird.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle3 = if(ShowThird.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle3 = if(ShowThird.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle3 = if(ShowThird.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle3 = if(ShowThird.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle3 = if(ShowThird.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle3 = if(ShowThird.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle3 = if(ShowThird.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle3 = if(ShowThird.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle3 = if(ShowThird.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle3 = if(ShowThird.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# ConcealingBabySwallow_1
##### 1 ##### ConcealingBabySwallow() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.ConcealingBabySwallow_1 then 1 else if ShowSecond == ShowSecond.ConcealingBabySwallow_1 then 2 else if ShowThird == ShowThird.ConcealingBabySwallow_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, ConcealingBabySwallow(), Double.NaN);
plot CBS = candleAll_1;
CBS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
CBS.SetDefaultColor(GlobalColor("BullishReversal"));
CBS.SetLineWeight(5);
CBS.HideTitle();
CBS.HideBubble();
rec ConcealingBabySwallow_Trig = if(ConcealingBabySwallow().bullish, BarNumber(), ConcealingBabySwallow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and ConcealingBabySwallow_Trig > 0, "1=ConcealingBabySwallow", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ConcealingBabySwallow(), "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and ConcealingBabySwallow(), BubPos, if BubNumb then "1" else if BubVerb then "ConcealingBabySwallow" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# Hammer_2
##### 2 ##### Hammer() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.Hammer_2 then 1 else if ShowSecond == ShowSecond.Hammer_2 then 2 else if ShowThird == ShowThird.Hammer_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, Hammer(), Double.NaN);
plot Hammer = candleAll_2;
Hammer.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Hammer.SetDefaultColor(GlobalColor("BullishReversal"));
Hammer.SetLineWeight(5);
Hammer.HideTitle();
Hammer.HideBubble();
rec Hammer_Trig = if(Hammer().bullish, BarNumber(), Hammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and Hammer_Trig > 0, "2=Hammer", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Hammer(), "Hammer", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and Hammer(), BubPos, if BubNumb then "2" else if BubVerb then "Hammer" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"), no);

# HighPriceGappingPlay_3
##### 3 ##### HighPriceGappingPlay() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.HighPriceGappingPlay_3 then 1 else if ShowSecond == ShowSecond.HighPriceGappingPlay_3 then 2 else if ShowThird == ShowThird.HighPriceGappingPlay_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, HighPriceGappingPlay(), Double.NaN);
plot AB = candleAll_3;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
AB.SetDefaultColor(GlobalColor("BullishContinuation"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec HighPriceGappingPlay_Trig = if(HighPriceGappingPlay().bullish, BarNumber(), HighPriceGappingPlay_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and HighPriceGappingPlay_Trig > 0, "3=HighPriceGappingPlay", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and HighPriceGappingPlay(), "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and HighPriceGappingPlay(), BubPos, if BubNumb then "3" else if BubVerb then "HighPriceGappingPlay" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishContinuation"), no);

# HomingPigeon_4
##### 4 ##### HomingPigeon() #####
def ThreeShows_4 = if ShowFirst == ShowFirst.HomingPigeon_4 then 1 else if ShowSecond == ShowSecond.HomingPigeon_4 then 2 else if ShowThird == ShowThird.HomingPigeon_4 then 3 else 0;
def candleAll_4 = if(ShowAll and !ThreeShows_4, HomingPigeon(), Double.NaN);
plot HP = candleAll_4;
HP.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
HP.SetDefaultColor(GlobalColor("BullishReversal"));
HP.SetLineWeight(5);
HP.HideTitle();
HP.HideBubble();
rec HomingPigeon_Trig = if(HomingPigeon().bullish, BarNumber(), HomingPigeon_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and HomingPigeon_Trig > 0, "4=HomingPigeon", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and HomingPigeon(), "HomingPigeon", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and HomingPigeon(), BubPos, if BubNumb then "4" else if BubVerb then "HomingPigeon" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"), no);

# InvertedHammer_5
##### 5 ##### InvertedHammer() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.InvertedHammer_5 then 1 else if ShowSecond == ShowSecond.InvertedHammer_5 then 2 else if ShowThird == ShowThird.InvertedHammer_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, InvertedHammer(), Double.NaN);
plot INVHammer = candleAll_5;
INVHammer.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
INVHammer.SetDefaultColor(GlobalColor("BullishReversal"));
INVHammer.SetLineWeight(5);
INVHammer.HideTitle();
INVHammer.HideBubble();
rec InvertedHammer_Trig = if(InvertedHammer().bullish, BarNumber(), InvertedHammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and InvertedHammer_Trig > 0, "5=InvertedHammer", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and InvertedHammer(), "InvertedHammer", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and InvertedHammer(), BubPos, if BubNumb then "5" else if BubVerb then "InvertedHammer" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"), no);

# MatchingLow_6
##### 6 ##### MatchingLow() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.MatchingLow_6 then 1 else if ShowSecond == ShowSecond.MatchingLow_6 then 2 else if ShowThird == ShowThird.MatchingLow_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, MatchingLow(), Double.NaN);
plot ML = candleAll_6;
ML.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
ML.SetDefaultColor(GlobalColor("BullishReversal"));
ML.SetLineWeight(5);
ML.HideTitle();
ML.HideBubble();
rec MatchingLow_Trig = if(MatchingLow().bullish, BarNumber(), MatchingLow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and MatchingLow_Trig > 0, "6=MatchingLow", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MatchingLow(), "MatchingLow", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and MatchingLow(), BubPos, if BubNumb then "6" else if BubVerb then "MatchingLow" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"), no);

# MatHold_7
##### 7 ##### MatHold() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.MatHold_7 then 1 else if ShowSecond == ShowSecond.MatHold_7 then 2 else if ShowThird == ShowThird.MatHold_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, MatHold(), Double.NaN);
plot MH = candleAll_7;
MH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MH.SetDefaultColor(GlobalColor("BullishContinuation"));
MH.SetLineWeight(5);
MH.HideTitle();
MH.HideBubble();
rec MatHold_Trig = if(MatHold().bullish, BarNumber(), MatHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and MatHold_Trig > 0, "7=MatHold", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and MatHold(), "MatHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and MatHold(), BubPos, if BubNumb then "7" else if BubVerb then "MatHold" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishContinuation"), no);

# MorningDojiStar_8
##### 8 ##### MorningDojiStar() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.MorningDojiStar_8 then 1 else if ShowSecond == ShowSecond.MorningDojiStar_8 then 2 else if ShowThird == ShowThird.MorningDojiStar_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, MorningDojiStar(), Double.NaN);
plot MDS = candleAll_8;
MDS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MDS.SetDefaultColor(GlobalColor("BullishReversal"));
MDS.SetLineWeight(5);
MDS.HideTitle();
MDS.HideBubble();
rec MorningDojiStar_Trig = if(MorningDojiStar().bullish, BarNumber(), MorningDojiStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and MorningDojiStar_Trig > 0, "8=MorningDojiStar", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MorningDojiStar(), "MorningDojiStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and MorningDojiStar(), BubPos, if BubNumb then "8" else if BubVerb then "MorningDojiStar" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"), no);

# MorningStar_9
##### 9 ##### MorningStar() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.MorningStar_9 then 1 else if ShowSecond == ShowSecond.MorningStar_9 then 2 else if ShowThird == ShowThird.MorningStar_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, MorningStar(), Double.NaN);
plot MS = candleAll_9;
MS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MS.SetDefaultColor(GlobalColor("BullishReversal"));
MS.SetLineWeight(5);
MS.HideTitle();
MS.HideBubble();
rec MorningStar_Trig = if(MorningStar().bullish, BarNumber(), MorningStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and MorningStar_Trig > 0, "9=MorningStar", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MorningStar(), "MorningStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and MorningStar(), BubPos, if BubNumb then "9" else if BubVerb then "MorningStar" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"), no);

# OneWhiteSoldier_10
##### 10 ##### OneWhiteSoldier() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.OneWhiteSoldier_10 then 1 else if ShowSecond == ShowSecond.OneWhiteSoldier_10 then 2 else if ShowThird == ShowThird.OneWhiteSoldier_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, OneWhiteSoldier(), Double.NaN);
plot OWS = candleAll_10;
OWS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
OWS.SetDefaultColor(GlobalColor("BullishReversal"));
OWS.SetLineWeight(5);
OWS.HideTitle();
OWS.HideBubble();
rec OneWhiteSoldier_Trig = if(OneWhiteSoldier().bullish, BarNumber(), OneWhiteSoldier_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and OneWhiteSoldier_Trig > 0, "10=OneWhiteSoldier", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and OneWhiteSoldier(), "OneWhiteSoldier", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and OneWhiteSoldier(), BubPos, if BubNumb then "10" else if BubVerb then "OneWhiteSoldier" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishReversal"), no);

# PiercingLine_11
##### 11 ##### PiercingLine() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.PiercingLine_11 then 1 else if ShowSecond == ShowSecond.PiercingLine_11 then 2 else if ShowThird == ShowThird.PiercingLine_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, PiercingLine(), Double.NaN);
plot PL = candleAll_11;
PL.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
PL.SetDefaultColor(GlobalColor("BullishReversal"));
PL.SetLineWeight(5);
PL.HideTitle();
PL.HideBubble();
rec PiercingLine_Trig = if(PiercingLine().bullish, BarNumber(), Hammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and Hammer_Trig > 0, "11=PiercingLine", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and PiercingLine(), "PiercingLine", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and PiercingLine(), BubPos, if BubNumb then "11" else if BubVerb then "PiercingLine" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"), no);

# RisingThreeMethods_12
##### 12 ##### RisingThreeMethods() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.RisingThreeMethods_12 then 1 else if ShowSecond == ShowSecond.RisingThreeMethods_12 then 2 else if ShowThird == ShowThird.RisingThreeMethods_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, RisingThreeMethods(), Double.NaN);
plot RTM = candleAll_12;
RTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
RTM.SetDefaultColor(GlobalColor("BullishContinuation"));
RTM.SetLineWeight(5);
RTM.HideTitle();
RTM.HideBubble();
rec RisingThreeMethods_Trig = if(RisingThreeMethods().bullish, BarNumber(), RisingThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and RisingThreeMethods_Trig > 0, "3=RisingThreeMethods", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and RisingThreeMethods(), "RisingThreeMethods", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and RisingThreeMethods(), BubPos, if BubNumb then "3" else if BubVerb then "RisingThreeMethods" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"), no);

# Sticksandwich_13
##### 13 ##### Sticksandwich() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.Sticksandwich_13 then 1 else if ShowSecond == ShowSecond.Sticksandwich_13 then 2 else if ShowThird == ShowThird.Sticksandwich_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, Sticksandwich(), Double.NaN);
plot SS = candleAll_13;
SS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SS.SetDefaultColor(GlobalColor("BullishReversal"));
SS.SetLineWeight(5);
SS.HideTitle();
SS.HideBubble();
rec Sticksandwich_Trig = if(Sticksandwich().bullish, BarNumber(), Sticksandwich_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and Sticksandwich_Trig > 0, "13=Sticksandwich", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Sticksandwich(), "Sticksandwich", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and Sticksandwich(), BubPos, if BubNumb then "13" else if BubVerb then "Sticksandwich" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeInsideUp_14
##### 14 ##### ThreeInsideUp() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeInsideUp_14 then 1 else if ShowSecond == ShowSecond.ThreeInsideUp_14 then 2 else if ShowThird == ShowThird.ThreeInsideUp_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeInsideUp(), Double.NaN);
plot TIU = candleAll_14;
TIU.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TIU.SetDefaultColor(GlobalColor("BullishReversal"));
TIU.SetLineWeight(5);
TIU.HideTitle();
TIU.HideBubble();
rec ThreeInsideUp_Trig = if(ThreeInsideUp().bullish, BarNumber(), ThreeInsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeInsideUp_Trig > 0, "14=ThreeInsideUp", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeInsideUp(), "ThreeInsideUp", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeInsideUp(), BubPos, if BubNumb then "14" else if BubVerb then "ThreeInsideUp" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeOutsideUp_15
##### 15 ##### ThreeOutsideUp() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.ThreeOutsideUp_15 then 1 else if ShowSecond == ShowSecond.ThreeOutsideUp_15 then 2 else if ShowThird == ShowThird.ThreeOutsideUp_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, ThreeOutsideUp(), Double.NaN);
plot TOU = candleAll_15;
TOU.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TOU.SetDefaultColor(GlobalColor("BullishReversal"));
TOU.SetLineWeight(5);
TOU.HideTitle();
TOU.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeOutsideUp().bullish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and ThreeOutsideUp_Trig > 0, "15=ThreeOutsideUp", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeOutsideUp(), "ThreeOutsideUp", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and ThreeOutsideUp(), BubPos, if BubNumb then "15" else if BubVerb then "ThreeOutsideUp" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeStarsInTheSouth_16
##### 16 ##### ThreeStarsInTheSouth() #####
def ThreeShows_16 = if ShowFirst == ShowFirst.ThreeStarsInTheSouth_16 then 1 else if ShowSecond == ShowSecond.ThreeStarsInTheSouth_16 then 2 else if ShowThird == ShowThird.ThreeStarsInTheSouth_16 then 3 else 0;
def candleAll_16 = if(ShowAll and !ThreeShows_16, ThreeStarsInTheSouth(), Double.NaN);
plot TSITS = candleAll_16;
TSITS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TSITS.SetDefaultColor(GlobalColor("BullishReversal"));
TSITS.SetLineWeight(5);
TSITS.HideTitle();
TSITS.HideBubble();
rec ThreeStarsInTheSouth_Trig = if(ThreeStarsInTheSouth().bullish, BarNumber(), ThreeStarsInTheSouth_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and ThreeStarsInTheSouth_Trig > 0, "16=ThreeStarsInTheSouth", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeStarsInTheSouth(), "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and ThreeStarsInTheSouth(), BubPos, if BubNumb then "16" else if BubVerb then "ThreeStarsInTheSouth" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeWhiteSoldiers_17
##### 17 ##### ThreeWhiteSoldiers() #####
def ThreeShows_17 = if ShowFirst == ShowFirst.ThreeWhiteSoldiers_17 then 1 else if ShowSecond == ShowSecond.ThreeWhiteSoldiers_17 then 2 else if ShowThird == ShowThird.ThreeWhiteSoldiers_17 then 3 else 0;
def candleAll_17 = if(ShowAll and !ThreeShows_17, ThreeWhiteSoldiers(), Double.NaN);
plot TWS = candleAll_17;
TWS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TWS.SetDefaultColor(GlobalColor("BullishReversal"));
TWS.SetLineWeight(5);
TWS.HideTitle();
TWS.HideBubble();
rec ThreeWhiteSoldiers_Trig = if(ThreeWhiteSoldiers().bullish, BarNumber(), ThreeWhiteSoldiers_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ThreeWhiteSoldiers_Trig > 0, "17=ThreeWhiteSoldiers", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeWhiteSoldiers(), "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ThreeWhiteSoldiers(), BubPos, if BubNumb then "17" else if BubVerb then "ThreeWhiteSoldiers" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"), no);

# UniqueThreeRiverBottom_18
##### 18 ##### UniqueThreeRiverBottom() #####
def ThreeShows_18 = if ShowFirst == ShowFirst.UniqueThreeRiverBottom_18 then 1 else if ShowSecond == ShowSecond.UniqueThreeRiverBottom_18 then 2 else if ShowThird == ShowThird.UniqueThreeRiverBottom_18 then 3 else 0;
def candleAll_18 = if(ShowAll and !ThreeShows_18, UniqueThreeRiverBottom(), Double.NaN);
plot UTRB = candleAll_18;
UTRB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UTRB.SetDefaultColor(GlobalColor("BullishReversal"));
UTRB.SetLineWeight(5);
UTRB.HideTitle();
UTRB.HideBubble();
rec UniqueThreeRiverBottom_Trig = if(UniqueThreeRiverBottom().bullish, BarNumber(), UniqueThreeRiverBottom_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_18) and UniqueThreeRiverBottom_Trig > 0, "18=UniqueThreeRiverBottom", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and UniqueThreeRiverBottom(), "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and UniqueThreeRiverBottom(), BubPos, if BubNumb then "18" else if BubVerb then "UniqueThreeRiverBottom" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# UpsideGapThreeMethods_19
##### 19 ##### UpsideGapThreeMethods() #####
def ThreeShows_19 = if ShowFirst == ShowFirst.UpsideGapThreeMethods_19 then 1 else if ShowSecond == ShowSecond.UpsideGapThreeMethods_19 then 2 else if ShowThird == ShowThird.UpsideGapThreeMethods_19 then 3 else 0;
def candleAll_19 = if(ShowAll and !ThreeShows_19, UpsideGapThreeMethods(), Double.NaN);
plot UGTM = candleAll_19;
UGTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UGTM.SetDefaultColor(GlobalColor("BullishContinuation"));
UGTM.SetLineWeight(5);
UGTM.HideTitle();
UGTM.HideBubble();
rec UpsideGapThreeMethods_Trig = if(UpsideGapThreeMethods().bullish, BarNumber(), UpsideGapThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_19) and UpsideGapThreeMethods_Trig > 0, "19=UpsideGapThreeMethods", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and UpsideGapThreeMethods(), "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_19) and UpsideGapThreeMethods(), BubPos, if BubNumb then "19" else if BubVerb then "UpsideGapThreeMethods" else "", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BullishContinuation"), no);

# UpsideTasukiGap_20
##### 20 ##### UpsideTasukiGap() #####
def ThreeShows_20 = if ShowFirst == ShowFirst.UpsideTasukiGap_20 then 1 else if ShowSecond == ShowSecond.UpsideTasukiGap_20 then 2 else if ShowThird == ShowThird.UpsideTasukiGap_20 then 3 else 0;
def candleAll_20 = if(ShowAll and !ThreeShows_20, UpsideTasukiGap().bullish, Double.NaN);
plot UTG = candleAll_20;
UTG.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UTG.SetDefaultColor(GlobalColor("BullishContinuation"));
UTG.SetLineWeight(5);
UTG.HideTitle();
UTG.HideBubble();
rec UpsideTasukiGap_Trig = if(UpsideTasukiGap().bullish, BarNumber(), UpsideTasukiGap_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_20) and UpsideTasukiGap_Trig > 0, "20=UpsideTasukiGap", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and UpsideTasukiGap(), "UpsideTasukiGap", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_20) and UpsideTasukiGap(), BubPos, if BubNumb then "20" else if BubVerb then "UpsideTasukiGap" else "", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BullishContinuation"), no);

# End Code

Bearish_Patterns_Only http://tos.mx/!oNPt2yI8
Bearish_Patterns_Only.png

Code:
# Bearish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bearish_Patterns_Only: Plots and identifies all 21 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

DefineGlobalColor("BearishReversal",     CreateColor(230, 104, 104));
#DefineGlobalColor("BullishReversal",     CreateColor(104, 230, 104));
DefineGlobalColor("BearishContinuation", CreateColor(255, 174, 174));
#DefineGlobalColor("BullishContinuation", CreateColor(174, 255, 174));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bearish Only Reversals", GlobalColor("BearishReversal"));
AddLabel(ShowMainLabel, "Bearish Only Continuations: 4, 5, 8, 11, 12, 14, 19", GlobalColor("BearishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint ShowBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, high, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AdvanceBlock_1:
    candle1 = if(ShowFirst.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle1 = if(ShowFirst.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle1 = if(ShowFirst.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle1 = if(ShowFirst.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle1 = if(ShowFirst.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle1 = if(ShowFirst.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle1 = if(ShowFirst.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle1 = if(ShowFirst.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle1 = if(ShowFirst.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle1 = if(ShowFirst.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle1 = if(ShowFirst.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle1 = if(ShowFirst.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle1 = if(ShowFirst.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle1 = if(ShowFirst.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle1 = if(ShowFirst.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle1 = if(ShowFirst.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle1 = if(ShowFirst.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle1 = if(ShowFirst.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle1 = if(ShowFirst.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle1 = if(ShowFirst.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle1 = if(ShowFirst.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle1 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum #############
#########################################################

def candle2;
switch (ShowSecond) {
case AdvanceBlock_1:
    candle2 = if(ShowSecond.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle2 = if(ShowSecond.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle2 = if(ShowSecond.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle2 = if(ShowSecond.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle2 = if(ShowSecond.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle2 = if(ShowSecond.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle2 = if(ShowSecond.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle2 = if(ShowSecond.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle2 = if(ShowSecond.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle2 = if(ShowSecond.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle2 = if(ShowSecond.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle2 = if(ShowSecond.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle2 = if(ShowSecond.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle2 = if(ShowSecond.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle2 = if(ShowSecond.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle2 = if(ShowSecond.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle2 = if(ShowSecond.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle2 = if(ShowSecond.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle2 = if(ShowSecond.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle2 = if(ShowSecond.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle2 = if(ShowSecond.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AdvanceBlock_1:
    candle3 = if(ShowThird.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle3 = if(ShowThird.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle3 = if(ShowThird.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle3 = if(ShowThird.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle3 = if(ShowThird.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle3 = if(ShowThird.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle3 = if(ShowThird.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle3 = if(ShowThird.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle3 = if(ShowThird.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle3 = if(ShowThird.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle3 = if(ShowThird.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle3 = if(ShowThird.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle3 = if(ShowThird.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle3 = if(ShowThird.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle3 = if(ShowThird.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle3 = if(ShowThird.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle3 = if(ShowThird.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle3 = if(ShowThird.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle3 = if(ShowThird.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle3 = if(ShowThird.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle3 = if(ShowThird.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# AdvanceBlock_1
##### 1 ##### AdvanceBlock() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AdvanceBlock_1 then 1 else if ShowSecond == ShowSecond.AdvanceBlock_1 then 2 else if ShowThird == ShowThird.AdvanceBlock_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AdvanceBlock(), Double.NaN);
plot AdvBlk = candleAll_1;
AdvBlk.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
AdvBlk.SetDefaultColor(GlobalColor("BearishReversal"));
AdvBlk.SetLineWeight(5);
AdvBlk.HideTitle();
AdvBlk.HideBubble();
rec AdvancedB_Trig = if(AdvanceBlock().bearish, BarNumber(), AdvancedB_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AdvancedB_Trig > 0, "1=AdvanceBlock", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and AdvanceBlock(), "AdvanceBlockAlert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AdvanceBlock(), BubPos, if BubNumb then "1" else if BubVerb then "AdvanceBlock" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"), yes);

# DarkcloudCover_2
##### 2 ##### DarkCloudCover() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.DarkCloudCover_2 then 1 else if ShowSecond == ShowSecond.DarkCloudCover_2 then 2 else if ShowThird == ShowThird.DarkCloudCover_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, DarkCloudCover(), Double.NaN);
plot DCC = candleAll_2;
DCC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DCC.SetDefaultColor(GlobalColor("BearishReversal"));
DCC.SetLineWeight(5);
DCC.HideTitle();
DCC.HideBubble();
rec DarkCloudCover_Trig = if(DarkCloudCover().bearish, BarNumber(), DarkCloudCover_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and DarkCloudCover_Trig > 0, "2=DarkCloudCover", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and DarkCloudCover(), "DarkCloudCover Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and DarkCloudCover(), BubPos, if BubNumb then "2" else if BubVerb then "DarkCloudCover" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"), yes);

# Deliberation_3
##### 3 ##### Deliberation() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Deliberation_3 then 1 else if ShowSecond == ShowSecond.Deliberation_3 then 2 else if ShowThird == ShowThird.Deliberation_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Deliberation(), Double.NaN);
plot Delib = candleAll_3;
Delib.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Delib.SetDefaultColor(GlobalColor("BearishReversal"));
Delib.SetLineWeight(5);
Delib.HideTitle();
Delib.HideBubble();
rec Deliberation_Trig = if(Deliberation().bearish, BarNumber(), Deliberation_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Deliberation_Trig > 0, "3=Deliberation", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Deliberation(), "Deliberation Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Deliberation(), BubPos, if BubNumb then "3" else if BubVerb then "Deliberation" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"), yes);

# DownsideGapThreeMethods_4
##### 4 ##### DownsideGapThreeMethods() #####
def ThreeShows_4 = if ShowFirst == ShowFirst.DownsideGapThreeMethods_4 then 1 else if ShowSecond == ShowSecond.DownsideGapThreeMethods_4 then 2 else if ShowThird == ShowThird.DownsideGapThreeMethods_4 then 3 else 0;
def candleAll_4 = if(ShowAll and !ThreeShows_4, DownsideGapThreeMethods(), Double.NaN);
plot DGTM = candleAll_4;
DGTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DGTM.SetDefaultColor(GlobalColor("BearishContinuation"));
DGTM.SetLineWeight(5);
DGTM.HideTitle();
DGTM.HideBubble();
rec DownsideGapThreeMethods_Trig = if(DownsideGapThreeMethods().bearish, BarNumber(), DownsideGapThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and DownsideGapThreeMethods_Trig > 0, "4=DownsideGapThreeMethods", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and DownsideGapThreeMethods(), "DownsideGapThreeMethods Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and DownsideGapThreeMethods(), BubPos, if BubNumb then "4" else if BubVerb then "DownsideGapThreeMethods" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BearishContinuation"), yes);

# DownsideTasukiGap_5
##### 5 ##### DownsideTasukiGap() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.DownsideTasukiGap_5 then 1 else if ShowSecond == ShowSecond.DownsideTasukiGap_5 then 2 else if ShowThird == ShowThird.DownsideTasukiGap_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, DownsideTasukiGap(), Double.NaN);
plot DTG = candleAll_5;
DTG.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DTG.SetDefaultColor(GlobalColor("BearishContinuation"));
DTG.SetLineWeight(5);
DTG.HideTitle();
DTG.HideBubble();
rec DownsideTasukiGap_Trig = if(DownsideTasukiGap().bearish, BarNumber(), DownsideTasukiGap_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and DownsideTasukiGap_Trig > 0, "5=DownsideTasukiGap", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and DownsideTasukiGap(), "DownsideTasukiGap Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and DownsideTasukiGap(), BubPos, if BubNumb then "5" else if BubVerb then "DownsideTasukiGap" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishContinuation"), yes);

# EveningDojiStar_6
##### 6 ##### EveningDojiStar() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.EveningDojiStar_6 then 1 else if ShowSecond == ShowSecond.EveningDojiStar_6 then 2 else if ShowThird == ShowThird.EveningDojiStar_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, EveningDojiStar(), Double.NaN);
plot EDS = candleAll_6;
EDS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
EDS.SetDefaultColor(GlobalColor("BearishReversal"));
EDS.SetLineWeight(5);
EDS.HideTitle();
EDS.HideBubble();
rec EveningDojiStar_Trig = if(EveningDojiStar().bearish, BarNumber(), EveningDojiStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and EveningDojiStar_Trig > 0, "6=EveningDojiStar", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and EveningDojiStar(), "EveningDojiStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and EveningDojiStar(), BubPos, if BubNumb then "6" else if BubVerb then "EveningDojiStar" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"), yes);

# EveningStar_7
##### 7 ##### EveningStar() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.EveningStar_7 then 1 else if ShowSecond == ShowSecond.EveningStar_7 then 2 else if ShowThird == ShowThird.EveningStar_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, EveningStar(), Double.NaN);
plot ES = candleAll_7;
ES.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ES.SetDefaultColor(GlobalColor("BearishReversal"));
ES.SetLineWeight(5);
ES.HideTitle();
ES.HideBubble();
rec EveningStar_Trig = if(EveningStar().bearish, BarNumber(), EveningStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and EveningStar_Trig > 0, "7=EveningStar", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and EveningStar(), "EveningStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and EveningStar(), BubPos, if BubNumb then "7" else if BubVerb then "EveningStar" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"), yes);

# FallingThreeMethods_8
##### 8 ##### FallingThreeMethods() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.FallingThreeMethods_8 then 1 else if ShowSecond == ShowSecond.FallingThreeMethods_8 then 2 else if ShowThird == ShowThird.FallingThreeMethods_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, FallingThreeMethods(), Double.NaN);
plot FTM = candleAll_8;
FTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
FTM.SetDefaultColor(GlobalColor("BearishContinuation"));
FTM.SetLineWeight(5);
FTM.HideTitle();
FTM.HideBubble();
rec FallingThreeMethods_Trig = if(FallingThreeMethods().bearish, BarNumber(), FallingThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and FallingThreeMethods_Trig > 0, "8=FallingThreeMethods", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and FallingThreeMethods(), "FallingThreeMethods Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and FallingThreeMethods(), BubPos, if BubNumb then "8" else if BubVerb then "FallingThreeMethods" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishContinuation"), yes);

# HangingMan_9
##### 9 ##### HangingMan() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.HangingMan_9 then 1 else if ShowSecond == ShowSecond.HangingMan_9 then 2 else if ShowThird == ShowThird.HangingMan_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, HangingMan(), Double.NaN);
plot HM = candleAll_9;
HM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
HM.SetDefaultColor(GlobalColor("BearishReversal"));
HM.SetLineWeight(5);
HM.HideTitle();
HM.HideBubble();
rec HangingMan_Trig = if(HangingMan().bearish, BarNumber(), HangingMan_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and HangingMan_Trig > 0, "9=HangingMan", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and HangingMan(), "HangingMan Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and HangingMan(), BubPos, if BubNumb then "9" else if BubVerb then "HangingMan" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"), yes);

# IdenticalThreeCrows_10
##### 10 ##### IdenticalThreeCrows() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.IdenticalThreeCrows_10 then 1 else if ShowSecond == ShowSecond.IdenticalThreeCrows_10 then 2 else if ShowThird == ShowThird.IdenticalThreeCrows_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, IdenticalThreeCrows(), Double.NaN);
plot ITC = candleAll_10;
ITC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ITC.SetDefaultColor(GlobalColor("BearishReversal"));
ITC.SetLineWeight(5);
ITC.HideTitle();
ITC.HideBubble();
rec IdenticalThreeCrows_Trig = if(IdenticalThreeCrows().bearish, BarNumber(), IdenticalThreeCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and IdenticalThreeCrows_Trig > 0, "10=IdenticalThreeCrows", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and IdenticalThreeCrows(), "IdenticalThreeCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and IdenticalThreeCrows(), BubPos, if BubNumb then "10" else if BubVerb then "IdenticalThreeCrows" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishReversal"), yes);

# InNeck_11
##### 11 ##### InNeck() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.InNeck_11 then 1 else if ShowSecond == ShowSecond.InNeck_11 then 2 else if ShowThird == ShowThird.InNeck_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, InNeck(), Double.NaN);
plot IN = candleAll_11;
IN.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
IN.SetDefaultColor(GlobalColor("BearishContinuation"));
IN.SetLineWeight(5);
IN.HideTitle();
IN.HideBubble();
rec InNeck_Trig = if(InNeck().bearish, BarNumber(), InNeck_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and InNeck_Trig > 0, "11=InNeck", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and InNeck(), "InNeck Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and InNeck(), BubPos, if BubNumb then "11" else if BubVerb then "InNeck" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishContinuation"), yes);

# LowPriceGappingPlay_12
##### 12 ##### LowPriceGappingPlay() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.LowPriceGappingPlay_12 then 1 else if ShowSecond == ShowSecond.LowPriceGappingPlay_12 then 2 else if ShowThird == ShowThird.LowPriceGappingPlay_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, LowPriceGappingPlay(), Double.NaN);
plot LPGP = candleAll_12;
LPGP.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
LPGP.SetDefaultColor(GlobalColor("BearishContinuation"));
LPGP.SetLineWeight(5);
LPGP.HideTitle();
LPGP.HideBubble();
rec LowPriceGappingPlay_Trig = if(LowPriceGappingPlay().bearish, BarNumber(), LowPriceGappingPlay_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and LowPriceGappingPlay_Trig > 0, "12=LowPriceGappingPlay", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and LowPriceGappingPlay(), "LowPriceGappingPlay Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and LowPriceGappingPlay(), BubPos, if BubNumb then "12" else if BubVerb then "LowPriceGappingPlay" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"), yes);

# OneBlackCrow_13
##### 13 ##### OneBlackCrow() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.OneBlackCrow_13 then 1 else if ShowSecond == ShowSecond.OneBlackCrow_13 then 2 else if ShowThird == ShowThird.OneBlackCrow_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, OneBlackCrow(), Double.NaN);
plot OBC = candleAll_13;
OBC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
OBC.SetDefaultColor(GlobalColor("BearishReversal"));
OBC.SetLineWeight(5);
OBC.HideTitle();
OBC.HideBubble();
rec OneBlackCrow_Trig = if(OneBlackCrow().bearish, BarNumber(), OneBlackCrow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and OneBlackCrow_Trig > 0, "13=OneBlackCrow", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and OneBlackCrow(), "OneBlackCrow Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and OneBlackCrow(), BubPos, if BubNumb then "13" else if BubVerb then "OneBlackCrow" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishReversal"), yes);

# OnNeck_14
##### 14 ##### OnNeck() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.OnNeck_14 then 1 else if ShowSecond == ShowSecond.OnNeck_14 then 2 else if ShowThird == ShowThird.OnNeck_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, OnNeck(), Double.NaN);
plot ON = candleAll_14;
ON.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ON.SetDefaultColor(GlobalColor("BearishContinuation"));
ON.SetLineWeight(5);
ON.HideTitle();
ON.HideBubble();
rec OnNeck_Trig = if(OnNeck().bearish, BarNumber(), OnNeck_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and OnNeck_Trig > 0, "14=OnNeck", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and OnNeck(), "OnNeck Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and OnNeck(), BubPos, if BubNumb then "14" else if BubVerb then "OnNeck" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"), yes);

# ShootingStar_15
##### 15 ##### ShootingStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.ShootingStar_15 then 1 else if ShowSecond == ShowSecond.ShootingStar_15 then 2 else if ShowThird == ShowThird.ShootingStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, ShootingStar(), Double.NaN);
plot SS = candleAll_15;
SS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SS.SetDefaultColor(GlobalColor("BearishReversal"));
SS.SetLineWeight(5);
SS.HideTitle();
SS.HideBubble();
rec ShootingStar_Trig = if(ShootingStar().bearish, BarNumber(), ShootingStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and ShootingStar_Trig > 0, "15=ShootingStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ShootingStar(), "ShootingStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and ShootingStar(), BubPos, if BubNumb then "15" else if BubVerb then "ShootingStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeBlackCrows_16
##### 16 ##### ThreeBlackCrows() #####
def ThreeShows_16 = if ShowFirst == ShowFirst.ThreeBlackCrows_16 then 1 else if ShowSecond == ShowSecond.ThreeBlackCrows_16 then 2 else if ShowThird == ShowThird.ThreeBlackCrows_16 then 3 else 0;
def candleAll_16 = if(ShowAll and !ThreeShows_16, ThreeBlackCrows(), Double.NaN);
plot TBC = candleAll_16;
TBC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TBC.SetDefaultColor(GlobalColor("BearishReversal"));
TBC.SetLineWeight(5);
TBC.HideTitle();
TBC.HideBubble();
rec ThreeBlackCrows_Trig = if(ThreeBlackCrows().bearish, BarNumber(), ThreeBlackCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and ThreeBlackCrows_Trig > 0, "16=ThreeBlackCrows", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeBlackCrows(), "ThreeBlackCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and ThreeBlackCrows(), BubPos, if BubNumb then "16" else if BubVerb then "ThreeBlackCrows" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeInsideDown_17
##### 17 ##### ThreeInsideDown() #####
def ThreeShows_17 = if ShowFirst == ShowFirst.ThreeInsideDown_17 then 1 else if ShowSecond == ShowSecond.ThreeInsideDown_17 then 2 else if ShowThird == ShowThird.ThreeInsideDown_17 then 3 else 0;
def candleAll_17 = if(ShowAll and !ThreeShows_17, ThreeInsideDown(), Double.NaN);
plot TID = candleAll_17;
TID.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TID.SetDefaultColor(GlobalColor("BearishReversal"));
TID.SetLineWeight(5);
TID.HideTitle();
TID.HideBubble();
rec ThreeInsideDown_Trig = if(DarkCloudCover().bearish, BarNumber(), ThreeInsideDown_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ThreeInsideDown_Trig > 0, "17=ThreeInsideDown", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeInsideDown(), "ThreeInsideDown Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ThreeInsideDown(), BubPos, if BubNumb then "17" else if BubVerb then "ThreeInsideDown" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeOutsideDown_18
##### 18 ##### ThreeOutsideDown() #####
def ThreeShows_18 = if ShowFirst == ShowFirst.ThreeOutsideDown_18 then 1 else if ShowSecond == ShowSecond.ThreeOutsideDown_18 then 2 else if ShowThird == ShowThird.ThreeOutsideDown_18 then 3 else 0;
def candleAll_18 = if(ShowAll and !ThreeShows_18, ThreeOutsideDown(), Double.NaN);
plot TOD = candleAll_18;
TOD.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TOD.SetDefaultColor(GlobalColor("BearishReversal"));
TOD.SetLineWeight(5);
TOD.HideTitle();
TOD.HideBubble();
rec ThreeOutsideDown_Trig = if(DarkCloudCover().bearish, BarNumber(), ThreeOutsideDown_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_18) and ThreeOutsideDown_Trig > 0, "18=ThreeOutsideDown", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeOutsideDown(), "ThreeOutsideDown Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_18) and ThreeOutsideDown(), BubPos, if BubNumb then "18" else if BubVerb then "ThreeOutsideDown" else "", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BearishReversal"), yes);

# Thrusting_19
##### 19 ##### Thrusting() #####
def ThreeShows_19 = if ShowFirst == ShowFirst.Thrusting_19 then 1 else if ShowSecond == ShowSecond.Thrusting_19 then 2 else if ShowThird == ShowThird.Thrusting_19 then 3 else 0;
def candleAll_19 = if(ShowAll and !ThreeShows_19, Thrusting(), Double.NaN);
plot Thrust = candleAll_19;
Thrust.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Thrust.SetDefaultColor(GlobalColor("BearishContinuation"));
Thrust.SetLineWeight(5);
Thrust.HideTitle();
Thrust.HideBubble();
rec Thrusting_Trig = if(DarkCloudCover().bearish, BarNumber(), Thrusting_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_19) and Thrusting_Trig > 0, "19=Thrusting", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and Thrusting(), "Thrusting Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_19) and Thrusting(), BubPos, if BubNumb then "19" else if BubVerb then "Thrusting" else "", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BearishContinuation"), yes);

# TwoCrows_20
##### 20 ##### TwoCrows() #####
def ThreeShows_20 = if ShowFirst == ShowFirst.TwoCrows_20 then 1 else if ShowSecond == ShowSecond.TwoCrows_20 then 2 else if ShowThird == ShowThird.TwoCrows_20 then 3 else 0;
def candleAll_20 = if(ShowAll and !ThreeShows_20, TwoCrows(), Double.NaN);
plot TC = candleAll_20;
TC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TC.SetDefaultColor(GlobalColor("BearishReversal"));
TC.SetLineWeight(5);
TC.HideTitle();
TC.HideBubble();
rec TwoCrows_Trig = if(TwoCrows().bearish, BarNumber(), TwoCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_20) and TwoCrows_Trig > 0, "20=TwoCrows", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and TwoCrows(), "TwoCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_20) and TwoCrows(), BubPos, if BubNumb then "20" else if BubVerb then "TwoCrows" else "", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BearishReversal"), yes);

# UpsideGapTwoCrows_21
##### 21 ##### UpsideGapTwoCrows() #####
def ThreeShows_21 = if ShowFirst == ShowFirst.UpsideGapTwoCrows_21 then 1 else if ShowSecond == ShowSecond.UpsideGapTwoCrows_21 then 2 else if ShowThird == ShowThird.UpsideGapTwoCrows_21 then 3 else 0;
def candleAll_21 = if(ShowAll and !ThreeShows_21, UpsideGapTwoCrows(), Double.NaN);
plot UGTC = candleAll_21;
UGTC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
UGTC.SetDefaultColor(GlobalColor("BearishReversal"));
UGTC.SetLineWeight(5);
UGTC.HideTitle();
UGTC.HideBubble();
rec UpsideGapTwoCrows_Trig = if(DarkCloudCover().bearish, BarNumber(), UpsideGapTwoCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_21) and UpsideGapTwoCrows_Trig > 0, "21=UpsideGapTwoCrows", GlobalColor(if ThreeShows_21 == 1 then "Show1st" else if ThreeShows_21 == 2 then "Show2nd" else if ThreeShows_21 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and UpsideGapTwoCrows(), "UpsideGapTwoCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_21) and UpsideGapTwoCrows(), BubPos, if BubNumb then "21" else if BubVerb then "UpsideGapTwoCrows" else "", GlobalColor(if ThreeShows_21 == 1 then "Show1st" else if ThreeShows_21 == 2 then "Show2nd" else if ThreeShows_21 == 3 then "Show3rd" else "BearishReversal"), yes);

# End Code

Bullish_AND_Bearish_Bullish_Patterns_Only http://tos.mx/!NSGfbucB
Bullish_AND_Bearish_Bullish_Patterns_Only.png

Code:
# Bullish_AND_Bearish_Bullish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bullish_AND_Bearish_Bullish_Patterns_Only: Plots and identifies all 17 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#shows all bullish Only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bull. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

#DefineGlobalColor("BearishReversal",     CreateColor(230, 154,   0));
DefineGlobalColor("BullishReversal",     CreateColor(  0, 154, 230));
#DefineGlobalColor("BearishContinuation", CreateColor(255, 211,  77));
DefineGlobalColor("BullishContinuation", CreateColor( 77, 211, 255));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bull & Bear Bullish Only Reversals", GlobalColor("BullishReversal"));
AddLabel(ShowMainLabel, "Bull & Bear Bullish Only Continuations: 10, 12, 13, 14", GlobalColor("BullishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number}; #Hint showBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, low, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AbandonedBaby_1:
    candle1 = if(ShowFirst.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle1 = if(ShowFirst.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle1 = if(ShowFirst.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle1 = if(ShowFirst.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle1 = if(ShowFirst.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle1 = if(ShowFirst.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle1 = if(ShowFirst.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle1 = if(ShowFirst.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle1 = if(ShowFirst.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle1 = if(ShowFirst.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle1 = if(ShowFirst.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle1 = if(ShowFirst.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle1 = if(ShowFirst.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle1 = if(ShowFirst.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle1 = if(ShowFirst.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle1 = if(ShowFirst.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle1 = if(ShowFirst.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case AbandonedBaby_1:
    candle2 = if(ShowSecond.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle2 = if(ShowSecond.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle2 = if(ShowSecond.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle2 = if(ShowSecond.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle2 = if(ShowSecond.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle2 = if(ShowSecond.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle2 = if(ShowSecond.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle2 = if(ShowSecond.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle2 = if(ShowSecond.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle2 = if(ShowSecond.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle2 = if(ShowSecond.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle2 = if(ShowSecond.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle2 = if(ShowSecond.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle2 = if(ShowSecond.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle2 = if(ShowSecond.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle2 = if(ShowSecond.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle2 = if(ShowSecond.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AbandonedBaby_1:
    candle3 = if(ShowThird.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);   # edited in .bull.need to do this  for.bearish for all
case BeltHold_2:
    candle3 = if(ShowThird.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle3 = if(ShowThird.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle3 = if(ShowThird.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle3 = if(ShowThird.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle3 = if(ShowThird.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle3 = if(ShowThird.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle3 = if(ShowThird.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle3 = if(ShowThird.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle3 = if(ShowThird.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle3 = if(ShowThird.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle3 = if(ShowThird.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle3 = if(ShowThird.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle3 = if(ShowThird.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle3 = if(ShowThird.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle3 = if(ShowThird.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle3 = if(ShowThird.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# AbandonedBaby_1
##### 1 ##### AbandonedBaby() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AbandonedBaby_1 then 1 else if ShowSecond == ShowSecond.AbandonedBaby_1 then 2 else if ShowThird == ShowThird.AbandonedBaby_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AbandonedBaby().bullish, Double.NaN);
plot AB = candleAll_1;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
AB.SetDefaultColor(GlobalColor("BullishReversal"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec AbandonedBaby_Trig = if(AbandonedBaby().bullish, BarNumber(), AbandonedBaby_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AbandonedBaby_Trig > 0, "1=AbandonedBaby", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and AbandonedBaby().bullish, "AbandonedBaby", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AbandonedBaby().bullish, BubPos, if BubNumb then "1" else if BubVerb then "AbandonedBaby" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# BeltHold_2
##### 2 ##### BeltHold() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.BeltHold_2 then 1 else if ShowSecond == ShowSecond.BeltHold_2 then 2 else if ShowThird == ShowThird.BeltHold_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, BeltHold().bullish, Double.NaN);
plot BH = candleAll_2;
BH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
BH.SetDefaultColor(GlobalColor("BullishReversal"));
BH.SetLineWeight(5);
BH.HideTitle();
BH.HideBubble();
rec BeltHold_Trig = if(BeltHold().bullish, BarNumber(), BeltHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and BeltHold_Trig > 0, "2=BeltHold", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and BeltHold().bullish, "BeltHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and BeltHold().bullish, BubPos, if BubNumb then "2" else if BubVerb then "BeltHold" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"), no);

# Breakaway_3
##### 3 ##### Breakaway() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Breakaway_3 then 1 else if ShowSecond == ShowSecond.Breakaway_3 then 2 else if ShowThird == ShowThird.Breakaway_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Breakaway().bullish, Double.NaN);
plot BAWAY = candleAll_3;
BAWAY.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
BAWAY.SetDefaultColor(GlobalColor("BullishReversal"));
BAWAY.SetLineWeight(5);
BAWAY.HideTitle();
BAWAY.HideBubble();
rec Breakaway_Trig = if(Breakaway().bullish, BarNumber(), Breakaway_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Breakaway_Trig > 0, "3=Breakaway", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Breakaway().bullish, "Breakaway", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Breakaway(), BubPos, if BubNumb then "3" else if BubVerb then "Breakaway" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishReversal"), no);

# Doji_4
##### 4 ##### Doji() #####
#def ThreeShows_4 = if ShowFirst == ShowFirst.Doji_4 then 1 else if ShowSecond == ShowSecond.Doji_4 then 2 else if ShowThird == ShowThird.Doji_4 then 3 else 0;
#def candleAll_4 = if(ShowAll and !ThreeShows_4, Doji(), Double.NaN);
#plot DOJI = candleAll_4;
#DOJI.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#DOJI.HideTitle();
#DOJI.HideBubble();
#rec Doji_Trig = if(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and Doji_Trig > 0, "4=Doji", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and Doji(), "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and Doji(), BubPos, if BubNumb then "4" else if BubVerb then "Doji" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"), no);

# Engulfing_5
##### 5 ##### Engulfing() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.Engulfing_5 then 1 else if ShowSecond == ShowSecond.Engulfing_5 then 2 else if ShowThird == ShowThird.Engulfing_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, Engulfing().bullish, Double.NaN);
plot Engulfing = candleAll_5;
Engulfing.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Engulfing.SetDefaultColor(GlobalColor("BullishReversal"));
Engulfing.SetLineWeight(5);
Engulfing.HideTitle();
Engulfing.HideBubble();
rec Engulfing_Trig = if(Engulfing().bullish, BarNumber(), Engulfing_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and Engulfing_Trig > 0, "5=Engulfing", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Engulfing().bullish, "Engulfing", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and Engulfing().bullish, BubPos, if BubNumb then "5" else if BubVerb then "Engulfing" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"), no);

# Harami_6
##### 6 ##### Harami() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.Harami_6 then 1 else if ShowSecond == ShowSecond.Harami_6 then 2 else if ShowThird == ShowThird.Harami_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, Harami().bullish, Double.NaN);
plot Harami = candleAll_6;
Harami.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Harami.SetDefaultColor(GlobalColor("BullishReversal"));
Harami.SetLineWeight(5);
Harami.HideTitle();
Harami.HideBubble();
rec Harami_Trig = if(Harami().bullish, BarNumber(), Harami_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and Harami_Trig > 0, "6=Harami", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Harami().bullish, "Harami", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and Harami().bullish, BubPos, if BubNumb then "6" else if BubVerb then "Harami" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"), no);

# HaramiCross_7
##### 7 ##### HaramiCross() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.HaramiCross_7 then 1 else if ShowSecond == ShowSecond.HaramiCross_7 then 2 else if ShowThird == ShowThird.HaramiCross_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, HaramiCross().bullish, Double.NaN);
plot HaramiCross = candleAll_7;
HaramiCross.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
HaramiCross.SetDefaultColor(GlobalColor("BullishReversal"));
HaramiCross.SetLineWeight(5);
HaramiCross.HideTitle();
HaramiCross.HideBubble();
rec HaramiCross_Trig = if(HaramiCross().bullish, BarNumber(), HaramiCross_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and HaramiCross_Trig > 0, "7=HaramiCross", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and HaramiCross().bullish, "HaramiCross", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and HaramiCross().bullish, BubPos, if BubNumb then "7" else if BubVerb then "HaramiCross" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishReversal"), no);

# Kicking_8
##### 8 ##### BeltHold() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.Kicking_8 then 1 else if ShowSecond == ShowSecond.Kicking_8 then 2 else if ShowThird == ShowThird.Kicking_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, Kicking().bullish, Double.NaN);
plot Kicking = candleAll_8;
Kicking.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Kicking.SetDefaultColor(GlobalColor("BullishReversal"));
Kicking.SetLineWeight(5);
Kicking.HideTitle();
Kicking.HideBubble();
rec Kicking_Trig = if(Kicking().bullish, BarNumber(), Kicking_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and Kicking_Trig > 0, "8=Kicking", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Kicking().bullish, "Kicking", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and Kicking().bullish, BubPos, if BubNumb then "8" else if BubVerb then "Kicking" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"), no);

# LongLeggedDoji_9
##### 9 ##### LongLeggedDoji() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.LongLeggedDoji_9 then 1 else if ShowSecond == ShowSecond.LongLeggedDoji_9 then 2 else if ShowThird == ShowThird.LongLeggedDoji_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, LongLeggedDoji().bullish, Double.NaN);
plot LongLeggedDoji = candleAll_9;
LongLeggedDoji.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
LongLeggedDoji.SetDefaultColor(GlobalColor("BullishReversal"));
LongLeggedDoji.SetLineWeight(5);
LongLeggedDoji.HideTitle();
LongLeggedDoji.HideBubble();
rec LongLeggedDoji_Trig = if(LongLeggedDoji().bullish, BarNumber(), LongLeggedDoji_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and LongLeggedDoji_Trig > 0, "9=LongLeggedDoji", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and LongLeggedDoji().bullish, "LongLeggedDoji", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and LongLeggedDoji().bullish, BubPos, if BubNumb then "9" else if BubVerb then "LongLeggedDoji" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"), no);

# Marubozu_10
##### 10 ##### Marubozu() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.Marubozu_10 then 1 else if ShowSecond == ShowSecond.Marubozu_10 then 2 else if ShowThird == ShowThird.Marubozu_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, Marubozu().bullish, Double.NaN);
plot Marubozu = candleAll_10;
Marubozu.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Marubozu.SetDefaultColor(GlobalColor("BullishContinuation"));
Marubozu.SetLineWeight(5);
Marubozu.HideTitle();
Marubozu.HideBubble();
rec Marubozu_Trig = if(Marubozu().bullish, BarNumber(), Marubozu_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and Marubozu_Trig > 0, "10=Marubozu", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and Marubozu().bullish, "Marubozu", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and Marubozu().bullish, BubPos, if BubNumb then "10" else if BubVerb then "Marubozu" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishContinuation"), no);

# MeetingLines_11
##### 11 ##### MeetingLines() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.MeetingLines_11 then 1 else if ShowSecond == ShowSecond.MeetingLines_11 then 2 else if ShowThird == ShowThird.MeetingLines_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, MeetingLines().bullish, Double.NaN);
plot MeetingLines = candleAll_11;
MeetingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MeetingLines.SetDefaultColor(GlobalColor("BullishReversal"));
MeetingLines.SetLineWeight(5);
MeetingLines.HideTitle();
MeetingLines.HideBubble();
rec MeetingLines_Trig = if(MeetingLines().bullish, BarNumber(), MeetingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and MeetingLines_Trig > 0, "11=MeetingLines", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MeetingLines().bullish, "MeetingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and MeetingLines().bullish, BubPos, if BubNumb then "1" else if BubVerb then "MeetingLines" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"), no);

# SeparatingLines_12
##### 12 ##### SeparatingLines() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.SeparatingLines_12 then 1 else if ShowSecond == ShowSecond.SeparatingLines_12 then 2 else if ShowThird == ShowThird.SeparatingLines_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, SeparatingLines().bullish, Double.NaN);
plot SeparatingLines = candleAll_12;
SeparatingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SeparatingLines.SetDefaultColor(GlobalColor("BullishContinuation"));
SeparatingLines.SetLineWeight(5);
SeparatingLines.HideTitle();
SeparatingLines.HideBubble();
rec SeparatingLines_Trig = if(SeparatingLines().bullish, BarNumber(), SeparatingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and SeparatingLines_Trig > 0, "12=SeparatingLines", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and SeparatingLines().bullish, "SeparatingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and SeparatingLines().bullish, BubPos, if BubNumb then "12" else if BubVerb then "SeparatingLines" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"), no);

# SideBySideWhiteLines_13
##### 13 ##### SideBySideWhiteLines() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.SideBySideWhiteLines_13 then 1 else if ShowSecond == ShowSecond.SideBySideWhiteLines_13 then 2 else if ShowThird == ShowThird.SideBySideWhiteLines_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, SideBySideWhiteLines().bullish, Double.NaN);
plot SideBySideWhiteLines = candleAll_13;
SideBySideWhiteLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SideBySideWhiteLines.SetDefaultColor(GlobalColor("BullishContinuation"));
SideBySideWhiteLines.SetLineWeight(5);
SideBySideWhiteLines.HideTitle();
SideBySideWhiteLines.HideBubble();
rec SideBySideWhiteLines_Trig = if(SideBySideWhiteLines().bullish, BarNumber(), SideBySideWhiteLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and SideBySideWhiteLines_Trig > 0, "13=SideBySideWhiteLines", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and SideBySideWhiteLines().bullish, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and SideBySideWhiteLines().bullish, BubPos, if BubNumb then "13" else if BubVerb then "SideBySideWhiteLines" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishContinuation"), no);

# ThreeLineStrike_14
##### 14 ##### ThreeLineStrike() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeLineStrike_14 then 1 else if ShowSecond == ShowSecond.ThreeLineStrike_14 then 2 else if ShowThird == ShowThird.ThreeLineStrike_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeLineStrike().bullish, Double.NaN);
plot ThreeLineStrike = candleAll_14;
ThreeLineStrike.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
ThreeLineStrike.SetDefaultColor(GlobalColor("BullishContinuation"));
ThreeLineStrike.SetLineWeight(5);
ThreeLineStrike.HideTitle();
ThreeLineStrike.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeLineStrike().bullish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeOutsideUp_Trig > 0, "14=ThreeLineStrike", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and ThreeLineStrike().bullish, "ThreeLineStrike", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeLineStrike().bullish, BubPos, if BubNumb then "14" else if BubVerb then "ThreeLineStrike" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishContinuation"), no);

# TriStar_15
##### 15 ##### TriStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.TriStar_15 then 1 else if ShowSecond == ShowSecond.TriStar_15 then 2 else if ShowThird == ShowThird.TriStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, TriStar(), Double.NaN);
plot TriStar = candleAll_15;
TriStar.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TriStar.SetDefaultColor(GlobalColor("BullishReversal"));
TriStar.SetLineWeight(5);
TriStar.HideTitle();
TriStar.HideBubble();
rec TriStar_Trig = if(TriStar().bullish, BarNumber(), TriStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and TriStar_Trig > 0, "15=TriStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and TriStar().bullish, "TriStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and TriStar().bullish, BubPos, if BubNumb then "15" else if BubVerb then "TriStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"), no);

# WilliamsFractal_16
##### 16 ##### WilliamsFractal() #####
#def ThreeShows_16 = if ShowFirst == ShowFirst.WilliamsFractal_16 then 1 else if ShowSecond == ShowSecond.WilliamsFractal_16 then 2 else if ShowThird == ShowThird.WilliamsFractal_16 then 3 else 0;
#def candleAll_16 = if(ShowAll and !ThreeShows_16, WilliamsFractal().UpFractal, Double.NaN);
#plot WilliamsFractal = candleAll_16;
#WilliamsFractal.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#WilliamsFractal.SetDefaultColor(GlobalColor("BullishReversal"));
#WilliamsFractal.SetLineWeight(5);
#WilliamsFractal.HideTitle();
#WilliamsFractal.HideBubble();
#rec WilliamsFractal_Trig_upfractal = if(WilliamsFractal().upfractal, BarNumber(), WilliamsFractal_Trig_upfractal[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and WilliamsFractal_Trig_upfractal > 0, "16=WilliamsFractal", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and WilliamsFractal().upfractal, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and WilliamsFractal().upfractal, BubPos, if BubNumb then "16" else if BubVerb then "WilliamsFractal" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"), no);

# ZigZagStepPattern_17
##### 17 ##### ZigZagStepPattern() #####
#def ThreeShows_17 = if ShowFirst == ShowFirst.ZigZagStepPattern_17 then 1 else if ShowSecond == ShowSecond.ZigZagStepPattern_17 then 2 else if ShowThird == ShowThird.ZigZagStepPattern_17 then 3 else 0;
#def candleAll_17 = if(ShowAll and !ThreeShows_17, ZigZagStepPattern(), Double.NaN);
#plot ZigZagStepPattern = candleAll_17;
#ZigZagStepPattern.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#ZigZagStepPattern.SetDefaultColor(GlobalColor("BullishReversal"));
#ZigZagStepPattern.SetLineWeight(5);
#ZigZagStepPattern.HideTitle();
#ZigZagStepPattern.HideBubble();
#rec ZigZagStepPattern_Trig_upstep = if(ZigZagStepPattern().upstep, BarNumber(), ZigZagStepPattern_Trig_upstep[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ZigZagStepPattern_Trig_upstep > 0, "17=ZigZagStepPattern", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and ZigZagStepPattern().upstep, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ZigZagStepPattern().upstep, BubPos, if BubNumb then "17" else if BubVerb then "ZigZagStepPattern" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"), no);

# End Code

Bullish_AND_Bearish_Bearish_Patterns_Only http://tos.mx/!uKEu59N9
Bullish_AND_Bearish_Bearish_Patterns_Only.png

Code:
# Bullish_AND_Bearish_Bearish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bullish_AND_Bearish_Bearish_Patterns_Only: Plots and identifies all 17 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#shows all bearish Only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bull. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

DefineGlobalColor("BearishReversal",     CreateColor(230, 154,   0));
#DefineGlobalColor("BullishReversal",     CreateColor(  0, 154, 230));
DefineGlobalColor("BearishContinuation", CreateColor(255, 211,  77));
#DefineGlobalColor("BullishContinuation", CreateColor( 77, 211, 255));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bull & Bear Bearish Only Reversals", GlobalColor("BearishReversal"));
AddLabel(ShowMainLabel, "Bull & Bear Bearish Only Continuations: 10, 12, 13, 14", GlobalColor("BearishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, high, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AbandonedBaby_1:
    candle1 = if(ShowFirst.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle1 = if(ShowFirst.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle1 = if(ShowFirst.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle1 = if(ShowFirst.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle1 = if(ShowFirst.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle1 = if(ShowFirst.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle1 = if(ShowFirst.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle1 = if(ShowFirst.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle1 = if(ShowFirst.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle1 = if(ShowFirst.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle1 = if(ShowFirst.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle1 = if(ShowFirst.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle1 = if(ShowFirst.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle1 = if(ShowFirst.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle1 = if(ShowFirst.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle1 = if(ShowFirst.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle1 = if(ShowFirst.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case AbandonedBaby_1:
    candle2 = if(ShowSecond.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle2 = if(ShowSecond.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle2 = if(ShowSecond.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle2 = if(ShowSecond.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle2 = if(ShowSecond.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle2 = if(ShowSecond.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle2 = if(ShowSecond.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle2 = if(ShowSecond.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle2 = if(ShowSecond.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle2 = if(ShowSecond.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle2 = if(ShowSecond.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle2 = if(ShowSecond.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle2 = if(ShowSecond.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle2 = if(ShowSecond.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle2 = if(ShowSecond.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle2 = if(ShowSecond.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle2 = if(ShowSecond.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AbandonedBaby_1:
    candle3 = if(ShowThird.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);
# edited in .bull.need to do this  for.bearish for all
case BeltHold_2:
    candle3 = if(ShowThird.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle3 = if(ShowThird.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle3 = if(ShowThird.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle3 = if(ShowThird.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle3 = if(ShowThird.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle3 = if(ShowThird.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle3 = if(ShowThird.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle3 = if(ShowThird.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle3 = if(ShowThird.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle3 = if(ShowThird.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle3 = if(ShowThird.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle3 = if(ShowThird.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle3 = if(ShowThird.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle3 = if(ShowThird.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle3 = if(ShowThird.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle3 = if(ShowThird.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

#  AbandonedBaby_1
##### 1 ##### AbandonedBaby() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AbandonedBaby_1 then 1 else if ShowSecond == ShowSecond.AbandonedBaby_1 then 2 else if ShowThird == ShowThird.AbandonedBaby_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AbandonedBaby().bearish, Double.NaN);
plot AB = candleAll_1;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
AB.SetDefaultColor(GlobalColor("BearishReversal"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec AbandonedBaby_Trig = if(AbandonedBaby().bearish, BarNumber(), AbandonedBaby_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AbandonedBaby_Trig > 0, "1=AbandonedBaby", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and AbandonedBaby().bearish, "AbandonedBaby", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AbandonedBaby().bearish, BubPos, if BubNumb then "1" else if BubVerb then "AbandonedBaby" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"), yes);  #BubVerb

# BeltHold_2
##### 2 ##### BeltHold() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.BeltHold_2 then 1 else if ShowSecond == ShowSecond.BeltHold_2 then 2 else if ShowThird == ShowThird.BeltHold_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, BeltHold().bearish, Double.NaN);
plot BH = candleAll_2;
BH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
BH.SetDefaultColor(GlobalColor("BearishReversal"));
BH.SetLineWeight(5);
BH.HideTitle();
BH.HideBubble();
rec BeltHold_Trig = if(BeltHold().bearish, BarNumber(), BeltHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and BeltHold_Trig > 0, "2=BeltHold", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and BeltHold().bearish, "BeltHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and BeltHold().bearish, BubPos, if BubNumb then "2" else if BubVerb then "BeltHold" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"), yes);

# Breakaway_3
##### 3 ##### Breakaway() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Breakaway_3 then 1 else if ShowSecond == ShowSecond.Breakaway_3 then 2 else if ShowThird == ShowThird.Breakaway_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Breakaway().bearish, Double.NaN);
plot BAWAY = candleAll_3;
BAWAY.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
BAWAY.SetDefaultColor(GlobalColor("BearishReversal"));
BAWAY.SetLineWeight(5);
BAWAY.HideTitle();
BAWAY.HideBubble();
rec Breakaway_Trig = if(Breakaway().bearish, BarNumber(), Breakaway_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Breakaway_Trig > 0, "3=Breakaway", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Breakaway().bearish, "Breakaway", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Breakaway().bearish, BubPos, if BubNumb then "3" else if BubVerb then "Breakaway" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"), yes);

# Doji_4
##### 4 ##### Doji() #####
#def ThreeShows_4 = if ShowFirst == ShowFirst.Doji_4 then 1 else if ShowSecond == ShowSecond.Doji_4 then 2 else if ShowThird == ShowThird.Doji_4 then 3 else 0;
#def candleAll_4 = if(ShowAll and !ThreeShows_4, Doji(), Double.NaN);
#plot DOJI = candleAll_4;
#DOJI.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#DOJI.HideTitle();
#DOJI.HideBubble();
#rec Doji_Trig = if(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and Doji_Trig > 0, "4=Doji", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and Doji(), "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and Doji(), BubPos, if BubNumb
#then "4" else if BubVerb then "Doji" else "", GlobalColor(if REPLACEME == 1 then "Show1st" else if REPLACEME == 2 then "Show2nd" else if REPLACEME == 3 then "Show3rd" else "Neutral"), yes);

# Engulfing_5
##### 5 ##### Engulfing() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.Engulfing_5 then 1 else if ShowSecond == ShowSecond.Engulfing_5 then 2 else if ShowThird == ShowThird.Engulfing_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, Engulfing().bearish, Double.NaN);
plot Engulfing = candleAll_5;
Engulfing.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Engulfing.SetDefaultColor(GlobalColor("BearishReversal"));
Engulfing.SetLineWeight(5);
Engulfing.HideTitle();
Engulfing.HideBubble();
rec Engulfing_Trig = if(Engulfing().bearish, BarNumber(), Engulfing_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and Engulfing_Trig > 0, "5=Engulfing", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Engulfing().bearish, "Engulfing", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and Engulfing().bearish, BubPos, if BubNumb then "5" else if BubVerb then "Engulfing" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishReversal"), yes);  #10

# Harami_6
##### 6 ##### Harami() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.Harami_6 then 1 else if ShowSecond == ShowSecond.Harami_6 then 2 else if ShowThird == ShowThird.Harami_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, Harami().bearish, Double.NaN);
plot Harami = candleAll_6;
Harami.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Harami.SetDefaultColor(GlobalColor("BearishReversal"));
Harami.SetLineWeight(5);
Harami.HideTitle();
Harami.HideBubble();
rec Harami_Trig = if(Harami().bearish, BarNumber(), Harami_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and Harami_Trig > 0, "6=Harami", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Harami().bearish, "Harami", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and Harami().bearish, BubPos, if BubNumb then "6" else if BubVerb then "Harami" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"), yes);

# HaramiCross_7
##### 7 ##### HaramiCross() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.HaramiCross_7 then 1 else if ShowSecond == ShowSecond.HaramiCross_7 then 2 else if ShowThird == ShowThird.HaramiCross_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, HaramiCross().bearish, Double.NaN);
plot HaramiCross = candleAll_7;
HaramiCross.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN)); # bearish
HaramiCross.SetDefaultColor(GlobalColor("BearishReversal"));
HaramiCross.SetLineWeight(5);
HaramiCross.HideTitle();
HaramiCross.HideBubble();
rec HaramiCross_Trig = if(HaramiCross().bearish, BarNumber(), HaramiCross_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and HaramiCross_Trig > 0, "7=HaramiCross", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and HaramiCross().bearish, "HaramiCross", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and HaramiCross().bearish, BubPos, if BubNumb then "7" else if BubVerb then "HaramiCross" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"), yes);

# Kicking_8
##### 8 ##### BeltHold() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.Kicking_8 then 1 else if ShowSecond == ShowSecond.Kicking_8 then 2 else if ShowThird == ShowThird.Kicking_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, Kicking().bearish, Double.NaN);
plot Kicking = candleAll_8;
Kicking.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Kicking.SetDefaultColor(GlobalColor("BearishReversal"));
Kicking.SetLineWeight(5);
Kicking.HideTitle();
Kicking.HideBubble();
rec Kicking_Trig = if(Kicking().bearish, BarNumber(), Kicking_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and Kicking_Trig > 0, "8=Kicking", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Kicking().bearish, "Kicking", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and Kicking().bearish, BubPos, if BubNumb then "8" else if BubVerb then "Kicking" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishReversal"), yes);

# LongLeggedDoji_9
##### 9 ##### LongLeggedDoji() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.LongLeggedDoji_9 then 1 else if ShowSecond == ShowSecond.LongLeggedDoji_9 then 2 else if ShowThird == ShowThird.LongLeggedDoji_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, LongLeggedDoji().bearish, Double.NaN);
plot LongLeggedDoji = candleAll_9;
LongLeggedDoji.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
LongLeggedDoji.SetDefaultColor(GlobalColor("BearishReversal"));
LongLeggedDoji.SetLineWeight(5);
LongLeggedDoji.HideTitle();
LongLeggedDoji.HideBubble();
rec LongLeggedDoji_Trig = if(LongLeggedDoji().bearish, BarNumber(), LongLeggedDoji_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and LongLeggedDoji_Trig > 0, "9=LongLeggedDoji", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and LongLeggedDoji().bearish, "LongLeggedDoji", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and LongLeggedDoji().bearish, BubPos, if BubNumb then "9" else if BubVerb then "LongLeggedDoji" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"), yes);

# Marubozu_10
##### 10 ##### Marubozu() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.Marubozu_10 then 1 else if ShowSecond == ShowSecond.Marubozu_10 then 2 else if ShowThird == ShowThird.Marubozu_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, Marubozu().bearish, Double.NaN);
plot Marubozu = candleAll_10;
Marubozu.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Marubozu.SetDefaultColor(GlobalColor("BearishContinuation"));
Marubozu.SetLineWeight(5);
Marubozu.HideTitle();
Marubozu.HideBubble();
rec Marubozu_Trig = if(Marubozu().bearish, BarNumber(), Marubozu_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and Marubozu_Trig > 0, "10=Marubozu", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and Marubozu().bearish, "Marubozu", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and Marubozu().bearish, BubPos, if BubNumb then "10" else if BubVerb then "Marubozu" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishContinuation"), yes);

# MeetingLines_11
##### 11 ##### MeetingLines() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.MeetingLines_11 then 1 else if ShowSecond == ShowSecond.MeetingLines_11 then 2 else if ShowThird == ShowThird.MeetingLines_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, MeetingLines().bearish, Double.NaN);
plot MeetingLines = candleAll_11;
MeetingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
MeetingLines.SetDefaultColor(GlobalColor("BearishReversal"));
MeetingLines.SetLineWeight(5);
MeetingLines.HideTitle();
MeetingLines.HideBubble();
rec MeetingLines_Trig = if(MeetingLines().bearish, BarNumber(), MeetingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and MeetingLines_Trig > 0, "11=MeetingLines", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and MeetingLines().bearish, "MeetingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and MeetingLines().bearish, BubPos, if BubNumb then "1" else if BubVerb then "MeetingLines" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishReversal"), yes);

# SeparatingLines_12
##### 12 ##### SeparatingLines() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.SeparatingLines_12 then 1 else if ShowSecond == ShowSecond.SeparatingLines_12 then 2 else if ShowThird == ShowThird.SeparatingLines_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, SeparatingLines().bearish, Double.NaN);
plot SeparatingLines = candleAll_12;
SeparatingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SeparatingLines.SetDefaultColor(GlobalColor("BearishContinuation"));
SeparatingLines.SetLineWeight(5);
SeparatingLines.HideTitle();
SeparatingLines.HideBubble();
rec SeparatingLines_Trig = if(SeparatingLines().bearish, BarNumber(), SeparatingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and SeparatingLines_Trig > 0, "12=SeparatingLines", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and SeparatingLines().bearish, "SeparatingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and SeparatingLines().bearish,  BubPos, if BubNumb then "12" else if BubVerb then "SeparatingLines" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"), yes);

# SideBySideWhiteLines_13
##### 13 ##### SideBySideWhiteLines() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.SideBySideWhiteLines_13 then 1 else if ShowSecond == ShowSecond.SideBySideWhiteLines_13 then 2 else if ShowThird == ShowThird.SideBySideWhiteLines_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, SideBySideWhiteLines().bearish, Double.NaN);
plot SideBySideWhiteLines = candleAll_13;
SideBySideWhiteLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SideBySideWhiteLines.SetDefaultColor(GlobalColor("BearishContinuation"));
SideBySideWhiteLines.SetLineWeight(5);
SideBySideWhiteLines.HideTitle();
SideBySideWhiteLines.HideBubble();
rec SideBySideWhiteLines_Trig = if(SideBySideWhiteLines().bearish, BarNumber(), SideBySideWhiteLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and SideBySideWhiteLines_Trig > 0, "13=SideBySideWhiteLines", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and SideBySideWhiteLines().bearish, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and SideBySideWhiteLines().bearish, BubPos, if BubNumb then "13" else if BubVerb then "SideBySideWhiteLines" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishContinuation"), yes);

# ThreeLineStrike_14
##### 14 ##### ThreeLineStrike() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeLineStrike_14 then 1 else if ShowSecond == ShowSecond.ThreeLineStrike_14 then 2 else if ShowThird == ShowThird.ThreeLineStrike_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeLineStrike().bearish, Double.NaN);
plot ThreeLineStrike = candleAll_14;
ThreeLineStrike.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ThreeLineStrike.SetDefaultColor(GlobalColor("BearishContinuation"));
ThreeLineStrike.SetLineWeight(5);
ThreeLineStrike.HideTitle();
ThreeLineStrike.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeLineStrike().bearish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeOutsideUp_Trig > 0, "14=ThreeLineStrike", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and ThreeLineStrike().bearish, "ThreeLineStrike", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeLineStrike().bearish, BubPos, if BubNumb then "14" else if BubVerb then "ThreeLineStrike" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"), yes);

# TriStar_15
##### 15 ##### TriStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.TriStar_15 then 1 else if ShowSecond == ShowSecond.TriStar_15 then 2 else if ShowThird == ShowThird.TriStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, TriStar().bearish, Double.NaN);
plot TriStar = candleAll_15;
TriStar.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TriStar.SetDefaultColor(GlobalColor("BearishReversal"));
TriStar.SetLineWeight(5);
TriStar.HideTitle();
TriStar.HideBubble();
rec TriStar_Trig = if(TriStar().bearish, BarNumber(), TriStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and TriStar_Trig > 0, "15=TriStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and TriStar().bearish, "TriStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and TriStar().bearish, BubPos, if BubNumb then "15" else if BubVerb then "TriStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"), yes);

# WilliamsFractal_16
##### 16 ##### WilliamsFractal() #####
#def ThreeShows_16 = if ShowFirst == ShowFirst.WilliamsFractal_16 then 1 else if ShowSecond == ShowSecond.WilliamsFractal_16 then 2 else if ShowThird == ShowThird.WilliamsFractal_16 then 3 else 0;
#def candleAll_16 = if(ShowAll and !ThreeShows_16, WilliamsFractal().downfractal, Double.NaN);
#plot WilliamsFractal = candleAll_16;
#WilliamsFractal.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#WilliamsFractal.SetDefaultColor(GlobalColor("BearishReversal"));
#WilliamsFractal.SetLineWeight(5);
#WilliamsFractal.HideTitle();
#WilliamsFractal.HideBubble();
#rec WilliamsFractal_Trig_downfractal = if(WilliamsFractal().downfractal, BarNumber(), WilliamsFractal_Trig_downfractal[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and WilliamsFractal_Trig_downfractal > 0, "16=WilliamsFractal", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and WilliamsFractal().downfractal, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and WilliamsFractal().downfractal, BubPos, if BubNumb then "16" else if BubVerb then "WilliamsFractal" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "Neutral"), no);

# ZigZagStepPattern_17
##### 17 ##### ZigZagStepPattern() #####
#def ThreeShows_17 = if ShowFirst == ShowFirst.ZigZagStepPattern_17 then 1 else if ShowSecond == ShowSecond.ZigZagStepPattern_17 then 2 else if ShowThird == ShowThird.ZigZagStepPattern_17 then 3 else 0;
#def candleAll_17 = if(ShowAll and !ThreeShows_17, ZigZagStepPattern().downstep, Double.NaN);
#plot ZigZagStepPattern = candleAll_17;
#ZigZagStepPattern.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#ZigZagStepPattern.SetDefaultColor(GlobalColor("BearishReversal"));
#ZigZagStepPattern.SetLineWeight(5);
#ZigZagStepPattern.HideTitle();
#ZigZagStepPattern.HideBubble();
#rec ZigZagStepPattern_Trig_downstep = if(ZigZagStepPattern().downstep, BarNumber(), ZigZagStepPattern_Trig_downstep[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ZigZagStepPattern_Trig_downstep > 0, "17=ZigZagStepPattern", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and ZigZagStepPattern().downstep, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ZigZagStepPattern().downstep, BubPos, if BubNumb then "17" else if BubVerb then "ZigZagStepPattern" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "Neutral"), no);

# End Code

Labels
Bullish_Patterns_Only-labels.png


Bubbles
Bullish_Patterns_Only-bubbles.png


All 4 - Labels & Bubbles
Candlestick_Patterns.png
 
Probably too long ago to matter but for anyone else, the issue is the OP is adding an offset to the bubbles (which is based on the stock price), if you search for "high +15" "low - 15" "high + 6" "low - 6" you'll see what i mean

I modified the original scripts with the following changes (leaving credit to previous authors):
Code:
# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

Bullish_Patterns_Only http://tos.mx/!LB9oKT5r
View attachment 21967
Code:
# Bullish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bearish_Patterns_Only: Plots and identifies all 20 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

#DefineGlobalColor("BearishReversal",     CreateColor(230, 104, 104));
DefineGlobalColor("BullishReversal",     CreateColor(104, 230, 104));
#DefineGlobalColor("BearishContinuation", CreateColor(255, 174, 174));
DefineGlobalColor("BullishContinuation", CreateColor(174, 255, 174));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bullish Only Reversals", GlobalColor("BullishReversal"));
AddLabel(ShowMainLabel, "Bullish Only Continuations: 3, 7, 12, 19, 20", GlobalColor("BullishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint ShowBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, low, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFourth, ShowFifth or ShowSixth.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, ConcealingBabySwallow_1, Hammer_2, HighPriceGappingPlay_3, HomingPigeon_4, InvertedHammer_5, MatchingLow_6, MatHold_7, MorningDojiStar_8, MorningStar_9, OneWhiteSoldier_10, PiercingLine_11, RisingThreeMethods_12, Sticksandwich_13, ThreeInsideUp_14, ThreeOutsideUp_15, ThreeStarsInTheSouth_16, ThreeWhiteSoldiers_17, UniqueThreeRiverBottom_18, UpsideGapThreeMethods_19, UpsideTasukiGap_20}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case ConcealingBabySwallow_1:
    candle1 = if(ShowFirst.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle1 = if(ShowFirst.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle1 = if(ShowFirst.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle1 = if(ShowFirst.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle1 = if(ShowFirst.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle1 = if(ShowFirst.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle1 = if(ShowFirst.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle1 = if(ShowFirst.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle1 = if(ShowFirst.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle1 = if(ShowFirst.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle1 = if(ShowFirst.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle1 = if(ShowFirst.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle1 = if(ShowFirst.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle1 = if(ShowFirst.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle1 = if(ShowFirst.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle1 = if(ShowFirst.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle1 = if(ShowFirst.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle1 = if(ShowFirst.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle1 = if(ShowFirst.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle1 = if(ShowFirst.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case ConcealingBabySwallow_1:
    candle2 = if(ShowSecond.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle2 = if(ShowSecond.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle2 = if(ShowSecond.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle2 = if(ShowSecond.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle2 = if(ShowSecond.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle2 = if(ShowSecond.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle2 = if(ShowSecond.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle2 = if(ShowSecond.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle2 = if(ShowSecond.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle2 = if(ShowSecond.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle2 = if(ShowSecond.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle2 = if(ShowSecond.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle2 = if(ShowSecond.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle2 = if(ShowSecond.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle2 = if(ShowSecond.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle2 = if(ShowSecond.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle2 = if(ShowSecond.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle2 = if(ShowSecond.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle2 = if(ShowSecond.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle2 = if(ShowSecond.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case ConcealingBabySwallow_1:
    candle3 = if(ShowThird.ConcealingBabySwallow(), ConcealingBabySwallow(), Double.NaN);
case Hammer_2:
    candle3 = if(ShowThird.Hammer(), Hammer(), Double.NaN);
case HighPriceGappingPlay_3:
    candle3 = if(ShowThird.HighPriceGappingPlay(), HighPriceGappingPlay(), Double.NaN);
case HomingPigeon_4:
    candle3 = if(ShowThird.HomingPigeon(), HomingPigeon(), Double.NaN);
case InvertedHammer_5:
    candle3 = if(ShowThird.InvertedHammer(), InvertedHammer(), Double.NaN);
case MatchingLow_6:
    candle3 = if(ShowThird.MatchingLow(), MatchingLow(), Double.NaN);
case MatHold_7:
    candle3 = if(ShowThird.MatHold(), MatHold(), Double.NaN);
case MorningDojiStar_8:
    candle3 = if(ShowThird.MorningDojiStar(), MorningDojiStar(), Double.NaN);
case MorningStar_9:
    candle3 = if(ShowThird.MorningStar(), MorningStar(), Double.NaN);
case OneWhiteSoldier_10:
    candle3 = if(ShowThird.OneWhiteSoldier(), OneWhiteSoldier(), Double.NaN);
case PiercingLine_11:
    candle3 = if(ShowThird.PiercingLine(), PiercingLine(), Double.NaN);
case RisingThreeMethods_12:
    candle3 = if(ShowThird.RisingThreeMethods(), RisingThreeMethods(), Double.NaN);
case Sticksandwich_13:
    candle3 = if(ShowThird.StickSandwich(), StickSandwich(), Double.NaN);
case ThreeInsideUp_14:
    candle3 = if(ShowThird.ThreeInsideUp(), ThreeInsideUp(), Double.NaN);
case ThreeOutsideUp_15:
    candle3 = if(ShowThird.ThreeOutsideUp(), ThreeOutsideUp(), Double.NaN);
case ThreeStarsInTheSouth_16:
    candle3 = if(ShowThird.ThreeStarsInTheSouth(), ThreeStarsInTheSouth(), Double.NaN);
case ThreeWhiteSoldiers_17:
    candle3 = if(ShowThird.ThreeWhiteSoldiers(), ThreeWhiteSoldiers(), Double.NaN);
case UniqueThreeRiverBottom_18:
    candle3 = if(ShowThird.UniqueThreeRiverBottom(), UniqueThreeRiverBottom(), Double.NaN);
case UpsideGapThreeMethods_19:
    candle3 = if(ShowThird.UpsideGapThreeMethods(), UpsideGapThreeMethods(), Double.NaN);
case  UpsideTasukiGap_20:
    candle3 = if(ShowThird.UpsideTasukiGap(), UpsideTasukiGap(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# ConcealingBabySwallow_1
##### 1 ##### ConcealingBabySwallow() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.ConcealingBabySwallow_1 then 1 else if ShowSecond == ShowSecond.ConcealingBabySwallow_1 then 2 else if ShowThird == ShowThird.ConcealingBabySwallow_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, ConcealingBabySwallow(), Double.NaN);
plot CBS = candleAll_1;
CBS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
CBS.SetDefaultColor(GlobalColor("BullishReversal"));
CBS.SetLineWeight(5);
CBS.HideTitle();
CBS.HideBubble();
rec ConcealingBabySwallow_Trig = if(ConcealingBabySwallow().bullish, BarNumber(), ConcealingBabySwallow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and ConcealingBabySwallow_Trig > 0, "1=ConcealingBabySwallow", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ConcealingBabySwallow(), "ConcealingBabySwallow", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and ConcealingBabySwallow(), BubPos, if BubNumb then "1" else if BubVerb then "ConcealingBabySwallow" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# Hammer_2
##### 2 ##### Hammer() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.Hammer_2 then 1 else if ShowSecond == ShowSecond.Hammer_2 then 2 else if ShowThird == ShowThird.Hammer_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, Hammer(), Double.NaN);
plot Hammer = candleAll_2;
Hammer.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Hammer.SetDefaultColor(GlobalColor("BullishReversal"));
Hammer.SetLineWeight(5);
Hammer.HideTitle();
Hammer.HideBubble();
rec Hammer_Trig = if(Hammer().bullish, BarNumber(), Hammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and Hammer_Trig > 0, "2=Hammer", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Hammer(), "Hammer", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and Hammer(), BubPos, if BubNumb then "2" else if BubVerb then "Hammer" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"), no);

# HighPriceGappingPlay_3
##### 3 ##### HighPriceGappingPlay() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.HighPriceGappingPlay_3 then 1 else if ShowSecond == ShowSecond.HighPriceGappingPlay_3 then 2 else if ShowThird == ShowThird.HighPriceGappingPlay_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, HighPriceGappingPlay(), Double.NaN);
plot AB = candleAll_3;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
AB.SetDefaultColor(GlobalColor("BullishContinuation"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec HighPriceGappingPlay_Trig = if(HighPriceGappingPlay().bullish, BarNumber(), HighPriceGappingPlay_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and HighPriceGappingPlay_Trig > 0, "3=HighPriceGappingPlay", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and HighPriceGappingPlay(), "HighPriceGappingPlay", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and HighPriceGappingPlay(), BubPos, if BubNumb then "3" else if BubVerb then "HighPriceGappingPlay" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishContinuation"), no);

# HomingPigeon_4
##### 4 ##### HomingPigeon() #####
def ThreeShows_4 = if ShowFirst == ShowFirst.HomingPigeon_4 then 1 else if ShowSecond == ShowSecond.HomingPigeon_4 then 2 else if ShowThird == ShowThird.HomingPigeon_4 then 3 else 0;
def candleAll_4 = if(ShowAll and !ThreeShows_4, HomingPigeon(), Double.NaN);
plot HP = candleAll_4;
HP.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
HP.SetDefaultColor(GlobalColor("BullishReversal"));
HP.SetLineWeight(5);
HP.HideTitle();
HP.HideBubble();
rec HomingPigeon_Trig = if(HomingPigeon().bullish, BarNumber(), HomingPigeon_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and HomingPigeon_Trig > 0, "4=HomingPigeon", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and HomingPigeon(), "HomingPigeon", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and HomingPigeon(), BubPos, if BubNumb then "4" else if BubVerb then "HomingPigeon" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"), no);

# InvertedHammer_5
##### 5 ##### InvertedHammer() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.InvertedHammer_5 then 1 else if ShowSecond == ShowSecond.InvertedHammer_5 then 2 else if ShowThird == ShowThird.InvertedHammer_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, InvertedHammer(), Double.NaN);
plot INVHammer = candleAll_5;
INVHammer.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
INVHammer.SetDefaultColor(GlobalColor("BullishReversal"));
INVHammer.SetLineWeight(5);
INVHammer.HideTitle();
INVHammer.HideBubble();
rec InvertedHammer_Trig = if(InvertedHammer().bullish, BarNumber(), InvertedHammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and InvertedHammer_Trig > 0, "5=InvertedHammer", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and InvertedHammer(), "InvertedHammer", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and InvertedHammer(), BubPos, if BubNumb then "5" else if BubVerb then "InvertedHammer" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"), no);

# MatchingLow_6
##### 6 ##### MatchingLow() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.MatchingLow_6 then 1 else if ShowSecond == ShowSecond.MatchingLow_6 then 2 else if ShowThird == ShowThird.MatchingLow_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, MatchingLow(), Double.NaN);
plot ML = candleAll_6;
ML.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
ML.SetDefaultColor(GlobalColor("BullishReversal"));
ML.SetLineWeight(5);
ML.HideTitle();
ML.HideBubble();
rec MatchingLow_Trig = if(MatchingLow().bullish, BarNumber(), MatchingLow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and MatchingLow_Trig > 0, "6=MatchingLow", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MatchingLow(), "MatchingLow", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and MatchingLow(), BubPos, if BubNumb then "6" else if BubVerb then "MatchingLow" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"), no);

# MatHold_7
##### 7 ##### MatHold() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.MatHold_7 then 1 else if ShowSecond == ShowSecond.MatHold_7 then 2 else if ShowThird == ShowThird.MatHold_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, MatHold(), Double.NaN);
plot MH = candleAll_7;
MH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MH.SetDefaultColor(GlobalColor("BullishContinuation"));
MH.SetLineWeight(5);
MH.HideTitle();
MH.HideBubble();
rec MatHold_Trig = if(MatHold().bullish, BarNumber(), MatHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and MatHold_Trig > 0, "7=MatHold", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and MatHold(), "MatHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and MatHold(), BubPos, if BubNumb then "7" else if BubVerb then "MatHold" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishContinuation"), no);

# MorningDojiStar_8
##### 8 ##### MorningDojiStar() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.MorningDojiStar_8 then 1 else if ShowSecond == ShowSecond.MorningDojiStar_8 then 2 else if ShowThird == ShowThird.MorningDojiStar_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, MorningDojiStar(), Double.NaN);
plot MDS = candleAll_8;
MDS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MDS.SetDefaultColor(GlobalColor("BullishReversal"));
MDS.SetLineWeight(5);
MDS.HideTitle();
MDS.HideBubble();
rec MorningDojiStar_Trig = if(MorningDojiStar().bullish, BarNumber(), MorningDojiStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and MorningDojiStar_Trig > 0, "8=MorningDojiStar", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MorningDojiStar(), "MorningDojiStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and MorningDojiStar(), BubPos, if BubNumb then "8" else if BubVerb then "MorningDojiStar" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"), no);

# MorningStar_9
##### 9 ##### MorningStar() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.MorningStar_9 then 1 else if ShowSecond == ShowSecond.MorningStar_9 then 2 else if ShowThird == ShowThird.MorningStar_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, MorningStar(), Double.NaN);
plot MS = candleAll_9;
MS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MS.SetDefaultColor(GlobalColor("BullishReversal"));
MS.SetLineWeight(5);
MS.HideTitle();
MS.HideBubble();
rec MorningStar_Trig = if(MorningStar().bullish, BarNumber(), MorningStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and MorningStar_Trig > 0, "9=MorningStar", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MorningStar(), "MorningStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and MorningStar(), BubPos, if BubNumb then "9" else if BubVerb then "MorningStar" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"), no);

# OneWhiteSoldier_10
##### 10 ##### OneWhiteSoldier() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.OneWhiteSoldier_10 then 1 else if ShowSecond == ShowSecond.OneWhiteSoldier_10 then 2 else if ShowThird == ShowThird.OneWhiteSoldier_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, OneWhiteSoldier(), Double.NaN);
plot OWS = candleAll_10;
OWS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
OWS.SetDefaultColor(GlobalColor("BullishReversal"));
OWS.SetLineWeight(5);
OWS.HideTitle();
OWS.HideBubble();
rec OneWhiteSoldier_Trig = if(OneWhiteSoldier().bullish, BarNumber(), OneWhiteSoldier_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and OneWhiteSoldier_Trig > 0, "10=OneWhiteSoldier", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and OneWhiteSoldier(), "OneWhiteSoldier", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and OneWhiteSoldier(), BubPos, if BubNumb then "10" else if BubVerb then "OneWhiteSoldier" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishReversal"), no);

# PiercingLine_11
##### 11 ##### PiercingLine() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.PiercingLine_11 then 1 else if ShowSecond == ShowSecond.PiercingLine_11 then 2 else if ShowThird == ShowThird.PiercingLine_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, PiercingLine(), Double.NaN);
plot PL = candleAll_11;
PL.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
PL.SetDefaultColor(GlobalColor("BullishReversal"));
PL.SetLineWeight(5);
PL.HideTitle();
PL.HideBubble();
rec PiercingLine_Trig = if(PiercingLine().bullish, BarNumber(), Hammer_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and Hammer_Trig > 0, "11=PiercingLine", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and PiercingLine(), "PiercingLine", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and PiercingLine(), BubPos, if BubNumb then "11" else if BubVerb then "PiercingLine" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"), no);

# RisingThreeMethods_12
##### 12 ##### RisingThreeMethods() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.RisingThreeMethods_12 then 1 else if ShowSecond == ShowSecond.RisingThreeMethods_12 then 2 else if ShowThird == ShowThird.RisingThreeMethods_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, RisingThreeMethods(), Double.NaN);
plot RTM = candleAll_12;
RTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
RTM.SetDefaultColor(GlobalColor("BullishContinuation"));
RTM.SetLineWeight(5);
RTM.HideTitle();
RTM.HideBubble();
rec RisingThreeMethods_Trig = if(RisingThreeMethods().bullish, BarNumber(), RisingThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and RisingThreeMethods_Trig > 0, "3=RisingThreeMethods", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and RisingThreeMethods(), "RisingThreeMethods", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and RisingThreeMethods(), BubPos, if BubNumb then "3" else if BubVerb then "RisingThreeMethods" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"), no);

# Sticksandwich_13
##### 13 ##### Sticksandwich() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.Sticksandwich_13 then 1 else if ShowSecond == ShowSecond.Sticksandwich_13 then 2 else if ShowThird == ShowThird.Sticksandwich_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, Sticksandwich(), Double.NaN);
plot SS = candleAll_13;
SS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SS.SetDefaultColor(GlobalColor("BullishReversal"));
SS.SetLineWeight(5);
SS.HideTitle();
SS.HideBubble();
rec Sticksandwich_Trig = if(Sticksandwich().bullish, BarNumber(), Sticksandwich_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and Sticksandwich_Trig > 0, "13=Sticksandwich", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Sticksandwich(), "Sticksandwich", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and Sticksandwich(), BubPos, if BubNumb then "13" else if BubVerb then "Sticksandwich" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeInsideUp_14
##### 14 ##### ThreeInsideUp() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeInsideUp_14 then 1 else if ShowSecond == ShowSecond.ThreeInsideUp_14 then 2 else if ShowThird == ShowThird.ThreeInsideUp_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeInsideUp(), Double.NaN);
plot TIU = candleAll_14;
TIU.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TIU.SetDefaultColor(GlobalColor("BullishReversal"));
TIU.SetLineWeight(5);
TIU.HideTitle();
TIU.HideBubble();
rec ThreeInsideUp_Trig = if(ThreeInsideUp().bullish, BarNumber(), ThreeInsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeInsideUp_Trig > 0, "14=ThreeInsideUp", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeInsideUp(), "ThreeInsideUp", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeInsideUp(), BubPos, if BubNumb then "14" else if BubVerb then "ThreeInsideUp" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeOutsideUp_15
##### 15 ##### ThreeOutsideUp() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.ThreeOutsideUp_15 then 1 else if ShowSecond == ShowSecond.ThreeOutsideUp_15 then 2 else if ShowThird == ShowThird.ThreeOutsideUp_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, ThreeOutsideUp(), Double.NaN);
plot TOU = candleAll_15;
TOU.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TOU.SetDefaultColor(GlobalColor("BullishReversal"));
TOU.SetLineWeight(5);
TOU.HideTitle();
TOU.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeOutsideUp().bullish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and ThreeOutsideUp_Trig > 0, "15=ThreeOutsideUp", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeOutsideUp(), "ThreeOutsideUp", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and ThreeOutsideUp(), BubPos, if BubNumb then "15" else if BubVerb then "ThreeOutsideUp" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeStarsInTheSouth_16
##### 16 ##### ThreeStarsInTheSouth() #####
def ThreeShows_16 = if ShowFirst == ShowFirst.ThreeStarsInTheSouth_16 then 1 else if ShowSecond == ShowSecond.ThreeStarsInTheSouth_16 then 2 else if ShowThird == ShowThird.ThreeStarsInTheSouth_16 then 3 else 0;
def candleAll_16 = if(ShowAll and !ThreeShows_16, ThreeStarsInTheSouth(), Double.NaN);
plot TSITS = candleAll_16;
TSITS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TSITS.SetDefaultColor(GlobalColor("BullishReversal"));
TSITS.SetLineWeight(5);
TSITS.HideTitle();
TSITS.HideBubble();
rec ThreeStarsInTheSouth_Trig = if(ThreeStarsInTheSouth().bullish, BarNumber(), ThreeStarsInTheSouth_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and ThreeStarsInTheSouth_Trig > 0, "16=ThreeStarsInTheSouth", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeStarsInTheSouth(), "ThreeStarsInTheSouth", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and ThreeStarsInTheSouth(), BubPos, if BubNumb then "16" else if BubVerb then "ThreeStarsInTheSouth" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"), no);

# ThreeWhiteSoldiers_17
##### 17 ##### ThreeWhiteSoldiers() #####
def ThreeShows_17 = if ShowFirst == ShowFirst.ThreeWhiteSoldiers_17 then 1 else if ShowSecond == ShowSecond.ThreeWhiteSoldiers_17 then 2 else if ShowThird == ShowThird.ThreeWhiteSoldiers_17 then 3 else 0;
def candleAll_17 = if(ShowAll and !ThreeShows_17, ThreeWhiteSoldiers(), Double.NaN);
plot TWS = candleAll_17;
TWS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TWS.SetDefaultColor(GlobalColor("BullishReversal"));
TWS.SetLineWeight(5);
TWS.HideTitle();
TWS.HideBubble();
rec ThreeWhiteSoldiers_Trig = if(ThreeWhiteSoldiers().bullish, BarNumber(), ThreeWhiteSoldiers_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ThreeWhiteSoldiers_Trig > 0, "17=ThreeWhiteSoldiers", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and ThreeWhiteSoldiers(), "ThreeWhiteSoldiers", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ThreeWhiteSoldiers(), BubPos, if BubNumb then "17" else if BubVerb then "ThreeWhiteSoldiers" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"), no);

# UniqueThreeRiverBottom_18
##### 18 ##### UniqueThreeRiverBottom() #####
def ThreeShows_18 = if ShowFirst == ShowFirst.UniqueThreeRiverBottom_18 then 1 else if ShowSecond == ShowSecond.UniqueThreeRiverBottom_18 then 2 else if ShowThird == ShowThird.UniqueThreeRiverBottom_18 then 3 else 0;
def candleAll_18 = if(ShowAll and !ThreeShows_18, UniqueThreeRiverBottom(), Double.NaN);
plot UTRB = candleAll_18;
UTRB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UTRB.SetDefaultColor(GlobalColor("BullishReversal"));
UTRB.SetLineWeight(5);
UTRB.HideTitle();
UTRB.HideBubble();
rec UniqueThreeRiverBottom_Trig = if(UniqueThreeRiverBottom().bullish, BarNumber(), UniqueThreeRiverBottom_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_18) and UniqueThreeRiverBottom_Trig > 0, "18=UniqueThreeRiverBottom", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and UniqueThreeRiverBottom(), "UniqueThreeRiverBottom", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and UniqueThreeRiverBottom(), BubPos, if BubNumb then "18" else if BubVerb then "UniqueThreeRiverBottom" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# UpsideGapThreeMethods_19
##### 19 ##### UpsideGapThreeMethods() #####
def ThreeShows_19 = if ShowFirst == ShowFirst.UpsideGapThreeMethods_19 then 1 else if ShowSecond == ShowSecond.UpsideGapThreeMethods_19 then 2 else if ShowThird == ShowThird.UpsideGapThreeMethods_19 then 3 else 0;
def candleAll_19 = if(ShowAll and !ThreeShows_19, UpsideGapThreeMethods(), Double.NaN);
plot UGTM = candleAll_19;
UGTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UGTM.SetDefaultColor(GlobalColor("BullishContinuation"));
UGTM.SetLineWeight(5);
UGTM.HideTitle();
UGTM.HideBubble();
rec UpsideGapThreeMethods_Trig = if(UpsideGapThreeMethods().bullish, BarNumber(), UpsideGapThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_19) and UpsideGapThreeMethods_Trig > 0, "19=UpsideGapThreeMethods", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and UpsideGapThreeMethods(), "UpsideGapThreeMethods", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_19) and UpsideGapThreeMethods(), BubPos, if BubNumb then "19" else if BubVerb then "UpsideGapThreeMethods" else "", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BullishContinuation"), no);

# UpsideTasukiGap_20
##### 20 ##### UpsideTasukiGap() #####
def ThreeShows_20 = if ShowFirst == ShowFirst.UpsideTasukiGap_20 then 1 else if ShowSecond == ShowSecond.UpsideTasukiGap_20 then 2 else if ShowThird == ShowThird.UpsideTasukiGap_20 then 3 else 0;
def candleAll_20 = if(ShowAll and !ThreeShows_20, UpsideTasukiGap().bullish, Double.NaN);
plot UTG = candleAll_20;
UTG.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
UTG.SetDefaultColor(GlobalColor("BullishContinuation"));
UTG.SetLineWeight(5);
UTG.HideTitle();
UTG.HideBubble();
rec UpsideTasukiGap_Trig = if(UpsideTasukiGap().bullish, BarNumber(), UpsideTasukiGap_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_20) and UpsideTasukiGap_Trig > 0, "20=UpsideTasukiGap", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and UpsideTasukiGap(), "UpsideTasukiGap", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_20) and UpsideTasukiGap(), BubPos, if BubNumb then "20" else if BubVerb then "UpsideTasukiGap" else "", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BullishContinuation"), no);

# End Code

Bearish_Patterns_Only http://tos.mx/!oNPt2yI8
View attachment 21968
Code:
# Bearish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bearish_Patterns_Only: Plots and identifies all 21 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

DefineGlobalColor("BearishReversal",     CreateColor(230, 104, 104));
#DefineGlobalColor("BullishReversal",     CreateColor(104, 230, 104));
DefineGlobalColor("BearishContinuation", CreateColor(255, 174, 174));
#DefineGlobalColor("BullishContinuation", CreateColor(174, 255, 174));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bearish Only Reversals", GlobalColor("BearishReversal"));
AddLabel(ShowMainLabel, "Bearish Only Continuations: 4, 5, 8, 11, 12, 14, 19", GlobalColor("BearishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint ShowBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, high, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AdvanceBlock_1, DarkCloudCover_2, Deliberation_3, DownsideGapThreeMethods_4, DownsideTasukiGap_5, EveningDojiStar_6, EveningStar_7, FallingThreeMethods_8, HangingMan_9, IdenticalThreeCrows_10, InNeck_11, LowPriceGappingPlay_12, OneBlackCrow_13, OnNeck_14, ShootingStar_15, ThreeBlackCrows_16, ThreeInsideDown_17, ThreeOutsideDown_18, Thrusting_19, TwoCrows_20, UpsideGapTwoCrows_21}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AdvanceBlock_1:
    candle1 = if(ShowFirst.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle1 = if(ShowFirst.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle1 = if(ShowFirst.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle1 = if(ShowFirst.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle1 = if(ShowFirst.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle1 = if(ShowFirst.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle1 = if(ShowFirst.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle1 = if(ShowFirst.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle1 = if(ShowFirst.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle1 = if(ShowFirst.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle1 = if(ShowFirst.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle1 = if(ShowFirst.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle1 = if(ShowFirst.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle1 = if(ShowFirst.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle1 = if(ShowFirst.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle1 = if(ShowFirst.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle1 = if(ShowFirst.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle1 = if(ShowFirst.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle1 = if(ShowFirst.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle1 = if(ShowFirst.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle1 = if(ShowFirst.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle1 = Double.NaN;

}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum #############
#########################################################

def candle2;
switch (ShowSecond) {
case AdvanceBlock_1:
    candle2 = if(ShowSecond.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle2 = if(ShowSecond.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle2 = if(ShowSecond.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle2 = if(ShowSecond.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle2 = if(ShowSecond.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle2 = if(ShowSecond.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle2 = if(ShowSecond.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle2 = if(ShowSecond.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle2 = if(ShowSecond.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle2 = if(ShowSecond.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle2 = if(ShowSecond.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle2 = if(ShowSecond.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle2 = if(ShowSecond.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle2 = if(ShowSecond.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle2 = if(ShowSecond.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle2 = if(ShowSecond.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle2 = if(ShowSecond.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle2 = if(ShowSecond.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle2 = if(ShowSecond.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle2 = if(ShowSecond.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle2 = if(ShowSecond.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AdvanceBlock_1:
    candle3 = if(ShowThird.AdvanceBlock(), AdvanceBlock(), Double.NaN);
case DarkCloudCover_2:
    candle3 = if(ShowThird.DarkCloudCover(), DarkCloudCover(), Double.NaN);
case Deliberation_3:
    candle3 = if(ShowThird.Deliberation(), Deliberation(), Double.NaN);
case DownsideGapThreeMethods_4:
    candle3 = if(ShowThird.DownsideGapThreeMethods(), DownsideGapThreeMethods(), Double.NaN);
case DownsideTasukiGap_5:
    candle3 = if(ShowThird.DownsideTasukiGap(), DownsideTasukiGap(), Double.NaN);
case EveningDojiStar_6:
    candle3 = if(ShowThird.EveningDojiStar(), EveningDojiStar(), Double.NaN);
case EveningStar_7:
    candle3 = if(ShowThird.EveningStar(), EveningStar(), Double.NaN);
case FallingThreeMethods_8:
    candle3 = if(ShowThird.FallingThreeMethods(), FallingThreeMethods(), Double.NaN);
case HangingMan_9:
    candle3 = if(ShowThird.HangingMan(), HangingMan(), Double.NaN);
case IdenticalThreeCrows_10:
    candle3 = if(ShowThird.IdenticalThreeCrows(), IdenticalThreeCrows(), Double.NaN);
case InNeck_11:
    candle3 = if(ShowThird.InNeck(), InNeck(), Double.NaN);
case LowPriceGappingPlay_12:
    candle3 = if(ShowThird.LowPriceGappingPlay(), LowPriceGappingPlay(), Double.NaN);
case OneBlackCrow_13:
    candle3 = if(ShowThird.OneBlackCrow(), OneBlackCrow(), Double.NaN);
case OnNeck_14:
    candle3 = if(ShowThird.OnNeck(), OnNeck(), Double.NaN);
case ShootingStar_15:
    candle3 = if(ShowThird.ShootingStar(), ShootingStar(), Double.NaN);
case ThreeBlackCrows_16:
    candle3 = if(ShowThird.ThreeBlackCrows(), ThreeBlackCrows(), Double.NaN);
case ThreeInsideDown_17:
    candle3 = if(ShowThird.ThreeInsideDown(), ThreeInsideDown(), Double.NaN);
case ThreeOutsideDown_18:
    candle3 = if(ShowThird.ThreeOutsideDown(), ThreeOutsideDown(), Double.NaN);
case Thrusting_19:
    candle3 = if(ShowThird.Thrusting(), Thrusting(), Double.NaN);
case  TwoCrows_20:
    candle3 = if(ShowThird.TwoCrows(), TwoCrows(), Double.NaN);
case  UpsideGapTwoCrows_21:
    candle3 = if(ShowThird.UpsideGapTwoCrows(), UpsideGapTwoCrows(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# AdvanceBlock_1
##### 1 ##### AdvanceBlock() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AdvanceBlock_1 then 1 else if ShowSecond == ShowSecond.AdvanceBlock_1 then 2 else if ShowThird == ShowThird.AdvanceBlock_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AdvanceBlock(), Double.NaN);
plot AdvBlk = candleAll_1;
AdvBlk.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
AdvBlk.SetDefaultColor(GlobalColor("BearishReversal"));
AdvBlk.SetLineWeight(5);
AdvBlk.HideTitle();
AdvBlk.HideBubble();
rec AdvancedB_Trig = if(AdvanceBlock().bearish, BarNumber(), AdvancedB_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AdvancedB_Trig > 0, "1=AdvanceBlock", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and AdvanceBlock(), "AdvanceBlockAlert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AdvanceBlock(), BubPos, if BubNumb then "1" else if BubVerb then "AdvanceBlock" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"), yes);

# DarkcloudCover_2
##### 2 ##### DarkCloudCover() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.DarkCloudCover_2 then 1 else if ShowSecond == ShowSecond.DarkCloudCover_2 then 2 else if ShowThird == ShowThird.DarkCloudCover_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, DarkCloudCover(), Double.NaN);
plot DCC = candleAll_2;
DCC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DCC.SetDefaultColor(GlobalColor("BearishReversal"));
DCC.SetLineWeight(5);
DCC.HideTitle();
DCC.HideBubble();
rec DarkCloudCover_Trig = if(DarkCloudCover().bearish, BarNumber(), DarkCloudCover_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and DarkCloudCover_Trig > 0, "2=DarkCloudCover", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and DarkCloudCover(), "DarkCloudCover Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and DarkCloudCover(), BubPos, if BubNumb then "2" else if BubVerb then "DarkCloudCover" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"), yes);

# Deliberation_3
##### 3 ##### Deliberation() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Deliberation_3 then 1 else if ShowSecond == ShowSecond.Deliberation_3 then 2 else if ShowThird == ShowThird.Deliberation_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Deliberation(), Double.NaN);
plot Delib = candleAll_3;
Delib.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Delib.SetDefaultColor(GlobalColor("BearishReversal"));
Delib.SetLineWeight(5);
Delib.HideTitle();
Delib.HideBubble();
rec Deliberation_Trig = if(Deliberation().bearish, BarNumber(), Deliberation_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Deliberation_Trig > 0, "3=Deliberation", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Deliberation(), "Deliberation Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Deliberation(), BubPos, if BubNumb then "3" else if BubVerb then "Deliberation" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"), yes);

# DownsideGapThreeMethods_4
##### 4 ##### DownsideGapThreeMethods() #####
def ThreeShows_4 = if ShowFirst == ShowFirst.DownsideGapThreeMethods_4 then 1 else if ShowSecond == ShowSecond.DownsideGapThreeMethods_4 then 2 else if ShowThird == ShowThird.DownsideGapThreeMethods_4 then 3 else 0;
def candleAll_4 = if(ShowAll and !ThreeShows_4, DownsideGapThreeMethods(), Double.NaN);
plot DGTM = candleAll_4;
DGTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DGTM.SetDefaultColor(GlobalColor("BearishContinuation"));
DGTM.SetLineWeight(5);
DGTM.HideTitle();
DGTM.HideBubble();
rec DownsideGapThreeMethods_Trig = if(DownsideGapThreeMethods().bearish, BarNumber(), DownsideGapThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and DownsideGapThreeMethods_Trig > 0, "4=DownsideGapThreeMethods", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and DownsideGapThreeMethods(), "DownsideGapThreeMethods Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and DownsideGapThreeMethods(), BubPos, if BubNumb then "4" else if BubVerb then "DownsideGapThreeMethods" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BearishContinuation"), yes);

# DownsideTasukiGap_5
##### 5 ##### DownsideTasukiGap() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.DownsideTasukiGap_5 then 1 else if ShowSecond == ShowSecond.DownsideTasukiGap_5 then 2 else if ShowThird == ShowThird.DownsideTasukiGap_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, DownsideTasukiGap(), Double.NaN);
plot DTG = candleAll_5;
DTG.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
DTG.SetDefaultColor(GlobalColor("BearishContinuation"));
DTG.SetLineWeight(5);
DTG.HideTitle();
DTG.HideBubble();
rec DownsideTasukiGap_Trig = if(DownsideTasukiGap().bearish, BarNumber(), DownsideTasukiGap_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and DownsideTasukiGap_Trig > 0, "5=DownsideTasukiGap", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and DownsideTasukiGap(), "DownsideTasukiGap Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and DownsideTasukiGap(), BubPos, if BubNumb then "5" else if BubVerb then "DownsideTasukiGap" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishContinuation"), yes);

# EveningDojiStar_6
##### 6 ##### EveningDojiStar() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.EveningDojiStar_6 then 1 else if ShowSecond == ShowSecond.EveningDojiStar_6 then 2 else if ShowThird == ShowThird.EveningDojiStar_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, EveningDojiStar(), Double.NaN);
plot EDS = candleAll_6;
EDS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
EDS.SetDefaultColor(GlobalColor("BearishReversal"));
EDS.SetLineWeight(5);
EDS.HideTitle();
EDS.HideBubble();
rec EveningDojiStar_Trig = if(EveningDojiStar().bearish, BarNumber(), EveningDojiStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and EveningDojiStar_Trig > 0, "6=EveningDojiStar", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and EveningDojiStar(), "EveningDojiStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and EveningDojiStar(), BubPos, if BubNumb then "6" else if BubVerb then "EveningDojiStar" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"), yes);

# EveningStar_7
##### 7 ##### EveningStar() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.EveningStar_7 then 1 else if ShowSecond == ShowSecond.EveningStar_7 then 2 else if ShowThird == ShowThird.EveningStar_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, EveningStar(), Double.NaN);
plot ES = candleAll_7;
ES.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ES.SetDefaultColor(GlobalColor("BearishReversal"));
ES.SetLineWeight(5);
ES.HideTitle();
ES.HideBubble();
rec EveningStar_Trig = if(EveningStar().bearish, BarNumber(), EveningStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and EveningStar_Trig > 0, "7=EveningStar", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and EveningStar(), "EveningStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and EveningStar(), BubPos, if BubNumb then "7" else if BubVerb then "EveningStar" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"), yes);

# FallingThreeMethods_8
##### 8 ##### FallingThreeMethods() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.FallingThreeMethods_8 then 1 else if ShowSecond == ShowSecond.FallingThreeMethods_8 then 2 else if ShowThird == ShowThird.FallingThreeMethods_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, FallingThreeMethods(), Double.NaN);
plot FTM = candleAll_8;
FTM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
FTM.SetDefaultColor(GlobalColor("BearishContinuation"));
FTM.SetLineWeight(5);
FTM.HideTitle();
FTM.HideBubble();
rec FallingThreeMethods_Trig = if(FallingThreeMethods().bearish, BarNumber(), FallingThreeMethods_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and FallingThreeMethods_Trig > 0, "8=FallingThreeMethods", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and FallingThreeMethods(), "FallingThreeMethods Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and FallingThreeMethods(), BubPos, if BubNumb then "8" else if BubVerb then "FallingThreeMethods" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishContinuation"), yes);

# HangingMan_9
##### 9 ##### HangingMan() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.HangingMan_9 then 1 else if ShowSecond == ShowSecond.HangingMan_9 then 2 else if ShowThird == ShowThird.HangingMan_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, HangingMan(), Double.NaN);
plot HM = candleAll_9;
HM.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
HM.SetDefaultColor(GlobalColor("BearishReversal"));
HM.SetLineWeight(5);
HM.HideTitle();
HM.HideBubble();
rec HangingMan_Trig = if(HangingMan().bearish, BarNumber(), HangingMan_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and HangingMan_Trig > 0, "9=HangingMan", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and HangingMan(), "HangingMan Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and HangingMan(), BubPos, if BubNumb then "9" else if BubVerb then "HangingMan" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"), yes);

# IdenticalThreeCrows_10
##### 10 ##### IdenticalThreeCrows() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.IdenticalThreeCrows_10 then 1 else if ShowSecond == ShowSecond.IdenticalThreeCrows_10 then 2 else if ShowThird == ShowThird.IdenticalThreeCrows_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, IdenticalThreeCrows(), Double.NaN);
plot ITC = candleAll_10;
ITC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ITC.SetDefaultColor(GlobalColor("BearishReversal"));
ITC.SetLineWeight(5);
ITC.HideTitle();
ITC.HideBubble();
rec IdenticalThreeCrows_Trig = if(IdenticalThreeCrows().bearish, BarNumber(), IdenticalThreeCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and IdenticalThreeCrows_Trig > 0, "10=IdenticalThreeCrows", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and IdenticalThreeCrows(), "IdenticalThreeCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and IdenticalThreeCrows(), BubPos, if BubNumb then "10" else if BubVerb then "IdenticalThreeCrows" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishReversal"), yes);

# InNeck_11
##### 11 ##### InNeck() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.InNeck_11 then 1 else if ShowSecond == ShowSecond.InNeck_11 then 2 else if ShowThird == ShowThird.InNeck_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, InNeck(), Double.NaN);
plot IN = candleAll_11;
IN.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
IN.SetDefaultColor(GlobalColor("BearishContinuation"));
IN.SetLineWeight(5);
IN.HideTitle();
IN.HideBubble();
rec InNeck_Trig = if(InNeck().bearish, BarNumber(), InNeck_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and InNeck_Trig > 0, "11=InNeck", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and InNeck(), "InNeck Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and InNeck(), BubPos, if BubNumb then "11" else if BubVerb then "InNeck" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishContinuation"), yes);

# LowPriceGappingPlay_12
##### 12 ##### LowPriceGappingPlay() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.LowPriceGappingPlay_12 then 1 else if ShowSecond == ShowSecond.LowPriceGappingPlay_12 then 2 else if ShowThird == ShowThird.LowPriceGappingPlay_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, LowPriceGappingPlay(), Double.NaN);
plot LPGP = candleAll_12;
LPGP.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
LPGP.SetDefaultColor(GlobalColor("BearishContinuation"));
LPGP.SetLineWeight(5);
LPGP.HideTitle();
LPGP.HideBubble();
rec LowPriceGappingPlay_Trig = if(LowPriceGappingPlay().bearish, BarNumber(), LowPriceGappingPlay_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and LowPriceGappingPlay_Trig > 0, "12=LowPriceGappingPlay", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and LowPriceGappingPlay(), "LowPriceGappingPlay Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and LowPriceGappingPlay(), BubPos, if BubNumb then "12" else if BubVerb then "LowPriceGappingPlay" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"), yes);

# OneBlackCrow_13
##### 13 ##### OneBlackCrow() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.OneBlackCrow_13 then 1 else if ShowSecond == ShowSecond.OneBlackCrow_13 then 2 else if ShowThird == ShowThird.OneBlackCrow_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, OneBlackCrow(), Double.NaN);
plot OBC = candleAll_13;
OBC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
OBC.SetDefaultColor(GlobalColor("BearishReversal"));
OBC.SetLineWeight(5);
OBC.HideTitle();
OBC.HideBubble();
rec OneBlackCrow_Trig = if(OneBlackCrow().bearish, BarNumber(), OneBlackCrow_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and OneBlackCrow_Trig > 0, "13=OneBlackCrow", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and OneBlackCrow(), "OneBlackCrow Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and OneBlackCrow(), BubPos, if BubNumb then "13" else if BubVerb then "OneBlackCrow" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishReversal"), yes);

# OnNeck_14
##### 14 ##### OnNeck() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.OnNeck_14 then 1 else if ShowSecond == ShowSecond.OnNeck_14 then 2 else if ShowThird == ShowThird.OnNeck_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, OnNeck(), Double.NaN);
plot ON = candleAll_14;
ON.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ON.SetDefaultColor(GlobalColor("BearishContinuation"));
ON.SetLineWeight(5);
ON.HideTitle();
ON.HideBubble();
rec OnNeck_Trig = if(OnNeck().bearish, BarNumber(), OnNeck_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and OnNeck_Trig > 0, "14=OnNeck", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and OnNeck(), "OnNeck Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and OnNeck(), BubPos, if BubNumb then "14" else if BubVerb then "OnNeck" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"), yes);

# ShootingStar_15
##### 15 ##### ShootingStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.ShootingStar_15 then 1 else if ShowSecond == ShowSecond.ShootingStar_15 then 2 else if ShowThird == ShowThird.ShootingStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, ShootingStar(), Double.NaN);
plot SS = candleAll_15;
SS.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SS.SetDefaultColor(GlobalColor("BearishReversal"));
SS.SetLineWeight(5);
SS.HideTitle();
SS.HideBubble();
rec ShootingStar_Trig = if(ShootingStar().bearish, BarNumber(), ShootingStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and ShootingStar_Trig > 0, "15=ShootingStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ShootingStar(), "ShootingStar Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and ShootingStar(), BubPos, if BubNumb then "15" else if BubVerb then "ShootingStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeBlackCrows_16
##### 16 ##### ThreeBlackCrows() #####
def ThreeShows_16 = if ShowFirst == ShowFirst.ThreeBlackCrows_16 then 1 else if ShowSecond == ShowSecond.ThreeBlackCrows_16 then 2 else if ShowThird == ShowThird.ThreeBlackCrows_16 then 3 else 0;
def candleAll_16 = if(ShowAll and !ThreeShows_16, ThreeBlackCrows(), Double.NaN);
plot TBC = candleAll_16;
TBC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TBC.SetDefaultColor(GlobalColor("BearishReversal"));
TBC.SetLineWeight(5);
TBC.HideTitle();
TBC.HideBubble();
rec ThreeBlackCrows_Trig = if(ThreeBlackCrows().bearish, BarNumber(), ThreeBlackCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and ThreeBlackCrows_Trig > 0, "16=ThreeBlackCrows", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeBlackCrows(), "ThreeBlackCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and ThreeBlackCrows(), BubPos, if BubNumb then "16" else if BubVerb then "ThreeBlackCrows" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeInsideDown_17
##### 17 ##### ThreeInsideDown() #####
def ThreeShows_17 = if ShowFirst == ShowFirst.ThreeInsideDown_17 then 1 else if ShowSecond == ShowSecond.ThreeInsideDown_17 then 2 else if ShowThird == ShowThird.ThreeInsideDown_17 then 3 else 0;
def candleAll_17 = if(ShowAll and !ThreeShows_17, ThreeInsideDown(), Double.NaN);
plot TID = candleAll_17;
TID.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TID.SetDefaultColor(GlobalColor("BearishReversal"));
TID.SetLineWeight(5);
TID.HideTitle();
TID.HideBubble();
rec ThreeInsideDown_Trig = if(DarkCloudCover().bearish, BarNumber(), ThreeInsideDown_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ThreeInsideDown_Trig > 0, "17=ThreeInsideDown", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeInsideDown(), "ThreeInsideDown Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ThreeInsideDown(), BubPos, if BubNumb then "17" else if BubVerb then "ThreeInsideDown" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BearishReversal"), yes);

# ThreeOutsideDown_18
##### 18 ##### ThreeOutsideDown() #####
def ThreeShows_18 = if ShowFirst == ShowFirst.ThreeOutsideDown_18 then 1 else if ShowSecond == ShowSecond.ThreeOutsideDown_18 then 2 else if ShowThird == ShowThird.ThreeOutsideDown_18 then 3 else 0;
def candleAll_18 = if(ShowAll and !ThreeShows_18, ThreeOutsideDown(), Double.NaN);
plot TOD = candleAll_18;
TOD.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TOD.SetDefaultColor(GlobalColor("BearishReversal"));
TOD.SetLineWeight(5);
TOD.HideTitle();
TOD.HideBubble();
rec ThreeOutsideDown_Trig = if(DarkCloudCover().bearish, BarNumber(), ThreeOutsideDown_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_18) and ThreeOutsideDown_Trig > 0, "18=ThreeOutsideDown", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and ThreeOutsideDown(), "ThreeOutsideDown Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_18) and ThreeOutsideDown(), BubPos, if BubNumb then "18" else if BubVerb then "ThreeOutsideDown" else "", GlobalColor(if ThreeShows_18 == 1 then "Show1st" else if ThreeShows_18 == 2 then "Show2nd" else if ThreeShows_18 == 3 then "Show3rd" else "BearishReversal"), yes);

# Thrusting_19
##### 19 ##### Thrusting() #####
def ThreeShows_19 = if ShowFirst == ShowFirst.Thrusting_19 then 1 else if ShowSecond == ShowSecond.Thrusting_19 then 2 else if ShowThird == ShowThird.Thrusting_19 then 3 else 0;
def candleAll_19 = if(ShowAll and !ThreeShows_19, Thrusting(), Double.NaN);
plot Thrust = candleAll_19;
Thrust.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Thrust.SetDefaultColor(GlobalColor("BearishContinuation"));
Thrust.SetLineWeight(5);
Thrust.HideTitle();
Thrust.HideBubble();
rec Thrusting_Trig = if(DarkCloudCover().bearish, BarNumber(), Thrusting_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_19) and Thrusting_Trig > 0, "19=Thrusting", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and Thrusting(), "Thrusting Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_19) and Thrusting(), BubPos, if BubNumb then "19" else if BubVerb then "Thrusting" else "", GlobalColor(if ThreeShows_19 == 1 then "Show1st" else if ThreeShows_19 == 2 then "Show2nd" else if ThreeShows_19 == 3 then "Show3rd" else "BearishContinuation"), yes);

# TwoCrows_20
##### 20 ##### TwoCrows() #####
def ThreeShows_20 = if ShowFirst == ShowFirst.TwoCrows_20 then 1 else if ShowSecond == ShowSecond.TwoCrows_20 then 2 else if ShowThird == ShowThird.TwoCrows_20 then 3 else 0;
def candleAll_20 = if(ShowAll and !ThreeShows_20, TwoCrows(), Double.NaN);
plot TC = candleAll_20;
TC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TC.SetDefaultColor(GlobalColor("BearishReversal"));
TC.SetLineWeight(5);
TC.HideTitle();
TC.HideBubble();
rec TwoCrows_Trig = if(TwoCrows().bearish, BarNumber(), TwoCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_20) and TwoCrows_Trig > 0, "20=TwoCrows", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and TwoCrows(), "TwoCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_20) and TwoCrows(), BubPos, if BubNumb then "20" else if BubVerb then "TwoCrows" else "", GlobalColor(if ThreeShows_20 == 1 then "Show1st" else if ThreeShows_20 == 2 then "Show2nd" else if ThreeShows_20 == 3 then "Show3rd" else "BearishReversal"), yes);

# UpsideGapTwoCrows_21
##### 21 ##### UpsideGapTwoCrows() #####
def ThreeShows_21 = if ShowFirst == ShowFirst.UpsideGapTwoCrows_21 then 1 else if ShowSecond == ShowSecond.UpsideGapTwoCrows_21 then 2 else if ShowThird == ShowThird.UpsideGapTwoCrows_21 then 3 else 0;
def candleAll_21 = if(ShowAll and !ThreeShows_21, UpsideGapTwoCrows(), Double.NaN);
plot UGTC = candleAll_21;
UGTC.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
UGTC.SetDefaultColor(GlobalColor("BearishReversal"));
UGTC.SetLineWeight(5);
UGTC.HideTitle();
UGTC.HideBubble();
rec UpsideGapTwoCrows_Trig = if(DarkCloudCover().bearish, BarNumber(), UpsideGapTwoCrows_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_21) and UpsideGapTwoCrows_Trig > 0, "21=UpsideGapTwoCrows", GlobalColor(if ThreeShows_21 == 1 then "Show1st" else if ThreeShows_21 == 2 then "Show2nd" else if ThreeShows_21 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and UpsideGapTwoCrows(), "UpsideGapTwoCrows Alert", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_21) and UpsideGapTwoCrows(), BubPos, if BubNumb then "21" else if BubVerb then "UpsideGapTwoCrows" else "", GlobalColor(if ThreeShows_21 == 1 then "Show1st" else if ThreeShows_21 == 2 then "Show2nd" else if ThreeShows_21 == 3 then "Show3rd" else "BearishReversal"), yes);

# End Code

Bullish_AND_Bearish_Bullish_Patterns_Only http://tos.mx/!NSGfbucB
View attachment 21969
Code:
# Bullish_AND_Bearish_Bullish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bullish_AND_Bearish_Bullish_Patterns_Only: Plots and identifies all 17 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#shows all bullish Only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bull. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

#DefineGlobalColor("BearishReversal",     CreateColor(230, 154,   0));
DefineGlobalColor("BullishReversal",     CreateColor(  0, 154, 230));
#DefineGlobalColor("BearishContinuation", CreateColor(255, 211,  77));
DefineGlobalColor("BullishContinuation", CreateColor( 77, 211, 255));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bull & Bear Bullish Only Reversals", GlobalColor("BullishReversal"));
AddLabel(ShowMainLabel, "Bull & Bear Bullish Only Continuations: 10, 12, 13, 14", GlobalColor("BullishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number}; #Hint showBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, low, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AbandonedBaby_1:
    candle1 = if(ShowFirst.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle1 = if(ShowFirst.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle1 = if(ShowFirst.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle1 = if(ShowFirst.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle1 = if(ShowFirst.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle1 = if(ShowFirst.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle1 = if(ShowFirst.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle1 = if(ShowFirst.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle1 = if(ShowFirst.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle1 = if(ShowFirst.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle1 = if(ShowFirst.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle1 = if(ShowFirst.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle1 = if(ShowFirst.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle1 = if(ShowFirst.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle1 = if(ShowFirst.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle1 = if(ShowFirst.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle1 = if(ShowFirst.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case AbandonedBaby_1:
    candle2 = if(ShowSecond.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle2 = if(ShowSecond.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle2 = if(ShowSecond.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle2 = if(ShowSecond.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle2 = if(ShowSecond.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle2 = if(ShowSecond.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle2 = if(ShowSecond.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle2 = if(ShowSecond.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle2 = if(ShowSecond.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle2 = if(ShowSecond.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle2 = if(ShowSecond.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle2 = if(ShowSecond.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle2 = if(ShowSecond.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle2 = if(ShowSecond.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle2 = if(ShowSecond.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle2 = if(ShowSecond.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle2 = if(ShowSecond.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AbandonedBaby_1:
    candle3 = if(ShowThird.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);   # edited in .bull.need to do this  for.bearish for all
case BeltHold_2:
    candle3 = if(ShowThird.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle3 = if(ShowThird.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle3 = if(ShowThird.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle3 = if(ShowThird.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle3 = if(ShowThird.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle3 = if(ShowThird.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle3 = if(ShowThird.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle3 = if(ShowThird.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle3 = if(ShowThird.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle3 = if(ShowThird.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle3 = if(ShowThird.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle3 = if(ShowThird.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle3 = if(ShowThird.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle3 = if(ShowThird.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle3 = if(ShowThird.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle3 = if(ShowThird.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

# AbandonedBaby_1
##### 1 ##### AbandonedBaby() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AbandonedBaby_1 then 1 else if ShowSecond == ShowSecond.AbandonedBaby_1 then 2 else if ShowThird == ShowThird.AbandonedBaby_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AbandonedBaby().bullish, Double.NaN);
plot AB = candleAll_1;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
AB.SetDefaultColor(GlobalColor("BullishReversal"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec AbandonedBaby_Trig = if(AbandonedBaby().bullish, BarNumber(), AbandonedBaby_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AbandonedBaby_Trig > 0, "1=AbandonedBaby", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and AbandonedBaby().bullish, "AbandonedBaby", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AbandonedBaby().bullish, BubPos, if BubNumb then "1" else if BubVerb then "AbandonedBaby" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BullishReversal"), no);

# BeltHold_2
##### 2 ##### BeltHold() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.BeltHold_2 then 1 else if ShowSecond == ShowSecond.BeltHold_2 then 2 else if ShowThird == ShowThird.BeltHold_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, BeltHold().bullish, Double.NaN);
plot BH = candleAll_2;
BH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
BH.SetDefaultColor(GlobalColor("BullishReversal"));
BH.SetLineWeight(5);
BH.HideTitle();
BH.HideBubble();
rec BeltHold_Trig = if(BeltHold().bullish, BarNumber(), BeltHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and BeltHold_Trig > 0, "2=BeltHold", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and BeltHold().bullish, "BeltHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and BeltHold().bullish, BubPos, if BubNumb then "2" else if BubVerb then "BeltHold" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BullishReversal"), no);

# Breakaway_3
##### 3 ##### Breakaway() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Breakaway_3 then 1 else if ShowSecond == ShowSecond.Breakaway_3 then 2 else if ShowThird == ShowThird.Breakaway_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Breakaway().bullish, Double.NaN);
plot BAWAY = candleAll_3;
BAWAY.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
BAWAY.SetDefaultColor(GlobalColor("BullishReversal"));
BAWAY.SetLineWeight(5);
BAWAY.HideTitle();
BAWAY.HideBubble();
rec Breakaway_Trig = if(Breakaway().bullish, BarNumber(), Breakaway_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Breakaway_Trig > 0, "3=Breakaway", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Breakaway().bullish, "Breakaway", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Breakaway(), BubPos, if BubNumb then "3" else if BubVerb then "Breakaway" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BullishReversal"), no);

# Doji_4
##### 4 ##### Doji() #####
#def ThreeShows_4 = if ShowFirst == ShowFirst.Doji_4 then 1 else if ShowSecond == ShowSecond.Doji_4 then 2 else if ShowThird == ShowThird.Doji_4 then 3 else 0;
#def candleAll_4 = if(ShowAll and !ThreeShows_4, Doji(), Double.NaN);
#plot DOJI = candleAll_4;
#DOJI.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#DOJI.HideTitle();
#DOJI.HideBubble();
#rec Doji_Trig = if(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and Doji_Trig > 0, "4=Doji", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and Doji(), "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and Doji(), BubPos, if BubNumb then "4" else if BubVerb then "Doji" else "", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "BullishReversal"), no);

# Engulfing_5
##### 5 ##### Engulfing() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.Engulfing_5 then 1 else if ShowSecond == ShowSecond.Engulfing_5 then 2 else if ShowThird == ShowThird.Engulfing_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, Engulfing().bullish, Double.NaN);
plot Engulfing = candleAll_5;
Engulfing.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Engulfing.SetDefaultColor(GlobalColor("BullishReversal"));
Engulfing.SetLineWeight(5);
Engulfing.HideTitle();
Engulfing.HideBubble();
rec Engulfing_Trig = if(Engulfing().bullish, BarNumber(), Engulfing_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and Engulfing_Trig > 0, "5=Engulfing", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Engulfing().bullish, "Engulfing", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and Engulfing().bullish, BubPos, if BubNumb then "5" else if BubVerb then "Engulfing" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BullishReversal"), no);

# Harami_6
##### 6 ##### Harami() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.Harami_6 then 1 else if ShowSecond == ShowSecond.Harami_6 then 2 else if ShowThird == ShowThird.Harami_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, Harami().bullish, Double.NaN);
plot Harami = candleAll_6;
Harami.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Harami.SetDefaultColor(GlobalColor("BullishReversal"));
Harami.SetLineWeight(5);
Harami.HideTitle();
Harami.HideBubble();
rec Harami_Trig = if(Harami().bullish, BarNumber(), Harami_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and Harami_Trig > 0, "6=Harami", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Harami().bullish, "Harami", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and Harami().bullish, BubPos, if BubNumb then "6" else if BubVerb then "Harami" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BullishReversal"), no);

# HaramiCross_7
##### 7 ##### HaramiCross() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.HaramiCross_7 then 1 else if ShowSecond == ShowSecond.HaramiCross_7 then 2 else if ShowThird == ShowThird.HaramiCross_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, HaramiCross().bullish, Double.NaN);
plot HaramiCross = candleAll_7;
HaramiCross.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
HaramiCross.SetDefaultColor(GlobalColor("BullishReversal"));
HaramiCross.SetLineWeight(5);
HaramiCross.HideTitle();
HaramiCross.HideBubble();
rec HaramiCross_Trig = if(HaramiCross().bullish, BarNumber(), HaramiCross_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and HaramiCross_Trig > 0, "7=HaramiCross", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and HaramiCross().bullish, "HaramiCross", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and HaramiCross().bullish, BubPos, if BubNumb then "7" else if BubVerb then "HaramiCross" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BullishReversal"), no);

# Kicking_8
##### 8 ##### BeltHold() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.Kicking_8 then 1 else if ShowSecond == ShowSecond.Kicking_8 then 2 else if ShowThird == ShowThird.Kicking_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, Kicking().bullish, Double.NaN);
plot Kicking = candleAll_8;
Kicking.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Kicking.SetDefaultColor(GlobalColor("BullishReversal"));
Kicking.SetLineWeight(5);
Kicking.HideTitle();
Kicking.HideBubble();
rec Kicking_Trig = if(Kicking().bullish, BarNumber(), Kicking_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and Kicking_Trig > 0, "8=Kicking", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and Kicking().bullish, "Kicking", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and Kicking().bullish, BubPos, if BubNumb then "8" else if BubVerb then "Kicking" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BullishReversal"), no);

# LongLeggedDoji_9
##### 9 ##### LongLeggedDoji() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.LongLeggedDoji_9 then 1 else if ShowSecond == ShowSecond.LongLeggedDoji_9 then 2 else if ShowThird == ShowThird.LongLeggedDoji_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, LongLeggedDoji().bullish, Double.NaN);
plot LongLeggedDoji = candleAll_9;
LongLeggedDoji.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
LongLeggedDoji.SetDefaultColor(GlobalColor("BullishReversal"));
LongLeggedDoji.SetLineWeight(5);
LongLeggedDoji.HideTitle();
LongLeggedDoji.HideBubble();
rec LongLeggedDoji_Trig = if(LongLeggedDoji().bullish, BarNumber(), LongLeggedDoji_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and LongLeggedDoji_Trig > 0, "9=LongLeggedDoji", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and LongLeggedDoji().bullish, "LongLeggedDoji", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and LongLeggedDoji().bullish, BubPos, if BubNumb then "9" else if BubVerb then "LongLeggedDoji" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BullishReversal"), no);

# Marubozu_10
##### 10 ##### Marubozu() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.Marubozu_10 then 1 else if ShowSecond == ShowSecond.Marubozu_10 then 2 else if ShowThird == ShowThird.Marubozu_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, Marubozu().bullish, Double.NaN);
plot Marubozu = candleAll_10;
Marubozu.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
Marubozu.SetDefaultColor(GlobalColor("BullishContinuation"));
Marubozu.SetLineWeight(5);
Marubozu.HideTitle();
Marubozu.HideBubble();
rec Marubozu_Trig = if(Marubozu().bullish, BarNumber(), Marubozu_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and Marubozu_Trig > 0, "10=Marubozu", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and Marubozu().bullish, "Marubozu", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and Marubozu().bullish, BubPos, if BubNumb then "10" else if BubVerb then "Marubozu" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BullishContinuation"), no);

# MeetingLines_11
##### 11 ##### MeetingLines() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.MeetingLines_11 then 1 else if ShowSecond == ShowSecond.MeetingLines_11 then 2 else if ShowThird == ShowThird.MeetingLines_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, MeetingLines().bullish, Double.NaN);
plot MeetingLines = candleAll_11;
MeetingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
MeetingLines.SetDefaultColor(GlobalColor("BullishReversal"));
MeetingLines.SetLineWeight(5);
MeetingLines.HideTitle();
MeetingLines.HideBubble();
rec MeetingLines_Trig = if(MeetingLines().bullish, BarNumber(), MeetingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and MeetingLines_Trig > 0, "11=MeetingLines", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and MeetingLines().bullish, "MeetingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and MeetingLines().bullish, BubPos, if BubNumb then "1" else if BubVerb then "MeetingLines" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BullishReversal"), no);

# SeparatingLines_12
##### 12 ##### SeparatingLines() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.SeparatingLines_12 then 1 else if ShowSecond == ShowSecond.SeparatingLines_12 then 2 else if ShowThird == ShowThird.SeparatingLines_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, SeparatingLines().bullish, Double.NaN);
plot SeparatingLines = candleAll_12;
SeparatingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SeparatingLines.SetDefaultColor(GlobalColor("BullishContinuation"));
SeparatingLines.SetLineWeight(5);
SeparatingLines.HideTitle();
SeparatingLines.HideBubble();
rec SeparatingLines_Trig = if(SeparatingLines().bullish, BarNumber(), SeparatingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and SeparatingLines_Trig > 0, "12=SeparatingLines", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and SeparatingLines().bullish, "SeparatingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and SeparatingLines().bullish, BubPos, if BubNumb then "12" else if BubVerb then "SeparatingLines" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BullishContinuation"), no);

# SideBySideWhiteLines_13
##### 13 ##### SideBySideWhiteLines() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.SideBySideWhiteLines_13 then 1 else if ShowSecond == ShowSecond.SideBySideWhiteLines_13 then 2 else if ShowThird == ShowThird.SideBySideWhiteLines_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, SideBySideWhiteLines().bullish, Double.NaN);
plot SideBySideWhiteLines = candleAll_13;
SideBySideWhiteLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
SideBySideWhiteLines.SetDefaultColor(GlobalColor("BullishContinuation"));
SideBySideWhiteLines.SetLineWeight(5);
SideBySideWhiteLines.HideTitle();
SideBySideWhiteLines.HideBubble();
rec SideBySideWhiteLines_Trig = if(SideBySideWhiteLines().bullish, BarNumber(), SideBySideWhiteLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and SideBySideWhiteLines_Trig > 0, "13=SideBySideWhiteLines", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and SideBySideWhiteLines().bullish, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and SideBySideWhiteLines().bullish, BubPos, if BubNumb then "13" else if BubVerb then "SideBySideWhiteLines" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BullishContinuation"), no);

# ThreeLineStrike_14
##### 14 ##### ThreeLineStrike() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeLineStrike_14 then 1 else if ShowSecond == ShowSecond.ThreeLineStrike_14 then 2 else if ShowThird == ShowThird.ThreeLineStrike_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeLineStrike().bullish, Double.NaN);
plot ThreeLineStrike = candleAll_14;
ThreeLineStrike.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
ThreeLineStrike.SetDefaultColor(GlobalColor("BullishContinuation"));
ThreeLineStrike.SetLineWeight(5);
ThreeLineStrike.HideTitle();
ThreeLineStrike.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeLineStrike().bullish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeOutsideUp_Trig > 0, "14=ThreeLineStrike", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishContinuation"));
Alert(UseAlert and ThreeLineStrike().bullish, "ThreeLineStrike", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeLineStrike().bullish, BubPos, if BubNumb then "14" else if BubVerb then "ThreeLineStrike" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BullishContinuation"), no);

# TriStar_15
##### 15 ##### TriStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.TriStar_15 then 1 else if ShowSecond == ShowSecond.TriStar_15 then 2 else if ShowThird == ShowThird.TriStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, TriStar(), Double.NaN);
plot TriStar = candleAll_15;
TriStar.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
TriStar.SetDefaultColor(GlobalColor("BullishReversal"));
TriStar.SetLineWeight(5);
TriStar.HideTitle();
TriStar.HideBubble();
rec TriStar_Trig = if(TriStar().bullish, BarNumber(), TriStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and TriStar_Trig > 0, "15=TriStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"));
Alert(UseAlert and TriStar().bullish, "TriStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and TriStar().bullish, BubPos, if BubNumb then "15" else if BubVerb then "TriStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BullishReversal"), no);

# WilliamsFractal_16
##### 16 ##### WilliamsFractal() #####
#def ThreeShows_16 = if ShowFirst == ShowFirst.WilliamsFractal_16 then 1 else if ShowSecond == ShowSecond.WilliamsFractal_16 then 2 else if ShowThird == ShowThird.WilliamsFractal_16 then 3 else 0;
#def candleAll_16 = if(ShowAll and !ThreeShows_16, WilliamsFractal().UpFractal, Double.NaN);
#plot WilliamsFractal = candleAll_16;
#WilliamsFractal.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#WilliamsFractal.SetDefaultColor(GlobalColor("BullishReversal"));
#WilliamsFractal.SetLineWeight(5);
#WilliamsFractal.HideTitle();
#WilliamsFractal.HideBubble();
#rec WilliamsFractal_Trig_upfractal = if(WilliamsFractal().upfractal, BarNumber(), WilliamsFractal_Trig_upfractal[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and WilliamsFractal_Trig_upfractal > 0, "16=WilliamsFractal", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and WilliamsFractal().upfractal, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and WilliamsFractal().upfractal, BubPos, if BubNumb then "16" else if BubVerb then "WilliamsFractal" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "BullishReversal"), no);

# ZigZagStepPattern_17
##### 17 ##### ZigZagStepPattern() #####
#def ThreeShows_17 = if ShowFirst == ShowFirst.ZigZagStepPattern_17 then 1 else if ShowSecond == ShowSecond.ZigZagStepPattern_17 then 2 else if ShowThird == ShowThird.ZigZagStepPattern_17 then 3 else 0;
#def candleAll_17 = if(ShowAll and !ThreeShows_17, ZigZagStepPattern(), Double.NaN);
#plot ZigZagStepPattern = candleAll_17;
#ZigZagStepPattern.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_UP, PaintingStrategy.BOOLEAN_WEDGE_UP));
#ZigZagStepPattern.SetDefaultColor(GlobalColor("BullishReversal"));
#ZigZagStepPattern.SetLineWeight(5);
#ZigZagStepPattern.HideTitle();
#ZigZagStepPattern.HideBubble();
#rec ZigZagStepPattern_Trig_upstep = if(ZigZagStepPattern().upstep, BarNumber(), ZigZagStepPattern_Trig_upstep[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ZigZagStepPattern_Trig_upstep > 0, "17=ZigZagStepPattern", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"));
#Alert(UseAlert and ZigZagStepPattern().upstep, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ZigZagStepPattern().upstep, BubPos, if BubNumb then "17" else if BubVerb then "ZigZagStepPattern" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "BullishReversal"), no);

# End Code

Bullish_AND_Bearish_Bearish_Patterns_Only http://tos.mx/!uKEu59N9
View attachment 21970
Code:
# Bullish_AND_Bearish_Bearish_Patterns_Only
# StanL
# Report any problems to 'StanL' on TOS ThinkScript Lounge
# https://usethinkscript.com/threads/automatic-patterns-studies-bull-bear-bullish-only-bearish-only-for-thinkorswim.6062/

#Hint: Bullish_AND_Bearish_Bearish_Patterns_Only: Plots and identifies all 17 candlesticks or 3 individually selected candlesticks. Can be used with any aggregation period. Alerts, labels, and bubbles may be toggled on/off. Within 'edit studies', any candle pattern can be isolated. A number-ID system is incorporated to enhance chart readability or the candle names may be used.

#shows all bearish Only patterns of the bullish and bearish patterns on TOS except for #Diji, #Williams Fractural & #ZigZagPattern due to diji plotting too much, #williams fractural and #zigzag would be added on the addBubble but wouldn't plot the addlabel section probably due to their complex nature.I #'ed them out so anyone who wants to have a go at it can have at it. Also notice how those 3 have different plot terms instead of bearish/bull. #Doji is plotted at doji, # Williamns Fractal is plotted as upfractal and downfractal, and #ZigzagPattern is plotted as Upstep and Downstep.

# reformated by mourningwood4521 on usethinkscript to go in order of libray terms as of March 2021

# reformated by krush on usethinkscript 5/26/2024
# - added 'once_per_bar'
# - added option to turn off main labels
# - added GlobalColors for customization
# - changed colors to be easier to differentiate
# - added separate colors for ThreeShows for easier identification
# - optimized conditionals
# - reduced code duplication (combined the code for ThreeShows & ShowAll)
# - removed hard-coded bubble offset, now it will just use BOOLEAN_WEDGE_DOWN/BOOLEAN_WEDGE_UP when bubbles are showing
# - hide all plot titles/bubbles to clean up the spam in the data
# - ThreeShows and ShowAll no longer create two identical plots if both show the same candle

declare once_per_bar;
declare upper;

DefineGlobalColor("Show1st",             CreateColor(242, 242, 242));
DefineGlobalColor("Show2nd",             CreateColor(255, 255, 255));
DefineGlobalColor("Show3rd",             CreateColor(217, 217, 217));

DefineGlobalColor("BearishReversal",     CreateColor(230, 154,   0));
#DefineGlobalColor("BullishReversal",     CreateColor(  0, 154, 230));
DefineGlobalColor("BearishContinuation", CreateColor(255, 211,  77));
#DefineGlobalColor("BullishContinuation", CreateColor( 77, 211, 255));

input UseAlert = no;#Hint UseAlert:Turns on and off the alerts for any selected label that shows

input ShowMainLabel = yes;#Hint ShowLabel:Turns on and off the showing main labels for coloring reference

AddLabel(ShowMainLabel, "Bull & Bear Bearish Only Reversals", GlobalColor("BearishReversal"));
AddLabel(ShowMainLabel, "Bull & Bear Bearish Only Continuations: 10, 12, 13, 14", GlobalColor("BearishContinuation"));

input ShowLabel = no;#Hint ShowLabel:Turns on and off the showing of candle names in labels atop the plot

input ShowBubble = {default None, Verbose, ID_Number};#Hint showBubble:Choice of what format the candle bubble ID should have

def BubNone = if(ShowBubble == ShowBubble.None,      1, 0);
def BubVerb = if(ShowBubble == ShowBubble.Verbose,   1, 0);
def BubNumb = if(ShowBubble == ShowBubble.ID_Number, 1, 0);

def BubPos  = if(!BubNone, high, Double.NaN);

input ShowAll = yes;#Hint ShowAll:A YES shows all candle where they exist. NO yturns off this plot so that individual candles may be selected in ShowFirst, ShowSecond or ShowThird.

##########################################################
############ Define the three selection Enums ############
##########################################################

input ShowFirst  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowFirst:Select the candle to show

input ShowSecond = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowSecond:Select the candle to show

input ShowThird  = {default None, AbandonedBaby_1, BeltHold_2, Breakaway_3, Doji_4, Engulfing_5, Harami_6, HaramiCross_7, Kicking_8, LongLeggedDoji_9, Marubozu_10, MeetingLines_11, SeparatingLines_12, SideBySideWhiteLines_13, ThreeLineStrike_14, TriStar_15, WilliamsFractal_16, ZigZagStepPattern_17}; #Hint ShowThird:Select the candle to show

#########################################################
############ Process Input 'ShowFirst' Enum #############
#########################################################

def candle1;
switch (ShowFirst) {
case AbandonedBaby_1:
    candle1 = if(ShowFirst.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle1 = if(ShowFirst.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle1 = if(ShowFirst.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle1 = if(ShowFirst.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle1 = if(ShowFirst.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle1 = if(ShowFirst.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle1 = if(ShowFirst.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle1 = if(ShowFirst.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle1 = if(ShowFirst.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle1 = if(ShowFirst.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle1 = if(ShowFirst.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle1 = if(ShowFirst.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle1 = if(ShowFirst.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle1 = if(ShowFirst.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle1 = if(ShowFirst.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle1 = if(ShowFirst.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle1 = if(ShowFirst.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle1 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show1st = candle1;
Show1st.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show1st.SetDefaultColor(GlobalColor("Show1st"));
Show1st.SetLineWeight(5);
Show1st.HideTitle();
Show1st.HideBubble();

#########################################################
############ Process Input 'ShowSecond' Enum ############
#########################################################

def candle2;
switch (ShowSecond) {
case AbandonedBaby_1:
    candle2 = if(ShowSecond.AbandonedBaby(), AbandonedBaby(), Double.NaN);
case BeltHold_2:
    candle2 = if(ShowSecond.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle2 = if(ShowSecond.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle2 = if(ShowSecond.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle2 = if(ShowSecond.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle2 = if(ShowSecond.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle2 = if(ShowSecond.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle2 = if(ShowSecond.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle2 = if(ShowSecond.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle2 = if(ShowSecond.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle2 = if(ShowSecond.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle2 = if(ShowSecond.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle2 = if(ShowSecond.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle2 = if(ShowSecond.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle2 = if(ShowSecond.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle2 = if(ShowSecond.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle2 = if(ShowSecond.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle2 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show2nd = candle2;
Show2nd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show2nd.SetDefaultColor(GlobalColor("Show2nd"));
Show2nd.SetLineWeight(5);
Show2nd.HideTitle();
Show2nd.HideBubble();

#########################################################
############ Process Input 'ShowThird' Enum #############
#########################################################

def candle3;
switch (ShowThird) {
case AbandonedBaby_1:
    candle3 = if(ShowThird.AbandonedBaby(), AbandonedBaby().bullish, Double.NaN);
# edited in .bull.need to do this  for.bearish for all
case BeltHold_2:
    candle3 = if(ShowThird.BeltHold(), BeltHold(), Double.NaN);
case Breakaway_3:
    candle3 = if(ShowThird.Breakaway(), Breakaway(), Double.NaN);
case Doji_4:
    candle3 = if(ShowThird.Doji(), Doji(), Double.NaN);
case Engulfing_5:
    candle3 = if(ShowThird.Engulfing(), Engulfing(), Double.NaN);
case Harami_6:
    candle3 = if(ShowThird.Harami(), Harami(), Double.NaN);
case HaramiCross_7:
    candle3 = if(ShowThird.HaramiCross(), HaramiCross(), Double.NaN);
case Kicking_8:
    candle3 = if(ShowThird.Kicking(), Kicking(), Double.NaN);
case LongLeggedDoji_9:
    candle3 = if(ShowThird.LongLeggedDoji(), LongLeggedDoji(), Double.NaN);
case Marubozu_10:
    candle3 = if(ShowThird.Marubozu(), Marubozu(), Double.NaN);
case MeetingLines_11:
    candle3 = if(ShowThird.MeetingLines(), MeetingLines(), Double.NaN);
case SeparatingLines_12:
    candle3 = if(ShowThird.SeparatingLines(), SeparatingLines(), Double.NaN);
case SideBySideWhiteLines_13:
    candle3 = if(ShowThird.SideBySideWhiteLines(), SideBySideWhiteLines(), Double.NaN);
case ThreeLineStrike_14:
    candle3 = if(ShowThird.ThreeLineStrike(), ThreeLineStrike(), Double.NaN);
case TriStar_15:
    candle3 = if(ShowThird.TriStar(), TriStar(), Double.NaN);
case WilliamsFractal_16:
    candle3 = if(ShowThird.WilliamsFractal(), WilliamsFractal(), Double.NaN);
case ZigZagStepPattern_17:
    candle3 = if(ShowThird.ZigZagStepPattern(), ZigZagStepPattern(), Double.NaN);
case None:
    candle3 = Double.NaN;
}  # Closing of switch (ShowFirst) {

plot Show3rd = candle3;
Show3rd.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Show3rd.SetDefaultColor(GlobalColor("Show3rd"));
Show3rd.SetLineWeight(5);
Show3rd.HideTitle();
Show3rd.HideBubble();

##############################################################################

#  AbandonedBaby_1
##### 1 ##### AbandonedBaby() #####
def ThreeShows_1 = if ShowFirst == ShowFirst.AbandonedBaby_1 then 1 else if ShowSecond == ShowSecond.AbandonedBaby_1 then 2 else if ShowThird == ShowThird.AbandonedBaby_1 then 3 else 0;
def candleAll_1 = if(ShowAll and !ThreeShows_1, AbandonedBaby().bearish, Double.NaN);
plot AB = candleAll_1;
AB.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
AB.SetDefaultColor(GlobalColor("BearishReversal"));
AB.SetLineWeight(5);
AB.HideTitle();
AB.HideBubble();
rec AbandonedBaby_Trig = if(AbandonedBaby().bearish, BarNumber(), AbandonedBaby_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_1) and AbandonedBaby_Trig > 0, "1=AbandonedBaby", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and AbandonedBaby().bearish, "AbandonedBaby", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_1) and AbandonedBaby().bearish, BubPos, if BubNumb then "1" else if BubVerb then "AbandonedBaby" else "", GlobalColor(if ThreeShows_1 == 1 then "Show1st" else if ThreeShows_1 == 2 then "Show2nd" else if ThreeShows_1 == 3 then "Show3rd" else "BearishReversal"), yes);  #BubVerb

# BeltHold_2
##### 2 ##### BeltHold() #####
def ThreeShows_2 = if ShowFirst == ShowFirst.BeltHold_2 then 1 else if ShowSecond == ShowSecond.BeltHold_2 then 2 else if ShowThird == ShowThird.BeltHold_2 then 3 else 0;
def candleAll_2 = if(ShowAll and !ThreeShows_2, BeltHold().bearish, Double.NaN);
plot BH = candleAll_2;
BH.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
BH.SetDefaultColor(GlobalColor("BearishReversal"));
BH.SetLineWeight(5);
BH.HideTitle();
BH.HideBubble();
rec BeltHold_Trig = if(BeltHold().bearish, BarNumber(), BeltHold_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_2) and BeltHold_Trig > 0, "2=BeltHold", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and BeltHold().bearish, "BeltHold", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_2) and BeltHold().bearish, BubPos, if BubNumb then "2" else if BubVerb then "BeltHold" else "", GlobalColor(if ThreeShows_2 == 1 then "Show1st" else if ThreeShows_2 == 2 then "Show2nd" else if ThreeShows_2 == 3 then "Show3rd" else "BearishReversal"), yes);

# Breakaway_3
##### 3 ##### Breakaway() #####
def ThreeShows_3 = if ShowFirst == ShowFirst.Breakaway_3 then 1 else if ShowSecond == ShowSecond.Breakaway_3 then 2 else if ShowThird == ShowThird.Breakaway_3 then 3 else 0;
def candleAll_3 = if(ShowAll and !ThreeShows_3, Breakaway().bearish, Double.NaN);
plot BAWAY = candleAll_3;
BAWAY.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
BAWAY.SetDefaultColor(GlobalColor("BearishReversal"));
BAWAY.SetLineWeight(5);
BAWAY.HideTitle();
BAWAY.HideBubble();
rec Breakaway_Trig = if(Breakaway().bearish, BarNumber(), Breakaway_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_3) and Breakaway_Trig > 0, "3=Breakaway", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Breakaway().bearish, "Breakaway", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_3) and Breakaway().bearish, BubPos, if BubNumb then "3" else if BubVerb then "Breakaway" else "", GlobalColor(if ThreeShows_3 == 1 then "Show1st" else if ThreeShows_3 == 2 then "Show2nd" else if ThreeShows_3 == 3 then "Show3rd" else "BearishReversal"), yes);

# Doji_4
##### 4 ##### Doji() #####
#def ThreeShows_4 = if ShowFirst == ShowFirst.Doji_4 then 1 else if ShowSecond == ShowSecond.Doji_4 then 2 else if ShowThird == ShowThird.Doji_4 then 3 else 0;
#def candleAll_4 = if(ShowAll and !ThreeShows_4, Doji(), Double.NaN);
#plot DOJI = candleAll_4;
#DOJI.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#DOJI.SetDefaultColor(Color.YELLOW);
#DOJI.SetLineWeight(5);
#DOJI.HideTitle();
#DOJI.HideBubble();
#rec Doji_Trig = if(Doji(), BarNumber(), Doji_Trig[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_4) and Doji_Trig > 0, "4=Doji", GlobalColor(if ThreeShows_4 == 1 then "Show1st" else if ThreeShows_4 == 2 then "Show2nd" else if ThreeShows_4 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and Doji(), "Doji", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_4) and Doji(), BubPos, if BubNumb
#then "4" else if BubVerb then "Doji" else "", GlobalColor(if REPLACEME == 1 then "Show1st" else if REPLACEME == 2 then "Show2nd" else if REPLACEME == 3 then "Show3rd" else "Neutral"), yes);

# Engulfing_5
##### 5 ##### Engulfing() #####
def ThreeShows_5 = if ShowFirst == ShowFirst.Engulfing_5 then 1 else if ShowSecond == ShowSecond.Engulfing_5 then 2 else if ShowThird == ShowThird.Engulfing_5 then 3 else 0;
def candleAll_5 = if(ShowAll and !ThreeShows_5, Engulfing().bearish, Double.NaN);
plot Engulfing = candleAll_5;
Engulfing.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Engulfing.SetDefaultColor(GlobalColor("BearishReversal"));
Engulfing.SetLineWeight(5);
Engulfing.HideTitle();
Engulfing.HideBubble();
rec Engulfing_Trig = if(Engulfing().bearish, BarNumber(), Engulfing_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_5) and Engulfing_Trig > 0, "5=Engulfing", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Engulfing().bearish, "Engulfing", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_5) and Engulfing().bearish, BubPos, if BubNumb then "5" else if BubVerb then "Engulfing" else "", GlobalColor(if ThreeShows_5 == 1 then "Show1st" else if ThreeShows_5 == 2 then "Show2nd" else if ThreeShows_5 == 3 then "Show3rd" else "BearishReversal"), yes);  #10

# Harami_6
##### 6 ##### Harami() #####
def ThreeShows_6 = if ShowFirst == ShowFirst.Harami_6 then 1 else if ShowSecond == ShowSecond.Harami_6 then 2 else if ShowThird == ShowThird.Harami_6 then 3 else 0;
def candleAll_6 = if(ShowAll and !ThreeShows_6, Harami().bearish, Double.NaN);
plot Harami = candleAll_6;
Harami.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Harami.SetDefaultColor(GlobalColor("BearishReversal"));
Harami.SetLineWeight(5);
Harami.HideTitle();
Harami.HideBubble();
rec Harami_Trig = if(Harami().bearish, BarNumber(), Harami_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_6) and Harami_Trig > 0, "6=Harami", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Harami().bearish, "Harami", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_6) and Harami().bearish, BubPos, if BubNumb then "6" else if BubVerb then "Harami" else "", GlobalColor(if ThreeShows_6 == 1 then "Show1st" else if ThreeShows_6 == 2 then "Show2nd" else if ThreeShows_6 == 3 then "Show3rd" else "BearishReversal"), yes);

# HaramiCross_7
##### 7 ##### HaramiCross() #####
def ThreeShows_7 = if ShowFirst == ShowFirst.HaramiCross_7 then 1 else if ShowSecond == ShowSecond.HaramiCross_7 then 2 else if ShowThird == ShowThird.HaramiCross_7 then 3 else 0;
def candleAll_7 = if(ShowAll and !ThreeShows_7, HaramiCross().bearish, Double.NaN);
plot HaramiCross = candleAll_7;
HaramiCross.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN)); # bearish
HaramiCross.SetDefaultColor(GlobalColor("BearishReversal"));
HaramiCross.SetLineWeight(5);
HaramiCross.HideTitle();
HaramiCross.HideBubble();
rec HaramiCross_Trig = if(HaramiCross().bearish, BarNumber(), HaramiCross_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_7) and HaramiCross_Trig > 0, "7=HaramiCross", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and HaramiCross().bearish, "HaramiCross", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_7) and HaramiCross().bearish, BubPos, if BubNumb then "7" else if BubVerb then "HaramiCross" else "", GlobalColor(if ThreeShows_7 == 1 then "Show1st" else if ThreeShows_7 == 2 then "Show2nd" else if ThreeShows_7 == 3 then "Show3rd" else "BearishReversal"), yes);

# Kicking_8
##### 8 ##### BeltHold() #####
def ThreeShows_8 = if ShowFirst == ShowFirst.Kicking_8 then 1 else if ShowSecond == ShowSecond.Kicking_8 then 2 else if ShowThird == ShowThird.Kicking_8 then 3 else 0;
def candleAll_8 = if(ShowAll and !ThreeShows_8, Kicking().bearish, Double.NaN);
plot Kicking = candleAll_8;
Kicking.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Kicking.SetDefaultColor(GlobalColor("BearishReversal"));
Kicking.SetLineWeight(5);
Kicking.HideTitle();
Kicking.HideBubble();
rec Kicking_Trig = if(Kicking().bearish, BarNumber(), Kicking_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_8) and Kicking_Trig > 0, "8=Kicking", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and Kicking().bearish, "Kicking", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_8) and Kicking().bearish, BubPos, if BubNumb then "8" else if BubVerb then "Kicking" else "", GlobalColor(if ThreeShows_8 == 1 then "Show1st" else if ThreeShows_8 == 2 then "Show2nd" else if ThreeShows_8 == 3 then "Show3rd" else "BearishReversal"), yes);

# LongLeggedDoji_9
##### 9 ##### LongLeggedDoji() #####
def ThreeShows_9 = if ShowFirst == ShowFirst.LongLeggedDoji_9 then 1 else if ShowSecond == ShowSecond.LongLeggedDoji_9 then 2 else if ShowThird == ShowThird.LongLeggedDoji_9 then 3 else 0;
def candleAll_9 = if(ShowAll and !ThreeShows_9, LongLeggedDoji().bearish, Double.NaN);
plot LongLeggedDoji = candleAll_9;
LongLeggedDoji.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
LongLeggedDoji.SetDefaultColor(GlobalColor("BearishReversal"));
LongLeggedDoji.SetLineWeight(5);
LongLeggedDoji.HideTitle();
LongLeggedDoji.HideBubble();
rec LongLeggedDoji_Trig = if(LongLeggedDoji().bearish, BarNumber(), LongLeggedDoji_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_9) and LongLeggedDoji_Trig > 0, "9=LongLeggedDoji", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and LongLeggedDoji().bearish, "LongLeggedDoji", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_9) and LongLeggedDoji().bearish, BubPos, if BubNumb then "9" else if BubVerb then "LongLeggedDoji" else "", GlobalColor(if ThreeShows_9 == 1 then "Show1st" else if ThreeShows_9 == 2 then "Show2nd" else if ThreeShows_9 == 3 then "Show3rd" else "BearishReversal"), yes);

# Marubozu_10
##### 10 ##### Marubozu() #####
def ThreeShows_10 = if ShowFirst == ShowFirst.Marubozu_10 then 1 else if ShowSecond == ShowSecond.Marubozu_10 then 2 else if ShowThird == ShowThird.Marubozu_10 then 3 else 0;
def candleAll_10 = if(ShowAll and !ThreeShows_10, Marubozu().bearish, Double.NaN);
plot Marubozu = candleAll_10;
Marubozu.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
Marubozu.SetDefaultColor(GlobalColor("BearishContinuation"));
Marubozu.SetLineWeight(5);
Marubozu.HideTitle();
Marubozu.HideBubble();
rec Marubozu_Trig = if(Marubozu().bearish, BarNumber(), Marubozu_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_10) and Marubozu_Trig > 0, "10=Marubozu", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and Marubozu().bearish, "Marubozu", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_10) and Marubozu().bearish, BubPos, if BubNumb then "10" else if BubVerb then "Marubozu" else "", GlobalColor(if ThreeShows_10 == 1 then "Show1st" else if ThreeShows_10 == 2 then "Show2nd" else if ThreeShows_10 == 3 then "Show3rd" else "BearishContinuation"), yes);

# MeetingLines_11
##### 11 ##### MeetingLines() #####
def ThreeShows_11 = if ShowFirst == ShowFirst.MeetingLines_11 then 1 else if ShowSecond == ShowSecond.MeetingLines_11 then 2 else if ShowThird == ShowThird.MeetingLines_11 then 3 else 0;
def candleAll_11 = if(ShowAll and !ThreeShows_11, MeetingLines().bearish, Double.NaN);
plot MeetingLines = candleAll_11;
MeetingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
MeetingLines.SetDefaultColor(GlobalColor("BearishReversal"));
MeetingLines.SetLineWeight(5);
MeetingLines.HideTitle();
MeetingLines.HideBubble();
rec MeetingLines_Trig = if(MeetingLines().bearish, BarNumber(), MeetingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_11) and MeetingLines_Trig > 0, "11=MeetingLines", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and MeetingLines().bearish, "MeetingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_11) and MeetingLines().bearish, BubPos, if BubNumb then "1" else if BubVerb then "MeetingLines" else "", GlobalColor(if ThreeShows_11 == 1 then "Show1st" else if ThreeShows_11 == 2 then "Show2nd" else if ThreeShows_11 == 3 then "Show3rd" else "BearishReversal"), yes);

# SeparatingLines_12
##### 12 ##### SeparatingLines() #####
def ThreeShows_12 = if ShowFirst == ShowFirst.SeparatingLines_12 then 1 else if ShowSecond == ShowSecond.SeparatingLines_12 then 2 else if ShowThird == ShowThird.SeparatingLines_12 then 3 else 0;
def candleAll_12 = if(ShowAll and !ThreeShows_12, SeparatingLines().bearish, Double.NaN);
plot SeparatingLines = candleAll_12;
SeparatingLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SeparatingLines.SetDefaultColor(GlobalColor("BearishContinuation"));
SeparatingLines.SetLineWeight(5);
SeparatingLines.HideTitle();
SeparatingLines.HideBubble();
rec SeparatingLines_Trig = if(SeparatingLines().bearish, BarNumber(), SeparatingLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_12) and SeparatingLines_Trig > 0, "12=SeparatingLines", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and SeparatingLines().bearish, "SeparatingLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_12) and SeparatingLines().bearish,  BubPos, if BubNumb then "12" else if BubVerb then "SeparatingLines" else "", GlobalColor(if ThreeShows_12 == 1 then "Show1st" else if ThreeShows_12 == 2 then "Show2nd" else if ThreeShows_12 == 3 then "Show3rd" else "BearishContinuation"), yes);

# SideBySideWhiteLines_13
##### 13 ##### SideBySideWhiteLines() #####
def ThreeShows_13 = if ShowFirst == ShowFirst.SideBySideWhiteLines_13 then 1 else if ShowSecond == ShowSecond.SideBySideWhiteLines_13 then 2 else if ShowThird == ShowThird.SideBySideWhiteLines_13 then 3 else 0;
def candleAll_13 = if(ShowAll and !ThreeShows_13, SideBySideWhiteLines().bearish, Double.NaN);
plot SideBySideWhiteLines = candleAll_13;
SideBySideWhiteLines.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
SideBySideWhiteLines.SetDefaultColor(GlobalColor("BearishContinuation"));
SideBySideWhiteLines.SetLineWeight(5);
SideBySideWhiteLines.HideTitle();
SideBySideWhiteLines.HideBubble();
rec SideBySideWhiteLines_Trig = if(SideBySideWhiteLines().bearish, BarNumber(), SideBySideWhiteLines_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_13) and SideBySideWhiteLines_Trig > 0, "13=SideBySideWhiteLines", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and SideBySideWhiteLines().bearish, "SideBySideWhiteLines", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_13) and SideBySideWhiteLines().bearish, BubPos, if BubNumb then "13" else if BubVerb then "SideBySideWhiteLines" else "", GlobalColor(if ThreeShows_13 == 1 then "Show1st" else if ThreeShows_13 == 2 then "Show2nd" else if ThreeShows_13 == 3 then "Show3rd" else "BearishContinuation"), yes);

# ThreeLineStrike_14
##### 14 ##### ThreeLineStrike() #####
def ThreeShows_14 = if ShowFirst == ShowFirst.ThreeLineStrike_14 then 1 else if ShowSecond == ShowSecond.ThreeLineStrike_14 then 2 else if ShowThird == ShowThird.ThreeLineStrike_14 then 3 else 0;
def candleAll_14 = if(ShowAll and !ThreeShows_14, ThreeLineStrike().bearish, Double.NaN);
plot ThreeLineStrike = candleAll_14;
ThreeLineStrike.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
ThreeLineStrike.SetDefaultColor(GlobalColor("BearishContinuation"));
ThreeLineStrike.SetLineWeight(5);
ThreeLineStrike.HideTitle();
ThreeLineStrike.HideBubble();
rec ThreeOutsideUp_Trig = if(ThreeLineStrike().bearish, BarNumber(), ThreeOutsideUp_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_14) and ThreeOutsideUp_Trig > 0, "14=ThreeLineStrike", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"));
Alert(UseAlert and ThreeLineStrike().bearish, "ThreeLineStrike", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_14) and ThreeLineStrike().bearish, BubPos, if BubNumb then "14" else if BubVerb then "ThreeLineStrike" else "", GlobalColor(if ThreeShows_14 == 1 then "Show1st" else if ThreeShows_14 == 2 then "Show2nd" else if ThreeShows_14 == 3 then "Show3rd" else "BearishContinuation"), yes);

# TriStar_15
##### 15 ##### TriStar() #####
def ThreeShows_15 = if ShowFirst == ShowFirst.TriStar_15 then 1 else if ShowSecond == ShowSecond.TriStar_15 then 2 else if ShowThird == ShowThird.TriStar_15 then 3 else 0;
def candleAll_15 = if(ShowAll and !ThreeShows_15, TriStar().bearish, Double.NaN);
plot TriStar = candleAll_15;
TriStar.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
TriStar.SetDefaultColor(GlobalColor("BearishReversal"));
TriStar.SetLineWeight(5);
TriStar.HideTitle();
TriStar.HideBubble();
rec TriStar_Trig = if(TriStar().bearish, BarNumber(), TriStar_Trig[1]);
AddLabel(ShowLabel and (ShowAll or ThreeShows_15) and TriStar_Trig > 0, "15=TriStar", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"));
Alert(UseAlert and TriStar().bearish, "TriStar", Alert.BAR, Sound.Chimes);
AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_15) and TriStar().bearish, BubPos, if BubNumb then "15" else if BubVerb then "TriStar" else "", GlobalColor(if ThreeShows_15 == 1 then "Show1st" else if ThreeShows_15 == 2 then "Show2nd" else if ThreeShows_15 == 3 then "Show3rd" else "BearishReversal"), yes);

# WilliamsFractal_16
##### 16 ##### WilliamsFractal() #####
#def ThreeShows_16 = if ShowFirst == ShowFirst.WilliamsFractal_16 then 1 else if ShowSecond == ShowSecond.WilliamsFractal_16 then 2 else if ShowThird == ShowThird.WilliamsFractal_16 then 3 else 0;
#def candleAll_16 = if(ShowAll and !ThreeShows_16, WilliamsFractal().downfractal, Double.NaN);
#plot WilliamsFractal = candleAll_16;
#WilliamsFractal.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#WilliamsFractal.SetDefaultColor(GlobalColor("BearishReversal"));
#WilliamsFractal.SetLineWeight(5);
#WilliamsFractal.HideTitle();
#WilliamsFractal.HideBubble();
#rec WilliamsFractal_Trig_downfractal = if(WilliamsFractal().downfractal, BarNumber(), WilliamsFractal_Trig_downfractal[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_16) and WilliamsFractal_Trig_downfractal > 0, "16=WilliamsFractal", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and WilliamsFractal().downfractal, "WilliamsFractal", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_16) and WilliamsFractal().downfractal, BubPos, if BubNumb then "16" else if BubVerb then "WilliamsFractal" else "", GlobalColor(if ThreeShows_16 == 1 then "Show1st" else if ThreeShows_16 == 2 then "Show2nd" else if ThreeShows_16 == 3 then "Show3rd" else "Neutral"), no);

# ZigZagStepPattern_17
##### 17 ##### ZigZagStepPattern() #####
#def ThreeShows_17 = if ShowFirst == ShowFirst.ZigZagStepPattern_17 then 1 else if ShowSecond == ShowSecond.ZigZagStepPattern_17 then 2 else if ShowThird == ShowThird.ZigZagStepPattern_17 then 3 else 0;
#def candleAll_17 = if(ShowAll and !ThreeShows_17, ZigZagStepPattern().downstep, Double.NaN);
#plot ZigZagStepPattern = candleAll_17;
#ZigZagStepPattern.SetPaintingStrategy(if(BubNone, PaintingStrategy.BOOLEAN_ARROW_DOWN, PaintingStrategy.BOOLEAN_WEDGE_DOWN));
#ZigZagStepPattern.SetDefaultColor(GlobalColor("BearishReversal"));
#ZigZagStepPattern.SetLineWeight(5);
#ZigZagStepPattern.HideTitle();
#ZigZagStepPattern.HideBubble();
#rec ZigZagStepPattern_Trig_downstep = if(ZigZagStepPattern().downstep, BarNumber(), ZigZagStepPattern_Trig_downstep[1]);
#AddLabel(ShowLabel and (ShowAll or ThreeShows_17) and ZigZagStepPattern_Trig_downstep > 0, "17=ZigZagStepPattern", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "Neutral"));
#Alert(UseAlert and ZigZagStepPattern().downstep, "ZigZagStepPattern", Alert.BAR, Sound.Chimes);
#AddChartBubble((BubVerb or BubNumb) and (ShowAll or ThreeShows_17) and ZigZagStepPattern().downstep, BubPos, if BubNumb then "17" else if BubVerb then "ZigZagStepPattern" else "", GlobalColor(if ThreeShows_17 == 1 then "Show1st" else if ThreeShows_17 == 2 then "Show2nd" else if ThreeShows_17 == 3 then "Show3rd" else "Neutral"), no);

# End Code

Labels
View attachment 21971

Bubbles
View attachment 21972

All 4 - Labels & Bubbles
View attachment 21973

Thanks for this update, and for adding the shared chart links, which is always super helpful. I am stoked to dive into these.

Although, I think you may have the names and the links in this post somewhat criss-crossed - I loaded the one up top, "Bullish_Patterns_Only http://tos.mx/!LB9oKT5r" and it was bearish patterns when loaded on the actual chart. Not a huge deal, just FYI!

EDIT: would you mind sharing the link for the "All 4 - Labels & Bubbles" chart?
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
524 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top