fix: Filter plotshape signals by direction mode (visual bug fix)

This commit is contained in:
mindesbunister
2026-01-02 19:29:36 +01:00
parent fa6f0a80bc
commit 1f8630862c

View File

@@ -200,8 +200,12 @@ downTrend = trend == -1 ? supertrend : na
plot(upTrend, "Up Trend", color=color.new(color.green, 0), style=plot.style_linebr, linewidth=2)
plot(downTrend, "Down Trend", color=color.new(color.red, 0), style=plot.style_linebr, linewidth=2)
plotshape(finalLongSignal, title="Buy", location=location.belowbar, color=color.lime, style=shape.triangleup, size=size.small)
plotshape(finalShortSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Only show signals that match direction mode
showLongSignal = finalLongSignal and allowLong
showShortSignal = finalShortSignal and allowShort
plotshape(showLongSignal, title="Buy", location=location.belowbar, color=color.lime, style=shape.triangleup, size=size.small)
plotshape(showShortSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// =============================================================================
// DEBUG TABLE