Jump to content
Sign in to follow this  
Vincent

Streaming Data > Orders - Trade Order ID

Recommended Posts

Hi,

 

This question is relate to order stream:

http://docs.labs.cityindex.com/#Streaming%20Data/Orders.htm%3FTocPath%3DCIAPI%2520Reference|Streaming%2520Data|_____4

 

When editing a stop order's trigger level/price of a trade order, the order stream will only push back the stop order ID. And it will not push back the trade order ID (the parent order of stop order).

 

When editing a limit order's trigger level/price of a trade order, the same thing happen as well. Limit order ID is pushed back.

 

But when you edit a stop order or a limit order's trigger price of  an order. The order ID will be push back as well as stop order ID and limit order ID.

 

My 1st question is to find out if my observation (above statement) is correct.

 

My 2nd question is possible to make the order stream to return trade order ID when only its stop order or limit order's trigger price have been changed.

 

Thanks.

Share this post


Link to post

Hello Vincent,

 

Apologies, I can't discern what you meant in the line you wrote below. I understood your first 2 paragraphs, it's just this 3rd one which appears to be the main crux of your query.

 

If you can clarify then I'll know what I need to look at for your query. Thanks!  :)

 

 

But when you edit a stop order or a limit order's trigger price of  an order. The order ID will be push back as well as stop order ID and limit order ID.

 

 

Share this post


Link to post

Hi Physyicsman,

 

Order stream push data to client when there is change in order. The data will be push to the client when there change in a "trade order", an "order order", a "stop order" or a "limit order".

Both "trade order" and "order order" can have a stop order and a limit order.

 

"But when you edit a stop order or a limit order's trigger price of  an order. The order ID will be push back as well as stop order ID and limit order ID."

 

What I mean here is that when you edit a stop order's trigger price of an "order order". Order stream will push back not just stop order ID (child order ID), but also "order order"s ID (parent order ID).

It is the same when you edit a limit order's trigger price of an "order order". Order stream will push back not just limit order ID (child order ID), but also "order order"s ID (parent order ID).

 

It is desirable since I don't need to query the child order ID to get the parent order ID. I wish this is happening to trade order as well.

 

Please let me know if it is still not making sense.

 

Thanks.

Share this post


Link to post

Hello Vincent,

 

Thank you for the clarification - I understand what you are asking now.

 

Attached take profit limit and stop loss orders to a trade don't push back the trade ID, whereas attached if/done stops and limits to entry orders do return the entry order ID.

 

You want to know if this is the behaviour of the API, and if so, can we make a change to the API so that the trade ID can be returned.

 

I'll look into this and reply when I have an answer.

Share this post


Link to post

Hi Physyicsman,

 

Attached "take profit limit" and "stop loss orders" to a trade DO push back the trade ID (with "take profit limit" order ID and "stop loss orders" order ID).

 

It is when you edited the trigger price of "take profit limit" or "stop loss orders" of a trade, it will not return the trade ID.

 

Thanks.

Share this post


Link to post

Hello Vincent,

 

Answering the questions as you wrote them in your first post.

 

1) Yes, your observations are correct. That is how the CIAPI behaves at this time.

 

2) With the current API specification, there isn't a way to make the order stream return the trade order ID when only its stop order or limit order's trigger price have been changed.

 

I can send a request to our core development team to add this to the API for a future iteration. It'll have to go through specification by business analysts, prioritisation and so on. I wouldn't expect it to be implemented soon.

 

It would help if you can send a reply with a detailed explanation of why you want this or how it would help, and I'll attach that as the business case reason for the request. Give it my best shot to get a reasonable priority in the backlog etc.

Share this post


Link to post

Hi Physicsman,

 

Thanks.

 

Please let me explain why I need this change.

 

Let's start with a trade which has a stop order and a limit order.

Here is example of what data sets will be push to the client by order stream when stop order's trigger price of the trade order is edited:

==============================================

Data Set 1

==============================================

521520651 (limit order ID)

400616113

400340375

400482641

6

 

2

false

\/Date(1423483864000)\/

0

\/Date(1423483454000)\/

2

1

2

Limit

Accepted

1

==============================================

 

==============================================

Data Set 2

==============================================

521520580 (stop order ID)

400616113

400340375

400482641

6

 

2

false

\/Date(1423483864000)\/

0

\/Date(1423483454000)\/

2

1

2

Stop

Accepted

1

==============================================

 

As you can see, the order stream only push limit order ID and stop order ID to the client. There is no way to know that the limit order and stop order are with the same trade order.

 

So when client received "Data Set 1", it need to get/query the limit order to  get its parent trade order. Update UI.

When client received "Data Set 2", it need to do the similar thing again.

One change, but two updates required. It just not very efficient.

 

If order stream can return another dataset which contain trade order ID, I can just ignore "data set 1" and "data set 2". And get the trade order info (which contain the limit order and stop order info) and use the info to update the UI.

One chagne and one update.

 

Thanks.

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  
×