Download MetaTrader 5

More then one TP per order or killing all limit orders when s/l is hit

To add comments, please log in or register
Publish the program in the Market and sell it to millions of traders!
coolkeeper
11
coolkeeper 2013.07.19 18:19 

Hello, as I am new to this forum I 'm not quite sure if this is the right category. If not pls move it to the right one.


I'm looking for a script that allows me

1. To set more then just 1 TP (I need 5-10) per order

or

2. If the order hits the s/l all pending limit orders should be automatically canceled.


The problem I currently have is that I'm working with up to 10 TP. I am hoever not a full time trader so i can't make the TP manually all the times. I would like to place them with the order and just let the trade run without any further actions to be taken. Unfortunatly MT 5 only allows 1 TP for the whole order.

The other option would be instead of using TP to set at each TP level a limit order. The only problem than is that if the s/l is hit, all the pending limit orders are still in the market and might be filled. So I would need a script that delets all pending limit orders when the s/l gets hit.

If non of these options is convertible the only chance would be to use MT 4 and to open 10 different positions with seperate TP. But pulling out 10 orders with each a diffrent t/p might take a while and I would have to manage 10 single s/l's. Or is there a possibility in MT4 to summarize the s/l's of 10 different trades?


I hope I could make my point clear. I would be realy glad if there is an existing script put there or if it is at least possible to write one.

Alain Verleyen
Moderator
30755
Alain Verleyen 2013.07.19 18:37  
coolkeeper:

Hello, as I am new to this forum I 'm not quite sure if this is the right category. If not pls move it to the right one.


I'm looking for a script that allows me

1. To set more then just 1 TP (I need 5-10) per order

or

2. If the order hits the s/l all pending limit orders should be automatically canceled.


The problem I currently have is that I'm working with up to 10 TP. I am hoever not a full time trader so i can't make the TP manually all the times. I would like to place them with the order and just let the trade run without any further actions to be taken. Unfortunatly MT 5 only allows 1 TP for the whole order.

The other option would be instead of using TP to set at each TP level a limit order. The only problem than is that if the s/l is hit, all the pending limit orders are still in the market and might be filled. So I would need a script that delets all pending limit orders when the s/l gets hit.

If non of these options is convertible the only chance would be to use MT 4 and to open 10 different positions with seperate TP. But pulling out 10 orders with each a diffrent t/p might take a while and I would have to manage 10 single s/l's. Or is there a possibility in MT4 to summarize the s/l's of 10 different trades?


I hope I could make my point clear. I would be realy glad if there is an existing script put there or if it is at least possible to write one.

Hello,

Welcome tot he forum. If you want to code it yourself then it's the right section, if not then you have to search or ask someone to code it for you.

You need an EA for such thing, not a script. The second option with limit order set at server side seems to me more reliable.

coolkeeper
11
coolkeeper 2013.07.19 18:59  

Thanks for your fast answer.

As I cant write the EA myself and haven't found something so far I guess I have to ask someone to do it for me or give up hope^^

Alain Verleyen
Moderator
30755
Alain Verleyen 2013.07.19 19:10  
coolkeeper:

Thanks for your fast answer.

As I cant write the EA myself and haven't found something so far I guess I have to ask someone to do it for me or give up hope^^

I fear that hope doesn't help
Jinsong Zhang
15624
Jinsong Zhang 2013.07.20 06:00  

you cann't set more than one TP but you have another way, set pending orders with opposite direction of position.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
coolkeeper
11
coolkeeper 2013.07.20 12:04  

Yep I know that but my problem is that these pending orders will be still in the market, even when my order runs into it's stop loss.
So when my order is stopped all pending orders should be automatically canceled. Unfortunatley MT5 doesn't have such a function.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
To add comments, please log in or register