for(int i = OrdersTotal()-1; i >= 0; i--) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol() == Symbol() && OrderType() == OP_BUY) { OrderModify(...); } }
with thanks for your prompt reply
for(int i = OrdersTotal()-1; i >= 0; i--)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol() == Symbol() && OrderType() == OP_BUY)
{
OrderModify(????..);
}
}
how can I determine ticket no. because the buy position is in cycle and for each cycle two buy will be opened and modifyed
why do you need determine the ticket no.?
my friend
please note I have two open order and want to modify both of them only in Take Profit
please wrote the complete program (OrderModify)
u want the all code :(
extern int SellStoploss = 200; extern int SellTakeprofit = 1000; double SL = Bid + SellStoploss*Point; if (SellStoploss == 0) SL = 0; double TP = Bid - SellTakeprofit*Point; if (SellTakeprofit == 0) TP = 0; for(int i = OrdersTotal()-1; i >= 0; i--) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol() == Symbol() && OrderType() == OP_BUY) { OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red); } }
u want the all code :(
Thank you very much
another question (sorry)
What does it mean if (OrderSymbol() == Symbol()
I can not understand it

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi every body
If in a EA for example we have two open order that the currency is the same and both of them are buy mode and we want to modify them . how ca we select both of them to modify? we do not know the ticket no. and oreder no.
Tnx