Download MetaTrader 5

Partial close?

To add comments, please log in or register
No time to learn MQL5? Order your application from a developer!
Vos77
169
Vos77 2012.02.16 05:44 

Hi Forum,

Can anyone confirm that it is possible to scale into a position, buy1, buy2, buy3 then close half of each position on a closing signal, and the other half at the secondary signal?

example:

buy1 = 1 lot @ 0.89833

buy2 = 1 lot @ 0.89835

buy3 = 1 lot @ 0.89837

Average buy price = 0.89835

close buy 1.5 lots @ target 1.

close buy 1.5 lots @ target 2. 

 

Thanks everyone.

Vos77 

Andrei Moraru
1160
Andrei Moraru 2012.02.16 11:02  
Sure, it's possible.
Biantoro Kunarto
14896
Biantoro Kunarto 2012.02.17 03:46  
for partial close, you can use PositionSelect() and then close position with mrequest.volume = PositionGetDouble( POSITION_VOLUME )*0.5;
Documentation on MQL5: Trade Functions / PositionSelect
  • www.mql5.com
Trade Functions / PositionSelect - Documentation on MQL5
To add comments, please log in or register