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

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian