Dear fellow traders.
I use the following Script to set Take Profit at current Bid Price (My broker having Stops level floating point at 0 point) of Buy order.
But If I have 10-15 open trades and I drag the Script. It is missing to set TP for couple of orders. Any one can modify this? (If the price changed we can set SL price at that price so it can be done, But I don't know how to code that)
I use the following Script to set Take Profit at current Bid Price (My broker having Stops level floating point at 0 point) of Buy order.
But If I have 10-15 open trades and I drag the Script. It is missing to set TP for couple of orders. Any one can modify this? (If the price changed we can set SL price at that price so it can be done, But I don't know how to code that)
MQL4:
int start() { int digits = MarketInfo(Symbol(),MODE_DIGITS); for(int i=OrdersTotal()-1;i>=0;i--) { if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue; if(OrderSymbol()!=Symbol()) continue; RefreshRates(); if((OrderType()==OP_BUY)) OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),Bid,OrderExpiration(),CLR_NONE); } return(0); }
Last edited: