Download MetaTrader 5

TakeProfit question

To add comments, please log in or register
Do you often publish source codes? Find out how to do that correctly!
Antoine
92
Antoine 2010.12.08 18:50 

Hello,

Is it possible to modify the quantity of Lot sell or buy after a "TakeProfit"?

For example if I bought 1 Lot of EURUSD at 1.3900. I would like that my takeprofit request (resquest.tp) sell 0.5 lot at 1.3950 and let the other 0.5 lot in the market.

Is it possible and how can I do??

Thank you. 

Andrei Moraru
1160
Andrei Moraru 2010.12.09 10:41  
After you've bought 1 lot of EUR/USD you can set two pending sell orders for 0.5 lot each at 1.3950 and at 1.4000 (or wherever you wanted it).
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM - Documentation on MQL5
Antoine
92
Antoine 2010.12.09 12:04  
enivid:

After you've bought 1 lot of EUR/USD you can set two pending sell orders for 0.5 lot each at 1.3950 and at 1.4000 (or wherever you wanted it).

Thank you Sir, but how can I implement the code for define the 2 sell orders?? 

Pawel Wojnarowski
685
Pawel Wojnarowski 2010.12.09 12:31  
Antoine:

Thank you Sir, but how can I implement the code for define the 2 sell orders?? 

Why don't you search in the example source codes delivered with MT5 terminal?
Antoine
92
Antoine 2010.12.09 20:07  

Where can I found this example exactly??

Pawel Wojnarowski
685
Pawel Wojnarowski 2010.12.09 21:16  
Antoine:

Where can I found this example exactly??

Depends on your MT5 installation folder. My path is c:\Program Files\MetaTrader 5\MQL5\Include\
Andrei Moraru
1160
Andrei Moraru 2010.12.10 10:58  
Antoine:

Thank you Sir, but how can I implement the code for define the 2 sell orders?? 

If you've already figured out how to send market orders there's no problem figuring out how to send pending orders, and to send 2 pending orders you just have to copy the same lines twice and change the order price. Not a rocket science at all.
To add comments, please log in or register