TakeProfit question

 

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. 

 
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
 
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?? 

 
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?
 

Where can I found this example exactly??

 
Antoine:

Where can I found this example exactly??

Depends on your MT5 installation folder. My path is c:\Program Files\MetaTrader 5\MQL5\Include\
 
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.
Reason: