question

Upvotes
Accepted
97 10 12 13

REDI API Setting ClientData

I have a trouble setting ClientData which I'd like to use for cancelling orders.

When I create an order, I do see "ClientData" field set on

CacheControlActions.Add/Update events. However, the following call does not cancel the order.

theApp.CancelOrder(clientdata,ref err);

Additionally when I restart the app this "ClientData" field in the

CacheControlActions.Snapshot shows an empty string.

-----------------------------------------

hOrder.Side = side;
hOrder.Symbol = sym;
hOrder.Quantity = quantity>1000.0? quantity=1: quantity;
hOrder.PriceType = "Limit";
hOrder.Price = price;
hOrder.Exchange = exch;
hOrder.TIF = "Day";
hOrder.Ticket = "Bypass";
hOrder.Account = acct;
hOrder.ClientData = "RAPI";

result = hOrder.Submit(err);

-------------------------------------

ClientData = GetCell(rediCache, row, "ClientData", out errCode).ToString().TrimStart();


apiredi-apiorder
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
78.6k 248 52 74

@39783854-26aa-4fea-bc93-00b2ec21f8bb

From my test, I can call CancelOrder with ClientData when the ClientData is unique for each order.

For example, with the above data, I can call CancelOrder for RAPI101, RAPI300, and RAPI400. However, when I call CancelOrder for RAPI and RAPI200, the CancelOrder method returns false.

Could you please confirm if this is the same problem that you encountered?


rapi.jpg (11.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
97 10 12 13

Yes I am having the exact same issue. I thought maybe I can set clientdata field to group orders together and cancel them.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
410 1 1 3

Hello,

We've confirmed that the ability to cancel orders by ClientData supports only one order at a time. We need to make some code changes to support more than one order.

Can you please speak with your account manager to raise an enhancement request?

Thanks,

Brian

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.