Cuck Wick
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KiLA-WHALE
// What's a cuck wick? It's that fast stophunting wick that cucks everyone by triggering their stoploss and liquidation. 
// This indicator is dedicated to my friend Alexandru who saved me from getting liquidated by one of these scam wicks which almost liquidated me. 
// Alexandru is one of the best scalpers out there and he always nails his entries at the tip of these wicks. This inspired me to create this indicator.
//@version=5
// Declare indicator name
indicator('Cuck Wick', overlay=true)
// Define variables
Wick_Ratio = input(2,'Wick Ratio',tooltip = 'Candle wick to body size ratio.')
Candle_Ratio = input(0.75, 'Candle Ratio', tooltip = 'Percentage of current price.')
Bull_Candle_Colour = input(color.aqua, 'Bull Candle Colour',tooltip = 'Colour of the bullish cuck candle.')
Bear_Candle_Colour = input(color.orange, 'Bear Candle Colour',tooltip = 'Colour of the bearish cuck candle.')
// Calculate the size of the body of a candle
body = math.abs(close - open)
// Calculate the size of the upper wick of a candle
upper_wick = high - math.max(open, close)
// Calculate the size of the lower wick of a candle
lower_wick = math.min(open, close) - low
// Find bull cuck by calculating size of the wick and body
BullCuck = body + upper_wick + lower_wick >= (Candle_Ratio * close) / 100 and (upper_wick > (body + lower_wick) * Wick_Ratio)
// Find bear cuck by calculating size of the wick and body
BearCuck = body + upper_wick + lower_wick >= (Candle_Ratio * close) / 100 and (lower_wick > (body + upper_wick) * Wick_Ratio)
// Highlight cuck wick with the specified colours
Cuck_Wick = (BullCuck ? Bull_Candle_Colour : BearCuck ? Bear_Candle_Colour : na)
// Calculate size of the current bull candle
Current_Bull = close - open >= (Candle_Ratio * close) / 100
// Calculate size of the current bear candle
Current_Bear = open - close >= (Candle_Ratio * close) / 100
// Calculate current cuck candle
Cuck_Candle = (Current_Bull ? Bull_Candle_Colour : Current_Bear ? Bear_Candle_Colour : na)
// Find the current candle
Current_Candle = barstate.islast ? 1 : 0
// Highlight cuck candles and cuck wicks
barcolor(Current_Candle ? Cuck_Candle : Cuck_Wick)