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

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad