Jump to content
Sign in to follow this  
Vincent

ApiTradeOrderResponseDTO Status StatusReason

Recommended Posts

Hi,

 

According to API doc

 

http://docs.labs.cityindex.com/#HTTP%20Services/Trade.htm%3FTocPath%3DCIAPI%2520Reference|HTTP%2520Services|Trades%2520and%2520Orders|_____12

 

ApiTradeOrderResponseDTO.Status and ApiTradeOrderResponseDTO.StatusReason are mapped to "OrderStatus Codes" and "OrderStatusReason Codes" in

 

http://docs.labs.cityindex.com/#Data%20Types/ApiTradeOrderResponseDTO.htm

 

But when I place a long position with a stop level that is higher then the market price, it got reject (as expected) and returns:

  "Status": 2,
  "StatusReason": 75,

 

If you look up OrderStatus Codes and OrderStatusReason Codes:

  "Status": Accepted,
  "StatusReason": The total quantity of guaranteed stop orders must be equal to trade order quantity.,

 

Which don't make sense to me.

 

Is it possible ApiTradeOrderResponseDTO.Status and ApiTradeOrderResponseDTO.StatusReason are mapped to "InstructionStatus Codes" and "InstructionStatusReason Codes"?

 

  "Status": Red Card,
  "StatusReason": Instruction processing has resulted in a Red Card. Please check details.,

 

Thanks.

Share this post


Link to post

Hello Vincent,

 

The relevant section of the API Documentation to consult is the "Trading Status Error Codes & Error Messages" section of http://docs.labs.cityindex.com/#Messages.htm.

 

As you can see, the response contains *two* sets of Status and StatusReason codes. The first set is the Order or Quote response codes, and the second set is always the Instruction response codes. 

 

I guess you are only parsing the second set, which are the InstructionStatus and InstructionStatusReason? You'll need to amend your code to parse the first set of codes as well, which would usually be the OrderStatus and OrderStatusReason codes.

 

Note: you will only ever get a QuoteStatus and QuoteStatusReason if your attempted trade goes to quote (sent to our dealers for manual approval).

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×