I see I was making a stuff-up, all one doesn't have to count the closed orders, as they are wrapped up in the accountbalance or accountequity. So the calc is far more simple, maybe this is right.
Code:
bool IsProfitforDayReached()
{
//Got to get this function to see the new Day
static int totalPips = 0;
static double totalProfits = 0.0;
static double currentBal
if newday()
{
totalPips = 0;
totalProfits = 0.0;
currentBal = AccountEquity();
}
if((AccountEquity()-currentBal)/currentBal>0.05)
{
return(true);
}
else
{
return(false);
}
}