Issue with getting working orders

2 posts / 0 new
Last post
AARONAB
Issue with getting working orders

I am pulling in a list of open working orders using this line. This code is exactly the same used in the sample sdk and documentation.

var wrresponse = await _igRestApiClient.workingOrdersV2();
while (wrresponse.StatusCode.ToString() != "OK")
{
wrresponse = await _igRestApiClient.workingOrdersV2();
}

While this sometimes return forbidden error

After some iterations in the while loop it behaves as expected

2. Regarding deleting a working order the code is this

• IgPublicPcl.IgResponse DelResponseB = new IgPublicPcl.IgResponse();
• dto.endpoint.workingorders.delete.v1.DeleteWorkingOrderRequest DeleteB = new dto.endpoint.workingorders.delete.v1.DeleteWorkingOrderRequest();
• DelResponseB = await _igRestApiClient.deleteWorkingOrder(BDealarr[i], DeleteB);

BDealarr[i] has the deal refernce number for the trade to be closed in string format. The deal reference number is correct as I checked through companion. But this code has no effect at all , no error, nothing and the working order is at it is.

Any help or direction will be highly appreciated

Regards,
Aaron

Chris
Issue with getting working orders

Hi AARONAB,

We wouldn't recommend writing code as you have done in point 1. I'd suggest using Lightstreamer to subscribe to confirmations and wou as a better solution. The problem with the while loop is that this endpoint has a market data snapshot in it; so it reduces the available api quota for market data for every call on this endpoint and this endpoint will return an error response when the api quota is exceeded. This is what has happened to you.

Regarding your second point, you just need to use the Deal Id and not the Deal Reference.

Hope that helps!

Chris

Log in or register to post comments