looking for a Guide for python orders documentation

Created at 05 May 2023, 00:04
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!
KA

looking for a Guide for python orders documentation
05 May 2023, 00:04


I am trying to put "buy" and "sell" orders and closing positions.

For more complex cases, is there any  cTrader API documentation.?

Thanks


@karakayafaruk6@gmail.com
Replies

ctid1980098
07 May 2023, 12:22

RE:

Hi,

the only documentation i'm aware of is on the ctrader site and specification here https://help.ctrader.com/fix/specs/cTraderFixApi_v2.18.1.pdf 

Buy and sell orders examples can be found in the above link as a new order single 35=D message. 

Closing positions: To close a buy position you need to open a corresponding sell position that includes the buy position id in the tag 721=.... so as to link the buy with the closing sell position. there is one example of this given below. see tag 721 under "market order to existing position". same is for the reverse case. 

What kind of complex cases are you referring to? 

 


@ctid1980098

karakayafaruk6@gmail.com
07 May 2023, 23:49 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE:

ctid1980098 said:

Thank you for the document. I try to close my current position 25% or 50%. or close all LONG  positions at the same time

Hi,

the only documentation i'm aware of is on the ctrader site and specification here https://help.ctrader.com/fix/specs/cTraderFixApi_v2.18.1.pdf 

Buy and sell orders examples can be found in the above link as a new order single 35=D message. 

Closing positions: To close a buy position you need to open a corresponding sell position that includes the buy position id in the tag 721=.... so as to link the buy with the closing sell position. there is one example of this given below. see tag 721 under "market order to existing position". same is for the reverse case. 

What kind of complex cases are you referring to? 

 

 


@karakayafaruk6@gmail.com

ctid1980098
08 May 2023, 08:38

RE: RE: RE:

Thank you for the document. I try to close my current position 25% or 50%. or close all LONG  positions at the same time

Yes i think you can close partially by 25 or 50%. For closing a position, the opposite order has to be sent with the same amount or an amount that reduces position by certain percentage.

So tag 38= will contain an amount 50% less than your original position. then it should work. 

To close all long positions you would need to open opposite sell positions with tag 721 containing the ids of the original buy positions and it should all close. 


@ctid1980098

karakayafaruk6@gmail.com
09 May 2023, 01:20

RE: RE: RE: RE:

ctid1980098 said:

Thank you for the document. I try to close my current position 25% or 50%. or close all LONG  positions at the same time

Yes i think you can close partially by 25 or 50%. For closing a position, the opposite order has to be sent with the same amount or an amount that reduces position by certain percentage.

So tag 38= will contain an amount 50% less than your original position. then it should work. 

To close all long positions you would need to open opposite sell positions with tag 721 containing the ids of the original buy positions and it should all close. 

Thanks for the info. I am still struggling :) still couldn't open a position :) :)


@karakayafaruk6@gmail.com

ctid1980098
09 May 2023, 08:42

RE: RE: RE: RE: RE:

karakayafaruk6@gmail.com said:

ctid1980098 said:

Thank you for the document. I try to close my current position 25% or 50%. or close all LONG  positions at the same time

Yes i think you can close partially by 25 or 50%. For closing a position, the opposite order has to be sent with the same amount or an amount that reduces position by certain percentage.

So tag 38= will contain an amount 50% less than your original position. then it should work. 

To close all long positions you would need to open opposite sell positions with tag 721 containing the ids of the original buy positions and it should all close. 

Thanks for the info. I am still struggling :) still couldn't open a position :) :)

if you need help you can message me here hvfixapi@gmail.com


@ctid1980098