تحول الكود التالي لمحاولة الحصول على ATR داخليًا للكشف عن 5 أرقام في نافذة البيانات. أضفت كان داخلي أرقام (أرقام) ؛. لا يزال يظهر 4 أرقام في نافذة البيانات.
نعم ، قمت بإعادة تجميع MT4 وإغلاقه واستئنافه وما إلى ذلك. إلخ.
هنا هو الكود:
الكود المدرج/ --------------------------------------------- --------------------- /| ATR.mq4 |/| حقوق النشر © 2005 ، MetaQuotes Software Corp .. |/| # 91 ؛ تلميح # 93 ؛ http:/www.metaquotes.net/#91 ؛url # 93؛ |/ ----------------------------------------------- ------------------- #property Copyright Copyright 2005، MetaQuotes Software Corp. #property link # 91؛ تلميح # 93؛ http:/www.metaquotes.net# 91؛رابط # 93؛ #property indior_separate_window #property indior_buffers 1 #property indior_color1 DodgerBlue/- - أدخل المعلمات extern int AtrPeriod = 14؛/- المخازن المؤقتة المزدوجة AtrBuffer # 91؛ # 93 ؛؛ TempBuffer # 91؛ # 93 ؛؛/ ----------------------------------------------- ------------------- /| وظيفة التهيئة المخصصة |/ ----------------------------------------------- ------------------- int init () string short_name؛/- 1 إضافة المخزن المؤقت المستخدمة لحساب. IndiorBuffers (اثنان) ؛ IndiorDigits (سيارة)؛/- السطر الداخلي SetIndexStyle (0 ، DRAW_LINE) ؛ SetIndexBuffer (0، AtrBuffer)؛ SetIndexBuffer (1، TempBuffer)؛/- اسم DataWindow والعلامة الفرعية subwindow short_name = ATR ( AtrPeriod ) ؛ IndiorShortName (SHORT_NAME)؛ SetIndexLabel (0، SHORT_NAME)؛/- SetIndexDrawBegin (0 ، AtrPeriod) ؛/- return (0)؛/ ----------------------------------------------- ------------------- /| متوسط المدى الحقيقي |/ ----------------------------------------------- ------------------- int start () int I، counted_bars = IndiorCounted ()؛/- if (Barslt؛ = AtrPeriod) return (0)؛/- أول صفر إذا (counted_barslt؛ 1) لـ (I = 1؛ ilt؛ = AtrPeriod؛ I ) AtrBuffer # 91؛ Bars-i # 93؛ = 0.0؛/- I = Bars-counted_bars-1؛ بينما (igt؛ = 0) double double = High # 91؛ I # 93 ؛؛ انخفاض مزدوج = منخفض # 91 ؛ أنا # 93 ؛؛ إذا (I == Bars-1) TempBuffer # 91؛ I # 93؛ = high-low؛ prevlose آخر مزدوج = إغلاق # 91 ؛ I 1 # 93 ؛؛ TempBuffer # 91؛ I # 93؛ = MathMax (كبيرة، prevclose) -MathMin (منخفضة، prevclose)؛ أنا--؛/- if (counted_barsgt؛ 0) counted_bars--؛ int limit = Bars-counted_bars؛ لـ (I = 0؛ ilt؛ limit؛ I ) AtrBuffer # 91؛ I # 93؛ = iMAOnArray (TempBuffer، Bars، AtrPeriod، 0، MODE_SMA، I)؛/- return (0)؛/ ----------------------------------------------- -------------------