Download MetaTrader 5
To add comments, please log in or register
Register as a seller and start making profit!
William Lee
7
William Lee 2014.09.29 13:57 

Dear all,

I am creating my system to open two pending orders - BuyStop and SellStop

Next, I want it to Close or Delete one of the Stop order when Buy or Sell is executed.

Example:

Case 1: BuyStop and SellStop are Placed

BuyStop is executed - Buy. Then, SellStop should be closed.

Case 2: BuyStop and SellStop are placed

SellStop is executed - Sell. Then, BuyStop should be closed. 

Anyone knows how to code this in MetaEditor?

 

Thanks.  

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.09.29 14:37  
sdas86:

Dear all,

I am creating my system to open two pending orders - BuyStop and SellStop

Next, I want it to Close or Delete one of the Stop order when Buy or Sell is executed.

Example:

Case 1: BuyStop and SellStop are Placed

BuyStop is executed - Buy. Then, SellStop should be closed.

Case 2: BuyStop and SellStop are placed

SellStop is executed - Sell. Then, BuyStop should be closed. 

Anyone knows how to code this in MetaEditor?

 

Thanks.  

 

 

You have to detect the "execution" of your pending order. One way is to check number of orders : count trade orders, count pending orders. When 'trades' increased by 1 and 'pendings' decreased by one, you have your trigger.
/
To add comments, please log in or register