Please correct this for me !!

 

Please help me fix this code so that I may open Buy & Sell a the same time

int start()

{

OrderSend(EURUSD,OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);

OrderSend(EURUSD,OP_SELL,0.1,Ask,3,Ask-15*Point,Ask+15*Point);


return;
}

 

try



OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-15*Point,Ask+15*Point);
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Bid+15*Point,Ask-15*Point);

 
iVE TRIED IT BUT IT ONLY OPENS BUY CAN YOU FIX IT AGAIN FOR ME
 

try



OrderSend(Symbol(),OP_SELL,0.1,Bid,5,Bid+15*Point,Bid-15*Point);



maybe your broker does need more slippage, if it does not work try to increase 15 to 25. It also depends whic symbol you try to buy/sell. Slippage may not be enough for volatile symbols. if its one of the main symbols then slippage 3..5 should be more then enough.



I never seen on mt4 but your provider may not allow you to open conquring positions at same time.

 
Put RefreshRates() function between your strings.
 

Thanx really helpful Iam totally gratiful But needs more help, it just does not stop opening the order. I want it to open the order just once until it reaches 15 pip then it may open another order

 

Ah. This project is developing scope creep. :-)

Webroller - if you care to search the forum, there are plenty of questions and answers regarding the code to limit yourself to one order at a time.


CB

 
fx1.net:

try



OrderSend(Symbol(),OP_SELL,0.1,Bid,5,Bid+15*Point,Bid-15*Point);



maybe your broker does need more slippage, if it does not work try to increase 15 to 25.



If your using a 5 digit broker, you want to +/- 150*Point.

The smallest amount you can have is:

double minGap.stops = MarketInfo( Symbol(), MODE_STOPLEVEL )*Point;
On IBFX it's 30

Reason: