double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
double ProfitHisAll(int md=0)
{
int i,j,t = OrdersHistoryTotal();
double profit = 0.0;
for(i = t-1; i >= 0; i--)
{
if(!OrderSelect(i, SELECT_BY_POS,MODE_HISTORY))continue;
if(NormalizeDouble(OrderMagicNumber()/1000.0-Magic,0) != 0.0)continue;
if(OrderType()>1)continue;
j = iBarShift(OrderSymbol(),PERIOD_W1,OrderCloseTime());
if(md==1 && j>0)continue;
if(md==2 && j!=1)continue;
profit += OrderProfit()-MathAbs(OrderCommission())-MathAbs(OrderSwap());
}
return(profit);
}
|