TAPLOT Wick Play
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TaPlot

//@version=5

//Code written by @TaPlot
//Written on 12/17/2021

//Popularized by 2020 US Investing Champion Oliver Kell
//Wick Play is a setup in which a strong stock with momentum to the upside closes off the highs of the day in yesterdays session. 
//Today's session opens in the candle "wick" of yesterdays bar. 
//if stock holds in the wick and doesn't trade in the body of yesterdays candle, it is a sign of strength. 
//Trigger happens on day 3 when price moves over the high of the wick inside day.
//It is important to note that this setup should not be traded in isolation. Not every wick play is buyable.
//This is to be used in the context of strong stocks like True Market Leaders and with buying momentum behind them.

indicator(title="TAPLOT Wick Play", shorttitle="TAPLOT Wick Play", overlay=true)
C_Paintbar = input.color(title="Bar Color", defval=color.new(color.aqua,0))
C_WickPlay = input.color(title="Wick Play Indicator Color", defval=color.new(color.aqua,0))

Paintbar=input(true,'Paint Bar?')
ShowShape=input(true,'Show Wick Play?')

wickUpDayYesterday = close[1]>open[1] and high[1]>close[1]
wickDownDayYesterday = close[1]<open[1] and high[1]>open[1]
wickDojiDayYesterday = close[1]==open[1] and high[1]>close[1]
TodayInUpTheWick =  high <=high[1] and low >= close[1] and wickUpDayYesterday
TodayInDownTheWick =  high <=high[1] and low >= open[1] and wickDownDayYesterday
TodayInDojiTheWick =  high <=high[1] and low >= close[1] and wickDojiDayYesterday

WickPlay = TodayInUpTheWick or TodayInDownTheWick or TodayInDojiTheWick

plotshape(WickPlay and ShowShape?1:na,style=shape.labelup, location=location.belowbar, color=C_WickPlay, size=size.tiny)
barcolor(Paintbar and WickPlay? C_Paintbar : na)