OPEN-SOURCE SCRIPT

Simple Trend + Signal (No Bug)

113
//version=5indicator("Simple Trend + Signal (No Bug)", overlay=true)
// === INPUTS ===fastEMA = input.int(20, "Fast EMA")slowEMA = input.int(50, "Slow EMA")lookback = input.int(20, "Zone Lookback")
// === TREND ===emaFast = ta.ema(close, fastEMA)emaSlow = ta.ema(close, slowEMA)
trendUp = emaFast > emaSlowtrendDown = emaFast < emaSlow
// === ZONES ===highestHigh = ta.highest(high, lookback)lowestLow = ta.lowest(low, lookback)
// === SIGNALS ===buySignal = trendUp and close <= emaFastsellSignal = trendDown and close >= emaFast
// === PLOTS ===plot(emaFast, color=color.green, linewidth=2)plot(emaSlow, color=color.red, linewidth=2)
plot(highestHigh, color=color.new(color.blue, 70))plot(lowestLow, color=color.new(color.orange, 70))
plotshape(buySignal, title="BUY", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")plotshape(sellSignal, title="SELL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.