Closin Trades in a Group

 

Hello,

I need a function to close trades in a group, grouped by comment or magic number or whatever else.... when one of them hit TP or SL.

For example I have 6 trades in a group at the same time and each trade has 50 pips SL and 50 pips TP. When one of them hit TP or SL all of the trades in the same group will be closed. But the rest of trades out of this group will remain?

Anybody has something like that?

 
What have you got so far?
 
honest_knave:
What have you got so far?
i did not get you?
 

Have you tried to code it yourself yet?

Forum on trading, automated trading systems and testing trading strategies

Welcome,

  • Usually people who cannot code do not receive free help on this forum, although it could happen if you are lucky. Be patient.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free).

Good luck. 


 
honest_knave:

Have you tried to code it yourself yet?


I am not able to code myself.

I searched all the available sections and got some "close all" scripts which close all running ones.

 

What i am looking is lets say you have 5-6 trades with same comment "simple trade" and once one of those trades hit TP or SL script should close all remaining trades with comment "simple trade" and keep other running trades without comment or with different comments. 

And looking for free as i am not trading with real money andtrying to build one reliable systme as possible as i can. 

 

You're unlikely to find somebody willing to work for free for you on this site.

There are other forums where you may get a response.

Or, you can take the time to learn to code. 

Either way, good luck! 

 
25984:

I am not able to code myself.

I searched all the available sections and got some "close all" scripts which close all running ones.

 

What i am looking is lets say you have 5-6 trades with same comment "simple trade" and once one of those trades hit TP or SL script should close all remaining trades with comment "simple trade" and keep other running trades without comment or with different comments. 

And looking for free as i am not trading with real money andtrying to build one reliable systme as possible as i can. 

Why not simply change all the SL or TP on those trades so that they exit at the same time?
 
Keith Watford:
Why not simply change all the SL or TP on those trades so that they exit at the same time?

I did not get your idea exactly?

 

Actually i am not a full time trader and need this for not missing exit time of all runing trades in the same group when one of them hit TP or SL. So the idea that i pursue is close all trades in a group (you can group them with same comment or something similar to this) if one of the trade hit SL or TP.

 
honest_knave:

You're unlikely to find somebody willing to work for free for you on this site.

There are other forums where you may get a response.

Or, you can take the time to learn to code. 

Either way, good luck! 

Thanks for comments.
 
25984: When one of them hit TP or SL all of the trades in the same group will be closed. But the rest of trades out of this group will remain?
25984: you can group them with same comment
  1. Set the TP the same for all in the group.
  2. Not a good idea, brokers can change comments, including complete replacement.
 
whroeder1:
  1. Set the TP the same for all in the group.
  2. Not a good idea, brokers can change comments, including complete replacement.

TP and SL is same for all. 50 pips. But ok in the end i got that i need a complete EA not only a script.

 

thanks a lot :) 

Reason: