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...
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.