Strange things happened during my EA back testing !!!

 

Please refer to the screenshot below after back testing.

3 questions on the strange things are shown in the picture too.

I read iCustom usage and check my EA and indicator again and again, finally can't find the root cause.

Please help urgently and thanks a lot ! 

 

(*. You can click the screenshot to open and enlarge it to see the questions more clearly) 

 

 

 

 This is the critical codes for the indicator "Reverse" (other codes were replaced with "..." so that it's clear for the critical codes):

int OnInit()
  {
   IndicatorBuffers(8);
   ....
   SetIndexBuffer(6,ExtBuffer1);
   ....
  }

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[])
  {
   ...
   ...

   for(i=limit-1; i>=0; i--)
     {
      ...
      Value=...;
      ExtBuffer0[i]=MathLog((1+Value)/(1-Value));
      if(ExtBuffer0[i]>0) ExtBuffer1[i]=10;
      else ExtBuffer1[i]=-10;
     }

   ...
   ...
  }

 

 This is the critical codes in the EA to use the indicator(other codes were replaced with "..." so that it's clear for the critical codes):

 

...
...

void Reverse()
  {
   Joy1=iCustom(Symbol(),0,"Reverse",6,1);
   Joy2=iCustom(Symbol(),0,"Reverse",6,2);
  }

void openPosition()
  {
   ...
   if(Joy2<=-10 && Joy1>=10) 
    {
    r=OrderSend(Symbol(),OP_BUY,lotSize,Ask,slippage,0,0,TradeComment,MAGIC,0,clrMediumBlue);
    ...
    }
   else if(Joy2>=10&& Joy1<=-10) 
    {
    r=OrderSend(Symbol(),OP_SELL,lotSize,Bid,slippage,0,0,TradeComment,MAGIC,0,clrMediumVioletRed);
    ...
    }
   ...
   }
void closePosition()
  {
   ...
    if(openType==OP_BUY && Joy2>=10 && Joy1<=-10)
     for(i=OrdersTotal();i>=1; i--)
         if(OrderSelect(i-1,SELECT_BY_POS,MODE_TRADES)==true && OrderMagicNumber()==MAGIC)
           {
            r=OrderClose(OrderTicket(),OrderLots(),Bid,slippage,clrDodgerBlue);
            ...
            }
   else if(openType==OP_SELL && Joy2<=-10 && Joy1>=10) 
    for(i=OrdersTotal();i>=1; i--)
         if(OrderSelect(i-1,SELECT_BY_POS,MODE_TRADES)==true && OrderMagicNumber()==MAGIC)
           {
            r=OrderClose(OrderTicket(),OrderLots(),Ask,slippage,clrDeepPink);
            ...
            }
   ...  
  }
void OnTick()
  {
   ...
   Reverse();
   openPosition();
   closePosition();
  }
 
moonsboy:

Please refer to the screenshot below after back testing.

3 questions on the strange things are shown in the picture too.

I read iCustom usage and check my EA and indicator again and again, finally can't find the root cause.

Please help urgently and thanks a lot ! 

 

(*. You can click the screenshot to open and enlarge it to see the questions more clearly) 

 

 

Hi

Without seeing the code behind the EA it's going to be next to impossible for anyone to help you sorry 

 
Dears, the codes were inserted in my first post and please help!
 
Anyone can help ? Looking forward to resolving it!
 
Some good friend, please help me !
 
moonsboy:
Anyone can help ? Looking forward to resolving it!
The interesting part is missing from the code that you have posted. Show the rest of the OnCalculate function.
 
moonsboy:
Anyone can help ? Looking forward to resolving it!
As said also by Filter, show us full code of the expert advisor and indicator...
Regards  
 

It's so strange. You can see the yellow line now after increasing the indicator width from 1 to 2.

However, it's still thinner. What's the root cause? Any friend has the similar experience?