커뮤니티
지표 부탁 드립니다
2025-12-18 21:54:39
178
글번호 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);
즐거운 하루되세요
다음글
이전글