Closing position

Created at 14 Mar 2017, 05:39
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!
YO

yoannes

Joined 05.02.2017

Closing position
14 Mar 2017, 05:39


Hi,

I am having some trouble on closing a order. To open works just fine, but when I send the command to close it 40=3, its opening new order.. I can't find where is my mistake.

8=FIX.4.4|9=156|35=D|34=6|49=fxpro.XXXXX11|50=Trader|52=20170314-02:30:09.146|56=CSERVER|57=TRADE|11=3040439359|38=1000|40=3|54=1|55=1|59=3|60=20170314-02:30:09|99=1.06556|10=177|

8=FIX.4.4|9=210|35=8|34=6|49=CSERVER|50=TRADE|52=20170314-02:30:02.267|56=fxpro.XXXXX11|57=Trader|11=3040439359|14=0|37=95003840|38=1000|39=0|40=3|54=1|55=1|59=1|60=20170314-02:30:02.189|99=1.06556|150=0|151=1000|721=60464730|10=098|

Thank-you for the support.


@yoannes
Replies

Spotware
14 Mar 2017, 09:18

Hi Yoannes,

Tag 40=3 does not close a position. It just indicates that the order is a stop order. If you want to close a postion you need to set the position ID in tag 721 and send an order with the reverse direction. 

Best Regards,


@Spotware

yoannes
14 Mar 2017, 13:31

Hi Spotware,

Sorry for the silly question... Now everything is working just fine.

Thank-you for the quick suport!!


@yoannes