Position closing and partial fill behaviour

Created at 21 Mar 2019, 13:35
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TE

terryww2

Joined 22.11.2018

Position closing and partial fill behaviour
21 Mar 2019, 13:35


Hi,

 

from reading the forum, for closing a position, the opposite order has to be sent with the same amount:

  1. can the position be closed with a limit order or only with a market order
  2. if the position can be closed with a limit order, what happens if that limit order is partially filled?

Thanks


@terryww2
Replies

PanagiotisCharalampous
21 Mar 2019, 14:01

Hi terryww2,

  1. Yes you can use limit orders.
  2. The remaining part of the position will remail open.

Best Regards,

Panagiotid


@PanagiotisCharalampous

terryww2
21 Mar 2019, 14:10

Concerning the 2nd point what FIX event can we expect? From the docs we'd expect ExecutionReport with ExecType=F (trade) and OrdStatus=1 (partially filled). Is this the case?

Thanks for the fast reply!


@terryww2

terryww2
21 Mar 2019, 14:43

Also when closing the position with NewOrderSingle request is the tag 44 (price) relevant at all? From what I read in the forum setting take profit is not available via FIX. As I understand the positions can only be closed with NewOrderSingle, opposite position, same volume and when the server sees the request, it opens an order using current bid or ask price (at the time the request reaches the server) making the tag 44 irrelevant. Can you confirm this?


@terryww2

PanagiotisCharalampous
21 Mar 2019, 14:54

Hi terryww2,

  1. Correct. You will receive execution report with 39=1 and 150=F
  2. Tag 44 is relevant for limit orders. If you are closing your position using a limit order, you need to use tag 44.

Best Regards,

Panagiotis


@PanagiotisCharalampous

terryww2
21 Mar 2019, 15:07

If tag 44 (price) is required, does this mean setting take profit is now available via FIX (position is opened and we send opposite limit order with price set for this position = take profit order)? Or what's the significance of setting the price tag when closing the position with a limit order?


@terryww2

PanagiotisCharalampous
21 Mar 2019, 15:21

Hi terryww2,

Any limit order needs a limit price by definition. You need to set the price at which the limit order will be triggered and which will be considered as the limit. FIX API does not support TP and SL in the traditional sense, that of setting them and forgetting about them. SL and TP are UI features but under the hoods they are a stop order and a limit order respectively which are cancelled if not triggered and the position is closed. To make it more clear, the difference of setting a TP via Open API and and setting a limit order via FIX is that if your position is closed by any other reason than the TP, in the case of Open API there is nothing you need to do but for FIX API, you will need to cancel the limit order.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous