OrderModify Only Modifies Buy Trades
pirokele: How do i make it to modify both sell and buy trades.
If it's a sell trade, how do you think you can place the SL below market?
pirokele:
The following code only modifies buy trades while sell trades are not modified. How do i make it to modify both sell and buy trades. Thanks.
Try something like this...
bool ModifyOrders=false; for(int i=0; i<OrdersTotal(); i++) { if(OrderSelect(i,SELECT_BY_TICKET,MODE_TRADES)) { //Alert("Order Ticket = ", OrderTicket(), " Order Open Price= ", OrderOpenPrice()); ticket=OrderTicket(); pricelevel=OrderOpenPrice(); if(OrderType()==OP_BUY) ModifyOrders=OrderModify(ticket,pricelevel,NormalizeDouble(Bid-500*Point,Digits),NormalizeDouble(Ask+500*Point,Digits),0,clrBlue); if(OrderType()==OP_SELL) ModifyOrders=OrderModify(ticket,pricelevel,NormalizeDouble(Ask+500*Point,Digits),NormalizeDouble(Bid-500*Point,Digits),0,clrRed); } }
Nikolaos Pantzos:
Try something like this...
The following code only modifies buy trades while sell trades are not modified. How do i make it to modify both sell and buy trades. Thanks.