Download MetaTrader 5

Halving position

To add comments, please log in or register
suznmark
25
suznmark  

Hi Guys,


Can anyone tell me what's the most efficient way in MT4 to halve my position on a trade. For example I've made 20 pips on 4 mini contracts and I want to take the profit on two of the contracts and then continue with the trade on the other two contracts for another 20 pips.


In a long trade for example, do I have to close my trade on the 4 contracts and then buy another 2 contracts or should I just sell 2 contracts at the 2 pip mark leaving me with 2 contracts? Or is there a better way.


Cheers, Mark

Stuart Browne
6031
Stuart Browne  
suznmark:

Hi Guys,


Can anyone tell me what's the most efficient way in MT4 to halve my position on a trade. For example I've made 20 pips on 4 mini contracts and I want to take the profit on two of the contracts and then continue with the trade on the other two contracts for another 20 pips.


In a long trade for example, do I have to close my trade on the 4 contracts and then buy another 2 contracts or should I just sell 2 contracts at the 2 pip mark leaving me with 2 contracts? Or is there a better way.


Cheers, Mark

Hi Mark

You could close all and then re-buy/sell 1/2 the amount but you will be paying more spread and/or commission. Your first idea is the best, just close out 1/2 the position using something like:

OrderClose(OrderTicket(),OrderLots()/2,varClosePrice,varSlippage,varColour);

 
Cheers
Stu

Biantoro Kunarto
16130
Biantoro Kunarto  
Filter:

Hi Mark

You could close all and then re-buy/sell 1/2 the amount but you will be paying more spread and/or commission. Your first idea is the best, just close out 1/2 the position using something like:

 
Cheers
Stu

Hi, I think you must normalize the lot size before that

int DigitLot = 2;
double Lot = NormalizeDouble(OrderLots()/2,DigitLot);
OrderClose(OrderTicket(),Lot,varClosePrice,varSlippage,varColour);
Stuart Browne
6031
Stuart Browne  
biantoro:

Hi, I think you must normalize the lot size before that

Yes, as well as other error checking (eg min lots)
To add comments, please log in or register