Closing a position partially

Created at 05 Sep 2018, 16:44
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!
PA

pavan.deshpande

Joined 28.08.2017

Closing a position partially
05 Sep 2018, 16:44


Hi,

I am facing problem closing a position partially. The process I am following for this is:

Open buy position quantity = 10000

Order request:

8=FIX.4.49=14135=D34=349=xxxxx52=20180905-13:01:51.98556=cServer57=TRADE11=1|0_MOR_3_11824640638=1000040=154=155=160=20180905-13:01:5110=188

Response:

8=FIX.4.49=21235=834=449=cServer50=TRADE52=20180905-13:01:51.23656=xxxxxxx6=1.1585211=1|0_MOR_3_11824640614=1000037=14256054238=1000039=240=154=155=159=360=20180905-13:01:52.289150=F151=0721=8773710810=172

After this the CTrader terminal shows the position with volume as 10000

To close this position I am placing sell order with same position Id but quantity as 5000.

Close Request:

8=FIX.4.49=15335=D34=849=xxxxxxx52=20180905-13:02:39.11856=cServer57=TRADE11=1|0_MOR_7_11829354638=500040=154=255=160=20180905-13:02:39721=8773710810=039

Close Response:

8=FIX.4.49=21135=834=1049=cServer50=TRADE52=20180905-13:02:38.38656=xxxxxx11=1|0_MOR_7_11829354614=500037=14256055338=500039=240=154=255=159=360=20180905-13:02:39.433150=F151=0721=8773710810=155

As it is visible from the message that, the close order is getting filled. But when I see in the CTrader terminal, I still see the volume as 10000 instead of expected 5000.

 

I am quite clueless currently as how to resolve this issue.

Can anybody help me in this?

Regards,

Pavan

 


@pavan.deshpande
Replies

pavan.deshpande
06 Sep 2018, 09:16

RE:

pavan.deshpande said:

Hi,

I am facing problem closing a position partially. The process I am following for this is:

Open buy position quantity = 10000

Order request:

8=FIX.4.49=14135=D34=349=xxxxx52=20180905-13:01:51.98556=cServer57=TRADE11=1|0_MOR_3_11824640638=1000040=154=155=160=20180905-13:01:5110=188

Response:

8=FIX.4.49=21235=834=449=cServer50=TRADE52=20180905-13:01:51.23656=xxxxxxx6=1.1585211=1|0_MOR_3_11824640614=1000037=14256054238=1000039=240=154=155=159=360=20180905-13:01:52.289150=F151=0721=8773710810=172

After this the CTrader terminal shows the position with volume as 10000

To close this position I am placing sell order with same position Id but quantity as 5000.

Close Request:

8=FIX.4.49=15335=D34=849=xxxxxxx52=20180905-13:02:39.11856=cServer57=TRADE11=1|0_MOR_7_11829354638=500040=154=255=160=20180905-13:02:39721=8773710810=039

Close Response:

8=FIX.4.49=21135=834=1049=cServer50=TRADE52=20180905-13:02:38.38656=xxxxxx11=1|0_MOR_7_11829354614=500037=14256055338=500039=240=154=255=159=360=20180905-13:02:39.433150=F151=0721=8773710810=155

As it is visible from the message that, the close order is getting filled. But when I see in the CTrader terminal, I still see the volume as 10000 instead of expected 5000.

 

I am quite clueless currently as how to resolve this issue.

Can anybody help me in this?

Regards,

Pavan

 

The problem is resolved. It was my code that was causing the problem. I was sending another stop order just after closing the position but with wrong side.

So this thread should be considered as closed.

 

Regards,

Pavan

 


@pavan.deshpande