How to make All "Open" buy trades with same tp

 

hello every one 

I am new to mql5 but have good programming skills.

I want to do the following:

make all open buy positions with same tp 

i tried using the codes in the documentation but it is really hard and i cant find a way out. 

any help or advice will be highly appreciated 

 
metadev :

hello every one 

I am new to mql5 but have good programming skills.

I want to do the following:

make all open buy positions with same tp 

i tried using the codes in the documentation but it is really hard and i cant find a way out. 

any help or advice will be highly appreciated 

Specify: Do you want to set the same TP level for each 'BUY' position (for example, 100 pips) or do you want to set Take Profit at the same price (for example, at 1.23654)?

 
In general, you can look at this code (this is a script, not an Expert Advisor, therefore the code is as lightweight as possible and there are no some checks).  Apply Same Take Profit:
 

I want to make the takeprofit of each pending order, the activated price of the last pending order 

for example:

i have an initial buy trade, below there is a pending order 30 pips below,

if the pending order is activated, make its takeprofit at the initial price of the initial trade, ( for both the buy trade and the activated pending order)

if another pending order is activated, make its tp at the open price of the last activated order, as well as the tp of the initial buy trade ( same tp)

and so on.

Your help is highly appreciated.

Thank you

 
metadev :

I want to make the takeprofit of each pending order , the activated price of the last pending order 

for example:

i have an initial buy trade, below there is a pending order 30 pips below,

if the pending order is activated, make its takeprofit at the initial price of the initial trade, ( for both the buy trade and the activated pending order)

if another pending order is activated, make its tp at the open price of the last activated order, as well as the tp of the initial buy trade ( same tp)

and so on.

Your help is highly appreciated.

Thank you

Sorry, I do not understand your point. Show your idea in a picture.

 
metadev: if the pending order is activated, make its takeprofit at the initial price of the initial trade,
  1. No need to remember which is the second one, and pole it waiting for it to open. Just set the TP when you post the pending trade.
  2. How To Ask Questions The Smart Way. 2004
              Prune pointless queries.

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

 
No thanks i know how to ask my questions !