OPEN-SOURCE SCRIPT

Custom ADX with HMA Synchronization

//version=5
indicator("Custom ADX with HMA Synchronization", overlay=false)

// إعدادات طول HMA الذي يجب أن يتماشى معه مؤشر ADX
hmaLength = input.int(7, title="HMA Length (for consistency)")

// حساب True Range و قيم DI+ و DI-
tr = ta.tr
plusDM = ta.change(high) > ta.change(low) ? math.max(ta.change(high), 0) : 0
minusDM = ta.change(low) > ta.change(high) ? math.max(ta.change(low), 0) : 0

// حساب قيم DI+ و DI- كمتوسط
smoothPlusDM = ta.rma(plusDM, hmaLength)
smoothMinusDM = ta.rma(minusDM, hmaLength)
smoothTR = ta.rma(tr, hmaLength)

// حساب قيم +DI و -DI
plusDI = (smoothPlusDM / smoothTR) * 100
minusDI = (smoothMinusDM / smoothTR) * 100

// حساب مؤشر DX
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)

// حساب ADX باستخدام متوسط الحركة الأسية
adxValue = ta.rma(dx, hmaLength)

// عرض قيمة ADX على الرسم البياني
plot(adxValue, title="ADX", color=color.orange, linewidth=2)

// إضافة مستوى 25 لتوضيح مستوى التوجه القوي
hline(25, "Level 25", color=color.gray, linestyle=hline.style_dotted)
educational

Skrypt open-source

W prawdziwym duchu TradingView autor tego skryptu opublikował go jako open source, aby inwestorzy mogli go zrozumieć i zweryfikować. Pozdrowienia dla autora! Możesz go używać bezpłatnie, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Chcesz użyć tego skryptu na wykresie?

Wyłączenie odpowiedzialności