Count the total profit in the historic :

Code:
double countprofit(datetime time){
   double profit=0;
   for(int j=OrdersHistoryTotal()-1;j>=0;j--){
      if(!OrderSelect(j,SELECT_BY_POS,MODE_HISTORY))continue;
         if(OrderMagicNumber()==Magic)
            if(OrderSymbol()==Symbol())
               if(OrderOpenTime()>=time)
                  if(OrderProfit()>0)profit+=OrderProfit()/(OrderLots()*10);
   }
   return(profit);
}