النتائج 1 إلى 2 من 2
  1. #1
    الصورة الرمزية mohamedAlfekey
    mohamedAlfekey غير متواجد حالياً عضو المتداول العربي
    تاريخ التسجيل
    Jan 2024
    الإقامة
    مصر
    المشاركات
    1

    افتراضي ارجوا حل للمشكلة

    كود:
    #property indicator_chart_window
    #property indicator_buffers 2
    #property indicator_color2 Lime
    //---- input parameters
    int       ExtDepth=12;
    //---- buffers
    double ExtMapBuffer[];
    double ExtArrowBuffer[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int init()
      {
    //---- indicators
       SetIndexStyle(0,DRAW_LINE);
       SetIndexBuffer(0,ExtMapBuffer);
       SetIndexEmptyValue(0,0.0);
       SetIndexStyle(1,DRAW_ARROW);
       SetIndexArrow(1,218);
       SetIndexBuffer(1,ExtArrowBuffer);
       SetIndexEmptyValue(1,0.0);
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| Custom indicator deinitialization function                       |
    //+------------------------------------------------------------------+
    int deinit()
      {
    //----
       
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function                              |
    //+------------------------------------------------------------------+
    int start()
      {
       int    counted_bars=IndicatorCounted();
    //---- check for possible errors
       if(counted_bars<0) return(-1);
    //---- last counted bar will be recounted
       if(counted_bars>0) counted_bars--;
       int limit=Bars-counted_bars;
    //---- main loop
       for(int i=0; i<limit; i++)
         {
          //---- calculate the indicator value
          double open = Open[i];
          double close = Close[i];
          double high = High[i];
          double low = Low[i];
          double body = MathAbs(open - close);
          double upper_tail = high - MathMax(open, close);
          double lower_tail = MathMin(open, close) - low;
          double mid_body = body / 2;
          if (open == close)
            {
             //---- do not return any value
             ExtMapBuffer[i] = 0.0;
             ExtArrowBuffer[i] = 0.0;
            }
          else if (open < close && (lower_tail <= mid_body && upper_tail > body && low < open))
          {
             //---- draw an arrow above the candle and write Strong
             ExtMapBuffer[i] = high + 10 * Point;
             ExtArrowBuffer[i] = high + 4 * Point;
             ObjectCreate("N"+i,OBJ_TEXT,0,Time[i],high+10*Point);
             ObjectSetText("N"+i,"N",10,"Arial",Lime);
            }
          else if (open < close && (lower_tail > mid_body && upper_tail >= body))
          {
             //---- draw an arrow above the candle and write Strong
             ExtMapBuffer[i] = high + 10 * Point;
             ExtArrowBuffer[i] = high + 4 * Point;
             ObjectCreate("N"+i,OBJ_TEXT,0,Time[i],high+10*Point);
             ObjectSetText("N"+i,"N",10,"Arial",Lime);
            }
          else
            {
             //---- do nothing
             ExtMapBuffer[i] = 0.0;
             ExtArrowBuffer[i] = 0.0;
            }
         }
    //---- done
       return(0);
      }
    //+------------------------------------------------------------------+
    هذا كود المؤشر ولكن تواجهني مشكلة عندما اقوم بتشغيل المؤشر في Sterategy tester

    يعمل في شمعه او ثلاث شموع وبعدها يأتي سهم الاشارة فقط وتختفي الكلمة فوق السهم

    سأقوم بإدراج صورة للتوضيح اكثر



    كما لاحظتم في الصوره حرف ال N يختفي

    ارجوا مساعدتي في حل المشكلة وشكرا جزيلاً لكم مقدماً
    الصور المصغرة للصور المرفقة الصور المصغرة للصور المرفقة Screenshot_1.jpg‏  

  2. #2
    الصورة الرمزية MR.dollar
    MR.dollar غير متواجد حالياً مشرف المتداول العربي
    تاريخ التسجيل
    Jun 2009
    الإقامة
    مصر
    المشاركات
    13,851

    افتراضي

    اقتباس المشاركة الأصلية كتبت بواسطة mohamedAlfekey مشاهدة المشاركة
    كود:
    #property indicator_chart_window
    #property indicator_buffers 2
    #property indicator_color2 Lime
    //---- input parameters
    int       ExtDepth=12;
    //---- buffers
    double ExtMapBuffer[];
    double ExtArrowBuffer[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int init()
      {
    //---- indicators
       SetIndexStyle(0,DRAW_LINE);
       SetIndexBuffer(0,ExtMapBuffer);
       SetIndexEmptyValue(0,0.0);
       SetIndexStyle(1,DRAW_ARROW);
       SetIndexArrow(1,218);
       SetIndexBuffer(1,ExtArrowBuffer);
       SetIndexEmptyValue(1,0.0);
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| Custom indicator deinitialization function                       |
    //+------------------------------------------------------------------+
    int deinit()
      {
    //----
       
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function                              |
    //+------------------------------------------------------------------+
    int start()
      {
       int    counted_bars=IndicatorCounted();
    //---- check for possible errors
       if(counted_bars<0) return(-1);
    //---- last counted bar will be recounted
       if(counted_bars>0) counted_bars--;
       int limit=Bars-counted_bars;
    //---- main loop
       for(int i=0; i<limit; i++)
         {
          //---- calculate the indicator value
          double open = Open[i];
          double close = Close[i];
          double high = High[i];
          double low = Low[i];
          double body = MathAbs(open - close);
          double upper_tail = high - MathMax(open, close);
          double lower_tail = MathMin(open, close) - low;
          double mid_body = body / 2;
          if (open == close)
            {
             //---- do not return any value
             ExtMapBuffer[i] = 0.0;
             ExtArrowBuffer[i] = 0.0;
            }
          else if (open < close && (lower_tail <= mid_body && upper_tail > body && low < open))
          {
             //---- draw an arrow above the candle and write Strong
             ExtMapBuffer[i] = high + 10 * Point;
             ExtArrowBuffer[i] = high + 4 * Point;
             ObjectCreate("N"+i,OBJ_TEXT,0,Time[i],high+10*Point);
             ObjectSetText("N"+i,"N",10,"Arial",Lime);
            }
          else if (open < close && (lower_tail > mid_body && upper_tail >= body))
          {
             //---- draw an arrow above the candle and write Strong
             ExtMapBuffer[i] = high + 10 * Point;
             ExtArrowBuffer[i] = high + 4 * Point;
             ObjectCreate("N"+i,OBJ_TEXT,0,Time[i],high+10*Point);
             ObjectSetText("N"+i,"N",10,"Arial",Lime);
            }
          else
            {
             //---- do nothing
             ExtMapBuffer[i] = 0.0;
             ExtArrowBuffer[i] = 0.0;
            }
         }
    //---- done
       return(0);
      }
    //+------------------------------------------------------------------+
    هذا كود المؤشر ولكن تواجهني مشكلة عندما اقوم بتشغيل المؤشر في Sterategy tester

    يعمل في شمعه او ثلاث شموع وبعدها يأتي سهم الاشارة فقط وتختفي الكلمة فوق السهم

    سأقوم بإدراج صورة للتوضيح اكثر



    كما لاحظتم في الصوره حرف ال N يختفي

    ارجوا مساعدتي في حل المشكلة وشكرا جزيلاً لكم مقدماً
    بدلا من أن تستخدم رقم الشمعة لتسمية التكست
    كود PHP:
    ObjectCreate("N"+i,OBJ_TEXT,0,Time[i],high+10*Point);ObjectSetText("N"+i,"N",10,"Arial",Lime); 
    إستخدم توقيت الشمعة مثال
    كود PHP:
    ObjectCreate("N"+Time[i],OBJ_TEXT,0,Time[i],high+10*Point);ObjectSetText("N"+Time[i],"N",10,"Arial",Lime); 
    لماذا؟
    لأن رقم الشمعة يمكن أن يتكرر ويظهر عنده إشارة أخرى بالتالي يحذف التكست السابق ويتم رسم التكست الجديد
    توقيع العضو
    بناء أنظمة تداول آلي ويدوي لفحص سوق العملات ودمجها مع التحليل الفني لإتخاذ القرارات


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17