//@version=5
indicator(title='ZLSMA Trend- Zero Lag SMA Trend', shorttitle='ZLSMA Trend', overlay=true, timeframe='')
length = input(title='Length', defval=32)
offset = input(title='Offset', defval=0)
src = input(close, title='Source')
lsma = ta.linreg(src, length, offset)
lsma2 = ta.linreg(lsma, length, offset)
eq = lsma - lsma2
zlsma = lsma + eq
zcolorchange = input(title='Change Color ?', defval=true)
zColor = zcolorchange ? zlsma > zlsma[1] ? color.blue : color.red : color.yellow
plot(zlsma, title='LagF', linewidth=4, color=zColor, transp=0)
답변 1
예스스탁
예스스탁 답변
2024-07-29 15:39:18
안녕하세요
예스스탁입니다.
종가가 돌파하는 내용으로 작성해 드립니다.
input : length(32);
var : src(0),eq(0),lsma(0),lsma2(0),zlsma(0);
src = close;
lsma = LRL(src, length);
lsma2 = LRL(lsma, length);
eq = lsma - lsma2;
zlsma = lsma + eq;
if CrossUp(C,zlsma) Then
Find(1);
즐거운 하루되세요
> kep 님이 쓴 글입니다.
> 제목 : 트레이딩뷰의 zlsma trend 수식인데 조건검색식으로 만들고 싶어 문의드립니다
> //@version=5
indicator(title='ZLSMA Trend- Zero Lag SMA Trend', shorttitle='ZLSMA Trend', overlay=true, timeframe='')
length = input(title='Length', defval=32)
offset = input(title='Offset', defval=0)
src = input(close, title='Source')
lsma = ta.linreg(src, length, offset)
lsma2 = ta.linreg(lsma, length, offset)
eq = lsma - lsma2
zlsma = lsma + eq
zcolorchange = input(title='Change Color ?', defval=true)
zColor = zcolorchange ? zlsma > zlsma[1] ? color.blue : color.red : color.yellow
plot(zlsma, title='LagF', linewidth=4, color=zColor, transp=0)