partial closing or an order

 

Hello,

Please could you help me on this?

1) Lets say I use OrderSend() for 2 lots and I get into the market.

2) After a while, I would like to use OrderClose() close only 1 lot

3) The idea is that the remaining lot (only one) will close automatically when gets the stoplose/takeprofit level

My question is: will MT4 know that it has to close only one position, because I already closed the other?

I got some execution errors, but I think that technically this should work. What do you think?

My dubts are:

- Should I close the remaining order also by using OrderClose() ?

- I only can use OrderClose() to close - at once - all lots I opened with the same order ticker?

Thanks for your answers.

bpsys

 

You can use OrderClose() to close or take multiple partial exits. The ticket number of the remaining active order will change with each partial exit.

Try it on Demo.

 
Good question and answer. Would you look at my topic Settings and tweaks for beginners and answer those questions if they haven't been answered by the time you check. I've had one up for a few days. Thank you.