please i need help here

 
// تعريف المتغيرات
double OpenBuffer[];
double CloseBuffer[];
double HighBuffer[];
double LowBuffer[];
double BodyBuffer[];
string TextBuffer[];

// تهيئة المؤشر
int OnInit()
{
  // تعيين مصادر البيانات
  SetIndexBuffer(0, OpenBuffer);
  SetIndexBuffer(1, CloseBuffer);
  SetIndexBuffer(2, HighBuffer);
  SetIndexBuffer(3, LowBuffer);
  SetIndexBuffer(4, BodyBuffer);
  SetIndexBuffer(5, TextBuffer, ENUM_INDEXBUFFER_TYPE.INDICATOR_DATA_STRING); // تحديد نوع البيانات للمصفوفة الخامسة
  
  // تعيين خصائص الرسم
  PlotIndexSetInteger(0, PLOT_DRAW_TYPE, DRAW_NONE);
  PlotIndexSetInteger(1, PLOT_DRAW_TYPE, DRAW_NONE);
  PlotIndexSetInteger(2, PLOT_DRAW_TYPE, DRAW_NONE);
  PlotIndexSetInteger(3, PLOT_DRAW_TYPE, DRAW_NONE);
  PlotIndexSetInteger(4, PLOT_DRAW_TYPE, DRAW_NONE);
  PlotIndexSetInteger(5, PLOT_DRAW_TYPE, DRAW_TEXT);
  PlotIndexSetString(5, PLOT_LABEL, "Strong");
  PlotIndexSetInteger(5, PLOT_LABEL_SHIFT, (ENUM_INDEXBUFFER_TYPE)15); // تحويل القيمة 15 إلى نوع البيانات ENUM_INDEXBUFFER_TYPE
  PlotIndexSetInteger(5, PLOT_LABEL_COLOR, PLOT_LABEL_COLOR);
  
  // إرجاع قيمة النجاح
  return(INIT_SUCCEEDED);
}

// حساب قيم المؤشر
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
  // تعريف متغيرات محلية
  int i, limit;
  
  // تحديد عدد الشموع للحساب
  if(prev_calculated > rates_total || prev_calculated <= 0)
    {
      limit = rates_total - 1;
    }
  else
    {
      limit = rates_total - prev_calculated;
    }
  
  // حلقة على الشموع من الأحدث إلى الأقدم
  for(i = limit; i >= 0; i--)
    {
      // نسخ قيم الشموع إلى المصفوفات
      OpenBuffer[i] = open[i];
      CloseBuffer[i] = close[i];
      HighBuffer[i] = high[i];
      LowBuffer[i] = low[i];
      
      // حساب جسد الشموع
      BodyBuffer[i] = MathAbs(CloseBuffer[i] - OpenBuffer[i]);
      
      // تحقق من شروط الشمعة المشترين
      if(CloseBuffer[i] > OpenBuffer[i] && HighBuffer[i] == CloseBuffer[i] && LowBuffer[i] >= OpenBuffer[i] - BodyBuffer[i])
        {
          // إظهار النص "Strong" فوق الشمعة
          TextBuffer[i] = "Strong ";
        }
      else
        {
          // إخفاء النص
          TextBuffer[i] = "";
        }
    }
  
  // إرجاع عدد الشموع المحسوبة
  return(rates_total);
}

please help i have this errors 

+++++++++++


Files:
Screenshot_1.jpg  142 kb
 
mohamed alfekey:

please help i have this errors 

+++++++++++


You cannot define a text buffer, there is no such thing. - Only double is allowed.
 
Dominik Egert #:
You cannot define a text buffer, there is no such thing. - Only double is allowed.
thanks i fixed this But have new problem ....

The overwriting on the indicator disappears after it appears on two or three candles in the strategy tester


#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);
  }
//+------------------------------------------------------------------+



Files:
 
//---- main loop
   for(int i=0; i<= limit; i++)

Will  that change work ?

 
mohamed alfekey #:
thanks i fixed this But have new problem ....

The overwriting on the indicator disappears after it appears on two or three candles in the strategy tester




Because you are interating backwards, and you are reusing the same object names.

Create the object names using the timestamp from Time[] array.

Change your for loop to work chronologically forward.

Add #property strict to the top of the file.

Use the "modern" names for event handlers.

 
Soewono Effendi #:

Will  that change work ?

NO , :(

>>Thanks for help
 
Dominik Egert #:
Because you are interating backwards, and you are reusing the same object names.

Create the object names using the timestamp from Time[] array.

Change your for loop to work chronologically forward.

Add #property strict to the top of the file.

Use the "modern" names for event handlers.

I apologize to you, but I do not have enough experience to understand all of this. Therefore, if you correct one of them for me, I will understand more. Thank you very much.
 
instead of OnStart, use OnCalculate
 
mohamed alfekey #:
I apologize to you, but I do not have enough experience to understand all of this. Therefore, if you correct one of them for me, I will understand more. Thank you very much.
take a look at working versions on code base. There are good coded versions available. Learn from them.

It will be better than getting spoon fed by me.
 
Dominik Egert #:
take a look at working versions on code base. There are good coded versions available. Learn from them.

It will be better than getting spoon fed by me.
Okay thank you 

.

i fixed the Problem 
Reason: