답변완료
부탁드립니다.
TradingView의 Zero Lag 지표인데 수식변환 부탁드립니다.
source = close
fastLength = input(12, title="Fast MM period", minval=1)
slowLength = input(26,title="Slow MM period", minval=1)
signalLength =input(9,title="Signal MM period", minval=1)
MacdEmaLength =input(9, title="MACD EMA period", minval=1)
useEma = input(true, title="Use EMA (otherwise SMA)")
useOldAlgo = input(false, title="Use Glaz algo (otherwise 'real' original zero lag)")
showDots = input(true, title="Show symbols to indicate crossing")
dotsDistance = input(1.5, title="Symbols distance factor", minval=0.1)
// Fast line
ma1= useEma ? ema(source, fastLength) : sma(source, fastLength)
ma2 = useEma ? ema(ma1,fastLength) : sma(ma1,fastLength)
zerolagEMA = ((2 * ma1) - ma2)
// Slow line
mas1= useEma ? ema(source , slowLength) : sma(source , slowLength)
mas2 = useEma ? ema(mas1 , slowLength): sma(mas1 , slowLength)
zerolagslowMA = ((2 * mas1) - mas2)
// MACD line
ZeroLagMACD = zerolagEMA - zerolagslowMA
// Signal line
emasig1 = ema(ZeroLagMACD, signalLength)
emasig2 = ema(emasig1, signalLength)
signal = useOldAlgo ? sma(ZeroLagMACD, signalLength) : (2 * emasig1) - emasig2
hist = ZeroLagMACD - signal
upHist = (hist > 0) ? hist : 0
downHist = (hist <= 0) ? hist : 0
p1 = plot(upHist, color=green, transp=40, style=columns, title='Positive delta')
p2 = plot(downHist, color=purple, transp=40, style=columns, title='Negative delta')
zeroLine = plot(ZeroLagMACD, color=black, transp=0, linewidth=2, title='MACD line')
signalLine = plot(signal, color=gray, transp=0, linewidth=2, title='Signal')
ribbonDiff = hist > 0 ? green : purple
fill(zeroLine, signalLine, color=ribbonDiff)
circleYPosition = signal*dotsDistance
plot(ema(ZeroLagMACD,MacdEmaLength) , color=red, transp=0, linewidth=2, title='EMA on MACD line')
ribbonDiff2 = hist > 0 ? green : purple
plot(showDots and cross(ZeroLagMACD, signal) ? circleYPosition : na,style=circles, linewidth=4, color=ribbonDiff2, title='Dots')
2024-10-18
791
글번호 184392
지표
답변완료
종목검색식 요청드립니다.
아래 키움수식라인을 현재가가 돌파하는 검색식을 만들고 싶습니다. 도움 부탁드립니다.
*키움수식라인
M=floor(date/100);
S= sum(1);
HH=sum(H);
MS1= S - valuewhen(1, M!=M(1), S(1));
MH1 = HH - valuewhen(1, M!=M(1), HH(1));
MS2= S- valuewhen(2, M!=M(1), S(1))-MS1;
MH2 = HH-valuewhen(2, M!=M(1), HH(1))-MH1;
MH2/MS2
감사합니다.
2024-10-18
797
글번호 184386
종목검색