Scaling out with Limit Orders

 

A bit confused.

I want to scale out from a position

So I place a Buy order for 0.4 lots with SL set but no TP.  No problem there

Then I want to take half off after 300 pips.

trade.OrderOpen("EURUSD",ORDER_TYPE_SELL_LIMIT,0.2,limit_price,price,sl,tp,ORDER_TIME_GTC,0,NULL)

Assume I got filled at 1.33000. and want to get out with half 1.33300

sl and tp is not of interest so I put them as zero. So I have two price parameters "price" and "limit_price"

Made a few tries but I always get back "invalid price".

And sometimes I read that the limit out price should be a distance and other it is the actual limit out price.

Please enlighten me.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
ingvar_e:

A bit confused.

I want to scale out from a position

So I place a Buy order for 0.4 lots with SL set but no TP.  No problem there

Then I want to take half off after 300 pips.

trade.OrderOpen("EURUSD",ORDER_TYPE_SELL_LIMIT,0.2,limit_price,price,sl,tp,ORDER_TIME_GTC,0,NULL)

Assume I got filled at 1.33000. and want to get out with half 1.33300

sl and tp is not of interest so I put them as zero. So I have two price parameters "price" and "limit_price"

Made a few tries but I always get back "invalid price".

And sometimes I read that the limit out price should be a distance and other it is the actual limit out price.

Please enlighten me.