//@version=6 indicator("WEAI Trial — Direction Core", "WEAI Trial", overlay = true) fastLen = input.int(20, "Fast EMA / 단기 EMA", minval = 2) slowLen = input.int(50, "Slow EMA / 장기 EMA", minval = 5) showSignals = input.bool(true, "Show direction signals / 방향 신호") fast = ta.ema(close, fastLen) slow = ta.ema(close, slowLen) bull = fast > slow and close > fast bear = fast < slow and close < fast longSignal = ta.crossover(fast, slow) shortSignal = ta.crossunder(fast, slow) p1 = plot(fast, "Fast EMA", color = color.rgb(64, 153, 255), linewidth = 2) p2 = plot(slow, "Slow EMA", color = color.rgb(150, 165, 185), linewidth = 2) fill(p1, p2, color = color.new(bull ? color.aqua : bear ? color.red : color.gray, 90)) barcolor(bull ? color.new(color.aqua, 65) : bear ? color.new(color.red, 65) : na) plotshape(showSignals and longSignal, "WEAI Bullish", shape.triangleup, location.belowbar, color.rgb(82, 220, 178), text = "WEAI\nUP", textcolor = color.white, size = size.tiny) plotshape(showSignals and shortSignal, "WEAI Bearish", shape.triangledown, location.abovebar, color.rgb(255, 101, 120), text = "WEAI\nDN", textcolor = color.white, size = size.tiny) alertcondition(longSignal, "WEAI Trial Bullish", "WEAI Trial: Bullish direction change on {{ticker}} {{interval}}") alertcondition(shortSignal, "WEAI Trial Bearish", "WEAI Trial: Bearish direction change on {{ticker}} {{interval}}")