Jump to content
Sign in to follow this  
rob sinclair

I get a Red Card when I try to create an order

Recommended Posts

I am trying to create a limit order using the code below but I get a Red Card with status reason 75 “The total quantity of guaranteed stop orders must be equal to trade order quantity”. I have the Guaranteed property set to false. The values for the submitted order are shown below as well as the response details:

var response = rpcClient.TradesAndOrders.Order(ciOrder);rpcClient.MagicNumberResolver.ResolveMagicNumbers(response); var orderStatusReason = _rpcClient.Messaging.GetSystemLookup(“OrderStatusReason”, 0); var reason = orderStatusReason.ApiLookupDTOList[response.StatusReason – 1].Description;
ciOrder {CIAPI.DTO.NewStopLimitOrderRequestDTO}

Applicability   GTD
AuditId 20111215-G2PREPROD3-0137276
AutoRollover    TRUE
BidPrice    1597.1
Currency    GBP
Direction   buy
ExpiryDateTimeUTC   {20/01/2012 03:00:00}
Guaranteed  FALSE
IfDone  null
MarketId    400562973
OcoOrder    null
OfferPrice  1598
OrderId 0
Quantity    12
TradingAccountId    400088019
TriggerPrice    1500

response {CIAPI.DTO.ApiTradeOrderResponseDTO}

OrderId 0
Orders  {CIAPI.DTO.ApiOrderResponseDTO[1]}
Quote   null
Status  2
Status_Resolved Red Card
StatusReason    75
StatusReason_Resolved   Instruction processing has resulted in a Red Card. Please check details.

orderStatusReason.ApiLookupDTOList[74] {CIAPI.DTO.ApiLookupDTO}

Description The total quantity of guaranteed stop orders must be equal to trade order quantity.
DisplayOrder    75
Id  75
IsActive    TRUE
IsAllowed   FALSE
TranslationText The total quantity of guaranteed stop orders must be equal to trade order quantity.
TranslationTextId   1979

Share this post


Link to post

You’ve looked up the wrong status reason, the Status and StatusReason on the ApiTradeOrderResponseDTO refer to InstructionStatus and InstructionStatusReason. You’ll want to lookup the Status and StatusReason in the Orders list of ApiOrderResponseDTO, hopefully that will give you a more informative error.

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  
×