커뮤니티

문의드립니다.

프로필 이미지
as8282
2020-06-15 21:54:00
2131
글번호 139856
답변완료
아래수식을 예스로 부탁합니다. i1=input(5, "Momentum Period", minval=1) //Keep at 2 usually i2=input(10, "Slow Period", minval=1) i3=input(5, "Fast Period", minval=1) i4=input(3, "Smoothing Period", minval=1) i5=input(10, "Signal Period", minval=1) i6=input(20, "Extreme Value", minval=1) hiDif = high - high[1] loDif = low[1] - low uDM = hiDif > loDif and hiDif > 0 ? hiDif : 0 dDM = loDif > hiDif and loDif > 0 ? loDif : 0 ATR = rma(tr(true), i1) DIu = 100 * rma(uDM, i1) / ATR DId = 100 * rma(dDM, i1) / ATR HLM2 = DIu - DId DTI = (100 * ema(ema(ema(HLM2, i2), i3), i4)) / ema(ema(ema(abs(HLM2), i2), i3), i4) signal = ema(DTI, i5) col = DTI > DTI[1] ? green : maroon col2 = DTI > signal ? lime : red col3 = DTI > 0 ? teal : purple p1=plot(DTI,title="DTI", color=col, style=area, linewidth=5, transp=10) p2=plot(signal,title="Signal", color=col2) p3=plot(0,title="zero", color=gray) p4=plot(i6,title="overbought",color=purple, linewidth=5, transp=75) p5=plot(-i6,title="oversold",color=teal, linewidth=5, transp=75) fill(p1,p3, col3, transp=50) fill(p1, p2, col2, transp=0)
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-06-16 14:42:30

안녕하세요 예스스탁입니다. input : i1(5),i2(10),i3(5),i4(3),i5(10),i6(20); var : hidif(0),lodif(0),udm(0),ddm(0),atrv(0),diu(0),did(0),uDMv(0),dDMv(0); var : hlm2(0),dti(0),signal(0),col(0),col2(0),col3(0); hiDif = high - high[1]; loDif = low[1] - low; uDM = iff(hiDif > loDif and hiDif > 0 , hiDif , 0); dDM = iff(loDif > hiDif and loDif > 0 , loDif , 0); ATRv = (TrueRange + (i1 - 1) * ATRv) / i1; uDMv = (uDM + (i1 - 1) * uDMv) / i1; dDMv = (dDM + (i1 - 1) * dDMv) / i1; DIu = 100 * uDMv / ATRv; DId = 100 * dDMv / ATRv; HLM2 = DIu - DId; DTI = (100 * ema(ema(ema(HLM2, i2), i3), i4)) / ema(ema(ema(abs(HLM2), i2), i3), i4); signal = ema(DTI, i5); col = iff(DTI > DTI[1] , green , YELLOW); col2 = iff(DTI > signal , BLUE , red); col3 = iff(DTI > 0 , CYAN , MAGENTA); plot1(DTI,"DTI", col); plot2(signal,"Signal",col2); plot3(0,"zero", gray); plot4(i6,"overbought",MAGENTA); plot5(-i6,"oversold",CYAN); 즐거운 하루되세요 > as8282 님이 쓴 글입니다. > 제목 : 문의드립니다. > 아래수식을 예스로 부탁합니다. i1=input(5, "Momentum Period", minval=1) //Keep at 2 usually i2=input(10, "Slow Period", minval=1) i3=input(5, "Fast Period", minval=1) i4=input(3, "Smoothing Period", minval=1) i5=input(10, "Signal Period", minval=1) i6=input(20, "Extreme Value", minval=1) hiDif = high - high[1] loDif = low[1] - low uDM = hiDif > loDif and hiDif > 0 ? hiDif : 0 dDM = loDif > hiDif and loDif > 0 ? loDif : 0 ATR = rma(tr(true), i1) DIu = 100 * rma(uDM, i1) / ATR DId = 100 * rma(dDM, i1) / ATR HLM2 = DIu - DId DTI = (100 * ema(ema(ema(HLM2, i2), i3), i4)) / ema(ema(ema(abs(HLM2), i2), i3), i4) signal = ema(DTI, i5) col = DTI > DTI[1] ? green : maroon col2 = DTI > signal ? lime : red col3 = DTI > 0 ? teal : purple p1=plot(DTI,title="DTI", color=col, style=area, linewidth=5, transp=10) p2=plot(signal,title="Signal", color=col2) p3=plot(0,title="zero", color=gray) p4=plot(i6,title="overbought",color=purple, linewidth=5, transp=75) p5=plot(-i6,title="oversold",color=teal, linewidth=5, transp=75) fill(p1,p3, col3, transp=50) fill(p1, p2, col2, transp=0)