//version=5
indicator("Custom ABCD with Stochastic", overlay=true)

k = ta.stoch(close, 14, 3, 3)
d = ta.sma(k, 3)
hline(80, "Overbought", color=color.red)
hline(20, "Oversold", color=color.green)

plot(k, color=color.blue, linewidth=2)
plot(d, color=color.orange, linewidth=2)

bgcolor(close >= 2720 and close <= 2740 ? color.new(color.purple, 90) : na)

lineB = line.new(x1=bar_index[20], y1=2700, x2=bar_index[40], y2=2750, color=color.blue, width=2)
lineC = line.new(x1=bar_index[40], y1=2750, x2=bar_index[60], y2=2720, color=color.blue, width=2)
lineD = line.new(x1=bar_index[60], y1=2720, x2=bar_index[80], y2=2760, color=color.blue, width=2)

label.new(bar_index[20], 2700, text="B", style=label.style_labeldown, color=color.white)
label.new(bar_index[40], 2750, text="C", style=label.style_labelup, color=color.white)
label.new(bar_index[60], 2720, text="D", style=label.style_labeldown, color=color.white)

support_level = 2700
resistance_level = 2750
line.new(bar_index[1], support_level, bar_index[200], support_level, color=color.green, width=1)
line.new(bar_index[1], resistance_level, bar_index[200], resistance_level, color=color.red, width=1)


if (ta.crossover(k, d) and k < 20)
label.new(bar_index, high, "Buy", style=label.style_labeldown, color=color.green)
if (ta.crossunder(k, d) and k > 80)
label.new(bar_index, low, "Sell", style=label.style_labelup, color=color.red)
Wave Analysis

면책사항