int start()
{
int total =OrdersTotal();
double buymax=0;
double buymin=10000;
double sellmax=0;
double sellmin=10000;
if(total==0)
{
Print("Please Open Order ");
return (0);
}
if(total>0)
{
for(int i=0;i<total;i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
{
if(OrderOpenPrice() > buymax)
{
buymax=OrderOpenPrice();
}
if(OrderOpenPrice() < buymin)
{
buymin=OrderOpenPrice();
}
}
if(OrderType()==OP_SELL)
{
if(OrderOpenPrice() > sellmax)
{
sellmax=OrderOpenPrice();
}
if(OrderOpenPrice() < sellmin)
{
sellmin=OrderOpenPrice();
}
}
}
}
Print("BUYMAX :",buymax);
Print("BUYMIN :",buymin);
Print("SELLMAX :",sellmax);
Print("SELLMIN :",sellmin);
return(0);
}