View Single Post
  #9 (permalink)  
Old 05-03-2006, 03:30 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Quote:
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
Some borkers prevents more than 1 pending orders (NothFinance is an example), Could you try it with Fibo Group?
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote