int start()
{ double temp=0;
int buyorder=0;
for(int i=0 ;i<OrdersTotal();i++)
{
int a= OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
{
temp=temp+OrderOpenPrice();
buyorder++;
}
}
double avg = temp/buyorder;
printf("AVG = ",avg);
return (0);
}