correct way to open orders ? , ordersend ...

 

I use this code to open orders , the OP_SELL works correctly , BUT the OP_BUY is always 2 pips below of the 'take_profit' level , why ? , something wrong ?

OrderSend(Symbol(), OP_BUY, lots ,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Blue);
OrderSend(Symbol(), OP_SELL, lots ,Bid, 3, Bid + stop_loss * Point, Ask - take_profit * Point, IDENT, MAGIC, 0, Red);
 

thanks for helping. 

 
OrderSend(Symbol(), OP_BUY, lots ,Ask, 3, Ask - stop_loss * Point, Ask + take_profit * Point, IDENT, MAGIC, 0, Blue);
OrderSend(Symbol(), OP_SELL, lots ,Bid, 3, Bid + stop_loss * Point, Bid - take_profit * Point, IDENT, MAGIC, 0, Red);
Do not forget about the spread
 
buju:

I use this code to open orders , the OP_SELL works correctly , BUT the OP_BUY is always 2 pips below of the 'take_profit' level , why ? , something wrong ?

OrderSend(Symbol(), OP_BUY, lots ,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Blue);
OrderSend(Symbol(), OP_SELL, lots ,Bid, 3, Bid + stop_loss * Point, Ask - take_profit * Point, IDENT, MAGIC, 0, Red);
 

thanks for helping. 

See message from cyberfx.org 2013.03.25 10:53         for correction 2 pips

my question to you 

what is works correctly  ???       Because it might work for your account but it will not work on every account

Working in Strategy tester is no proof this works on your account

do you use it on a 4 digit account notation "EURUSD"     it is ok  not if you have notation EURUSD like  1.29278  (a lot of requote wil happen)

and if your broker is not   ECN because in that case it is no problem to send it this way....   On ECN accounts you can't send it this way (error 130)

 

thanks , currently working on a 4 digit broker  , not ECN , will change the EA and check results.

 

working , thanks

Reason: