Тестер бинарных опционов - страница 3

 


не сработало, только 0 на всех счетчиках, попробовал поставить в OnInit() и тоже не сработало

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 limit = rates_total - prev_calculated; // definindo limit
  if (MaximoDeBarras>0 && MaximoDeBarras<Bars) limit = MaximoDeBarras;
  //--- definindo arrays/buffer
  ArraySetAsSeries(Buffer1,true);
  ArraySetAsSeries(Buffer2,true);
  
  if(prev_calculated<1)
  {ArrayInitialize(Buffer1, 0);
   ArrayInitialize(Buffer2, 0);}
   else
      limit++;
      
//--- loop principal
     
for (int i = limit-1; i>=0; i--){
...


for(int i=limit-1;i<6;i--) 
double nVit2 = 0.01;
double nDer2 = 0.01;
{

 if(Buffer2[cExpiration+1]>0.000001&&Buffer2[cExpiration+1]<9999999 && Buffer2[cExpiration+1]!=EMPTY_VALUE && Close[1]>Close[cExpiration+1])
        {
         nDer2+=0.5;
        } 
        
        
        if(Buffer1[cExpiration+1]>0.000001&&Buffer1[cExpiration+1]<9999999 && Buffer1[cExpiration+1]!=EMPTY_VALUE && Close[1]>Close[cExpiration+1])
        
         {nVit2+=0.5;}
         
         if(Buffer1[cExpiration+1]>0.000001&&Buffer1[cExpiration+1]<9999999 && Buffer1[cExpiration+1]!=EMPTY_VALUE && Close[1]<Close[cExpiration+1])
        {
         nDer2+=0.5;
        }
        
        if(Buffer2[cExpiration+1]>0.000001&&Buffer2[cExpiration+1]<9999999 && Buffer2[cExpiration+1]!=EMPTY_VALUE && Close[1]<Close[cExpiration+1])
        {
         nVit2+=0.5;
        }
        

ObjectCreate("Nome2", OBJ_LABEL,0,0,0);// Creating obj.
ObjectSet("Nome2", OBJPROP_CORNER, 0);    // Reference corner
ObjectSet("Nome2", OBJPROP_XDISTANCE, 10);// X coordinate
ObjectSet("Nome2", OBJPROP_YDISTANCE, 165);// Y coordinate
ObjectSetText("Nome2",Nome_do_indicador,10,"Arial",clrAliceBlue);

ObjectCreate("Vitórias2", OBJ_LABEL,0,0,0);// Creating obj.
ObjectSet("Vitórias2", OBJPROP_CORNER, 0);    // Reference corner
ObjectSet("Vitórias2", OBJPROP_XDISTANCE, 10);// X coordinate
ObjectSet("Vitórias2", OBJPROP_YDISTANCE, 180);// Y coordinate
ObjectSetText("Vitórias2","Vitórias:"+(nVit2),10,"Arial",clrAliceBlue);

ObjectCreate("Derrotas2", OBJ_LABEL,0,0,0);// Creating obj.
ObjectSet("Derrotas2", OBJPROP_CORNER, 0);    // Reference corner
ObjectSet("Derrotas2", OBJPROP_XDISTANCE, 10);// X coordinate
ObjectSet("Derrotas2", OBJPROP_YDISTANCE, 195);// Y coordinate
ObjectSetText("Derrotas2","Derrotas:"+MathRound(nDer2),10,"Arial",clrAliceBlue);

if((nVit2/(nVit2+nDer2)*100)>0){
ObjectCreate("wR2", OBJ_LABEL,0,0,0);// Creating obj.
ObjectSet("wR2", OBJPROP_CORNER, 0);    // Reference corner
ObjectSet("wR2", OBJPROP_XDISTANCE, 10);// X coordinate
ObjectSet("wR2", OBJPROP_YDISTANCE, 210);// Y coordinate
ObjectSetText("wR2","WinRate:"+NormalizeDouble(((nVit2)/(nVit2+MathRound(nDer2))*100),Digits)+"%",10,"Arial",clrAliceBlue);
         }
     }
}
 

//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+