커뮤니티

지표 부탁 드립니다

프로필 이미지
매치다2
2025-12-18 21:54:39
75
글번호 229163
답변완료

//@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

안녕하세요 예스스탁입니다. 올리신 수식은 강조식으로 적용해 차트에 적용하셔야 합니다. input : len(20); var : src(0),box(0),mom(0); var : bullishSignal(False),bearishSignal(False); src = close; mom= src-src[len]; bullishSignal = mom > 0 and mom[1]<=0; bearishSignal = mom < 0 and mom[1]>=0; if bullishSignal == true Then PlotPaintBar(H,L,"강조",Green); if bearishSignal == true Then PlotPaintBar(H,L,"강조",Red); 즐거운 하루되세요