Dislikedr=OpenDealLife(MAGIC,Symbol(),"S",LotSelAdd,"",3000,30); bool OpenDealLife(int Magic,string eDEAL,string eD,double eLot,string eC,int slp,int timeOutSec){ Slippage of 3000??? Slippage is counted in points. This is extremely dangerous Remon!! Slippage should be <5. If order slips re-try. if(eDEAL != "" && eD=="S"){ i=OrderSend(eDEAL,OP_SELL,eLot,SymbolInfoDouble(eDEAL, SYMBOL_BID),slp,0,0,eC,Magic,0,Red ); } in ordersend, you need to test for i to make sure order was opened: if( i<0) Print("Error opening sell: "+GetLastError());Ignored
(i) may give false sign if the internet is offline
so I use another way to detect if the trade open or not from the current and last state change, increase of lot or increase of orders count
if(OrdersTotalLots(Magic,eDEAL,-1)!=Lots){break;}//may be open buy make a close in sell
---------------------------------------------------------------------------------------------------------------------------
if price moves fast and you want to open a trade in current price
you will try to open trade at 0.10010 price but the price changed to 0.10020 so the order rejected
you will try again to open order at current price 0.10020 but price moves to 0.10030 so the order rejected
you will try again to open order at current price 0.10030 but price moves to 0.10040 so the order rejected
you will try again to open order at current price 0.10040 Finally It Done
So You Want To Open At 0.10010 And End With Opening In 0.10040
but if the slippage was big you will Try To Open At 0.10010 and Just End With Open Order At 0.10020
FMH-ManualTrade ECN.PRO All Time Return:
na