Close all orders

 

hi

I need the code in expirt to close all orders

I wrote this cood but its not working ... any one help me in this plzzzzzzzzz. ???

-------------

for (int j=0; j<OrdersTotal(); j++)

{

OrderSelect(j, SELECT_BY_POS, MODE_TRADES);

OrderPrint();

if ( OrderType() == OP_BUY )

{

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);

{

else

OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);

}

---------------

 
mas:
hi

I need the code in expirt to close all orders

I wrote this cood but its not working ... any one help me in this plzzzzzzzzz. ???

-------------

for (int j=0; j<OrdersTotal(); j++)

{

OrderSelect(j, SELECT_BY_POS, MODE_TRADES);

OrderPrint();

if ( OrderType() == OP_BUY )

{

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);

{

else

OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);

}

---------------

There are the scripts here to close the orders.

You may use it as a sample.

 

thank u very match