ํ์ธ์๋ํฐ์์ ๋ถ์ฌ๋ฃ๊ธฐ ํ์
๋ฐ์ ๋ น์ ๋นจ๊ฐ์ 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)
์ด๊ฑธ ์ด์ ๋ดค๋ค, ๋๋ง๊ณ di-+ ์ข์ํ๋ ์ฌ๋์ด ๋ ์์๋ค ์ข์ ์ ๋ณด ๊ณ ๋ง์
di๋ ์ฌ๋์ด์ง ใ
+di -di ์ ์ฐจ์ด๊ฐ 1 ๋ด๋ก ๊ทผ์ ํ ์ ๋ฐฑ๊ทธ๋ผ์ด๋ ํ์๊ฐ ์ถ๊ฐ๋์
์ค ์ด๊ฑธ ์ ๋ฐ์ดํธ ํ๋ค