double buypcccyk()
{
double sum=0;
for(int i=0; i<OrdersHistoryTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderSymbol()==Symbol() &&OrderType()==0 )
{
sum+=OrderSwap()+OrderCommission()+OrderProfit();
}
}
}
return(sum);
}
double sellpcccyk()
{
double sum=0;
for(int i=0; i<OrdersHistoryTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
if(OrderSymbol()==Symbol() &&OrderType()==1)
{
sum+=OrderSwap()+OrderCommission()+OrderProfit();
}
}
}
return(sum);
}