Forum on trading, automated trading systems and testing trading strategies
If you can't find what you need in the Codebase or the Market, then create a request in Freelance Service.
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.
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);
double M=((Bid+SpreadA)+1*Point)
TakeTPB = (Bid+15*Point);
Order = OrderSend(Symbol(),OP_BUYLIMIT,Lot,M,2,0,TakeTPB);
These are the rules for orders opening prices :
Order Type | Open Price | Close Price | Open Price of a Pending Order | Transforming a Pending Order into aMarket Order |
---|---|---|---|---|
Buy | Ask | Bid | ||
Sell | Bid | Ask | ||
BuyLimit | Below the current Ask price | Ask price reaches open price | ||
SellLimit | Above the current Bid price | Bid price reaches open price | ||
BuyStop | Above the current Ask price | Ask price reaches open price | ||
SellStop | Below the current Bid price | Bid price reaches open price |
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.