Jump to content
Sign in to follow this  
Guest mrdavidlaing

ListOpenPositions - Meanings of "Status" magic numbers

Recommended Posts

Guest mrdavidlaing

I have a test account (PPE:DM317436/password) which has two open positions as below


The Status of my positions are being shown as “Open”.

However, a corresponding call to /order/openpositions?TradingAccountId=400215888 returns {… “Status”:3 …}

E.g: at https://ciapipreprod.cityindextest9.co.uk/tradingapi

var userName = "DM317436";
doPost('/session',{ "UserName": userName, "Password": "password"}, function (data, textCode) {
    setRequestHeader("UserName", userName);
    setRequestHeader("Session", data.Session);



{"OpenPositions":[{"Currency":"USD","Direction":"buy","LastChangedDateTimeUTC":"\/Date(1310470526303)\/","LimitOrder":null,"MarketId":99498,"MarketName":"Wall Street CFD","OrderId":456738549,"Price":12458.000000000,"Quantity":10.0000,"Status":3,"StopOrder":null,"TradingAccountId":400215888},{"Currency":"GBP","Direction":"sell","LastChangedDateTimeUTC":"\/Date(1310470545393)\/","LimitOrder":null,"MarketId":99500,"MarketName":"UK 100 CFD","OrderId":456738550,"Price":5834.300000000,"Quantity":1.0000,"Status":3,"StopOrder":null,"TradingAccountId":400215888}]}

Further, the DTO docs (https://ciapipreprod.cityindextest9.co.uk/ciapi.docs/#service.ListOpenPositions) don’t give any details, saying only that this is the order status.

So, what are the possible values for this property, and what do they mean?

Where should I look for them to be documented?

Share this post

Link to post

The InstructionStatus and OrderStatus codes describe the status of orders as they are processed by the CityIndex trading system. These codes are set in stone and won’t change anytime soon.

I’ll provide them here but in the near future we’ll have the message lookup return the textual descriptions as well as providing some documentation of the order lifecycle.


  • 1, Accepted

  • 2, Red Card

  • 3, Yellow Card

  • 4, Error

  • 5, Pending

Order Status

  • 1, Pending

  • 2, Accepted

  • 3, Open

  • 4, Cancelled

  • 5, Rejected

  • 6, Suspended

  • 8, Yellow card

  • 9, Closed

  • 10, Red Card

  • 11, Triggered

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