MarcoValente

DI histo + adx

664
This is a DI + ,DI - with ADX , but instead of plot the 2 lines of Directional moviment ( + and -), we have a histogram of the difference between DI+ and DI-. As zero line I used value of 25, so can plot the ADX too
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
study("DI histo + adx",overlay=false,scale=scale.left)
len = input(title="Length", type=integer, defval=14)
th = input(title="threshold", type=integer, defval=25)

TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))
DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0
DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0


SmoothedTrueRange = nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRange
SmoothedDirectionalMovementPlus = nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus
SmoothedDirectionalMovementMinus = nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus

DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100
ADX = sma(DX, len)
ve=DIPlus>(DIMinus+(DIPlus*10)/100)
ro=DIMinus>(DIPlus+(DIMinus*10)/100) and ADX>11 and ADX<=25
xve= DIPlus>(DIMinus+(DIPlus*10)/100) and ADX>22
xro=DIMinus>(DIPlus+(DIMinus*10)/100) and ADX>22
fl=DIPlus-DIMinus<abs(10) and ADX<15

di=25+(DIPlus-DIMinus)
//vam=sma(1.2*(ADX-ADX[len]),3)+25
//vad=(vam+2*vam[1]+2*vam[2]+vam[3])/6

cy=di>=25?lime:red
//plot(DIPlus, color=lime,linewidth=2, title="DI+")
//plot(DIMinus, color=red, linewidth=2,title="DI-")
plot(ADX, color=orange,linewidth=1,transp=0, title="ADX")
//plot(vam,title="velocita",linewidth=1,transp=50,color=lime)
plot(di,style=histogram,linewidth=4,color=cy,transp=50,histbase=25,title="DI")
hline(th, color=gray)