can someone help me to risolve this little problem?
1. I open an order when my conditions are true.
2. Then after Trailling Stop >= OrderOpenPrice from (1. Order) : Open second Order
3. Then after Trailling Stop >= OrderOpenPrice from (2. Order) : Open third Order
Then Important!!!!:
if first Order is Stopped out CLOSE ALL ORDERS!!!!
for(int i =(OrdersTotal()-1); i >=0; i --){if(OrderSelect(ticket,SELECT_BY_POS,MODE_TRADES)==true)if(OrderType()==OP_BUY){if(OrderClosePrice()==OrderStopLoss()){OrderClose(OrderTicket(),OrderLots(),Bid,Spread,Red); OrderClose(OrderTicket(),OrderLots(),Bid,Spread,Red);}if(OrderStopLoss()<Bid-(100*Point)){OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(100*Point),OrderTakeProfit(),0,Indigo);return;}if(OrderStopLoss()>=OrderOpenPrice()&& CalculateCurrentOrders(Symbol())==1){
ticket1=OrderSend(Symbol(),OP_BUY,LotsLong(),Ask,Spread,0,0,"Einstieg 3",magic,0,Green);return;}}}{if(OrderSelect(ticket1,SELECT_BY_POS,MODE_TRADES)==true)if(OrderType()==OP_BUY){if(OrderStopLoss()>=OrderOpenPrice()&& CalculateCurrentOrders(Symbol())==2){
ticket2=OrderSend(Symbol(),OP_BUY,LotsLong(),Ask,Spread,0,0,"Einstieg 3",magic,0,Green);return;}}}//----}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi,
can someone help me to risolve this little problem?
1. I open an order when my conditions are true.
2. Then after Trailling Stop >= OrderOpenPrice from (1. Order) : Open second Order
3. Then after Trailling Stop >= OrderOpenPrice from (2. Order) : Open third Order
Then Important!!!!:
if first Order is Stopped out CLOSE ALL ORDERS!!!!