ํŒŒ์ธ์—๋””ํ„ฐ์—์„œ ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ•˜์…ˆ


๋ฐ์€ ๋…น์ƒ‰ ๋นจ๊ฐ„์ƒ‰ ADX 20 ์ด์ƒ์ด๋ฉด์„œ ์ƒ์Šน์ถ”์„ธ

์–ด๋‘์šด ๋…น์ƒ‰ ๋นจ๊ฐ„์ƒ‰ ADX 20 ์ด์ƒ์ด๋ฉด์„œ ํ•˜๋ฝ์ถ”์„ธ

๋ฐ์€ ํŒŒ๋ž‘ ํ•‘ํฌ?๋Š” ADX 20 ์ดํ•˜์ด๋ฉด์„œ ์ƒ์Šน์ถ”์„ธ

์–ด๋‘์šด ํŒŒ๋ž‘ ๋˜ฅ์ƒ‰์€ ADX 20 ์ดํ•˜์ด๋ฉด์„œ ํ•˜๋ฝ์ถ”์„ธ


+di์™€ -di์˜ ์ฐจ์ด๋ฅผ ํžˆ์Šคํ† ๊ทธ๋žจ์œผ๋กœ ํ‘œ์‹œํ•จ

๋…ธ๋ž€์„ ์€ adx

45 ์ด์ƒ๋˜๋ฉด ๋นจ๊ฐ„์ƒ‰๋จ


dmi adx ์ข‹์•„ํ•œ๋‹ค๋ฉด ์œ ์šฉํ• ์ง€๋„?


//@version=6

indicator(title="DMI Convergence Divergence ", shorttitle="DMI", timeframe="", timeframe_gaps=true)


lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50)

len = input.int(14, minval=1, title="DI Length")

up = ta.change(high)

down = -ta.change(low)

plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)

minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)

trur = ta.rma(ta.tr, len)

plus = fixnan(100 * ta.rma(plusDM, len) / trur)

minus = fixnan(100 * ta.rma(minusDM, len) / trur)

sum = plus + minus

adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

dmicd=plus - minus

// ===== ์ฐจํŠธ์— ํ‘œ์‹œ =====

hline(20, "Zero Line", color=color.rgb(120, 123, 134))

hline(-20, "Zero Line", color=color.rgb(120, 123, 134))

plot(dmicd, title="DMICD", style=plot.style_columns, color=(dmicd >= 0 ? (adx > adx[1] ? (adx >= 20 ? color.rgb(0, 255, 0) : color.rgb(0, 255, 255)) : (adx >= 20 ? color.rgb(0, 90, 0) : color.rgb(0, 0, 255))) : (adx > adx[1] ? (adx >= 20 ? color.rgb(255, 0, 0) : color.rgb(255, 125, 125)) : (adx >= 20 ? color.rgb(125, 0, 0) : color.rgb(100, 75, 0)))))

plot(adx, color=(adx >=45 ? #F50057 : color.rgb(242, 255, 0)), title="ADX")

// ์ถ”๊ฐ€ +di -di ์˜ ์ฐจ์ด๊ฐ€ 1 ๋‚ด๋กœ ๊ทผ์ ‘ํ• ์‹œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ํ‘œ์‹œ

bgcolor(dmicd > -1 and dmicd < 1 ? #ff525226 : na)