Download MetaTrader 5
To add comments, please log in or register
Develop applications to order. Make profit using Freelance service!
eacombi
9
eacombi 2015.05.27 04:43 
Hi,

What is the code if I want to put one buystop order and one sellstop order for any open trades that I opened manually (or by another EA)? I trade multiple currency pairs so I need an EA that just sit on my MT4, wait for any open trades (any symbol), then add/open the pending orders.

Thank in advance.
Alain Verleyen
Moderator
30298
Alain Verleyen 2015.05.27 09:02  
Bwalya Tambule
441
Bwalya Tambule 2015.06.06 13:47  
eacombi:
Hi,

What is the code if I want to put one buystop order and one sellstop order for any open trades that I opened manually (or by another EA)? I trade multiple currency pairs so I need an EA that just sit on my MT4, wait for any open trades (any symbol), then add/open the pending orders.

Thank in advance.
double SpreadA = (Ask - Bid);


double M=((Bid+SpreadA)+1*Point)



TakeTPB = (Bid+15*Point);


Order = OrderSend(Symbol(),OP_BUYLIMIT,Lot,M,2,0,TakeTPB);
That is one point not one pip
These are the rules for orders opening prices :
Order TypeOpen PriceClose PriceOpen Price of a Pending OrderTransforming a Pending Order into aMarket Order
Buy
Ask
Bid
Sell
Bid
Ask
BuyLimit
Below the current Ask priceAsk price reaches open price
SellLimit
Above the current Bid priceBid price reaches open price
BuyStop
Above the current Ask priceAsk price reaches open price
SellStop
Below the current Bid priceBid price reaches open price
/
To add comments, please log in or register