커뮤니티
지표 부탁 드립니다
//@version=5
indicator("Momentum Signal Stripes", overlay=true)
// --- Inputs ---
len = input.int(20, "Momentum Length")
src = input.source(close, "Source")
// --- Logic (Momentum) ---
mom = src - src[len]
// --- Signal Logic (Triggers only on the first bar of the change) ---
// This checks if the current momentum is positive while the previous bar was not
bullishSignal = mom > 0 and mom[1] <= 0
bearishSignal = mom < 0 and mom[1] >= 0
// --- Color Logic ---
bgColor = bullishSignal ? color.new(color.green, 70) : bearishSignal ? color.new(color.red, 70) : na
// --- Render ---
bgcolor(bgColor, title="Momentum Signal Stripe")
답변 1
예스스탁 예스스탁 답변
2025-12-19 10:18:55