# Problem: pip count (MQL4)

52

Hi, can someone clear the error to me. I do not find him. Except for the pips all other values are counted correctly. Thanks in advance.

```   double ProfitToday=0,ProfitYesterday=0,ProfitToday1=0,ProfitYesterday1=0;
double pips0=0,pips1=0,pips2=0,pips00,pips01,pips02;
double Faktor;
int Is_DAX=0, Is_DJI=0, Is_JPY=0, Is_EUUS=0, Is_GBUS=0;
string Paar;
//-----------------------------------
for(h=OrdersHistoryTotal()-1;h>=0;h--) // Schleife
{
Paar=OrderSymbol();

if(OrderSelect(h,SELECT_BY_POS,MODE_HISTORY)==true && OrderSymbol()==Symbol()) // Anzahl Trades, pips, Profit heute bei diesem Symbol
{
Faktor=0;
Is_DAX=StringFind(Paar,"DAX",0);
if(Is_DAX==-1) Faktor=Point*A1;
Is_DJI=StringFind(Paar,"DJI",0);
if(Is_DJI==-1) Faktor=Point*B1;
Is_JPY=StringFind(Paar,"JPY",0);
if(Is_JPY==-1) Faktor=Point*C1;
//         Is_EUUS=StringFind(Paar,"EURUSD",0);
//          if(Is_EUUS==-1) Faktor=Point*100;
//         Is_GBUS=StringFind(Paar,"GBPUSD",0);
//          if(Is_GBUS==-1) Faktor=Point*10;
else Faktor=Point*D1;

if(OrderCloseTime()>YesterdayStart)
{

if  (OrderType()== OP_SELL) pips0=pips0+((OrderOpenPrice()-OrderClosePrice())/Faktor);
pips00 = DoubleToStr(pips0,2);}
}
}//Ende Select

if(OrderSelect(h,SELECT_BY_POS,MODE_HISTORY)==true) // Alle Trades heute, gestern, pips und Profit
{
Faktor=0;
Is_DAX=StringFind(Paar,"DAX",0);
if(Is_DAX==-1) Faktor=Point*A1; //A1 = 1
Is_DJI=StringFind(Paar,"DJI",0);
if(Is_DJI==-1) Faktor=Point*A1;
Is_JPY=StringFind(Paar,"JPY",0);
if(Is_JPY==-1) Faktor=Point*B1; //B1 = 10
//else Faktor=Point*D1;            //D1 = 1000

if(OrderCloseTime()>YesterdayStart)
{

if  (OrderType()== OP_SELL) pips1=pips1+((OrderOpenPrice()-OrderClosePrice())/Faktor);
pips01 = DoubleToStr(pips1,2);}

if  (OrderType()== OP_SELL) pips2=pips2+((OrderOpenPrice()-OrderClosePrice())/Faktor);
pips02 = DoubleToStr(pips2,2);}

}
}//Ende Select

ObjectSetText("Label_deals1",eanameParameters,8,"Arial",Blue);
string eanameParameters1=StringConcatenate("","Profit: ",ProfitToday," €");
ObjectSetText("Label_profit1",eanameParameters1,8,"Arial",Blue);
string eanameParameters2=StringConcatenate("","Pips: ",pips00,"");
ObjectSetText("Label_pips0",eanameParameters2,8,"Arial",Blue);

ObjectSetText("Label_deals2",eanameParameters3,8,"Arial",Black);
string eanameParameters4=StringConcatenate("","Profit: ",ProfitYesterday1," €");
ObjectSetText("Label_profit2",eanameParameters4,8,"Arial",Black);
string eanameParameters5=StringConcatenate("","Pips: ",pips02,"");
ObjectSetText("Label_pips2",eanameParameters5,8,"Arial",Black);