|
Originally Posted by WAW
thanks Coderguru
but i did try to make a difference 10 and even 20 pips and still open only one buy or sell stop and not both orders in the same time?
here is the code :
if ( EAtotal<2 )
OrderSend(Symbol(),OP_SELLSTOP,Lots,S,3,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ", GetLastError());
return(0);
RefreshRates();
OrderSend(Symbol(),OP_SELLSTOP,Lots,b,2,Bid-SL*Point,Bid+TP*Point,"HOG",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES )) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
}
return(0);
}
hope you help me to adujust it
Thanks in advance
|