I have a bug w/ the sterling API that I just cannot seem to crack. The error is with regard to sending / tracking / canceling orders. What's happening is that I'm sending in orders, and cancels, and most of the time I get it to work, but what happens is I send in a cancel or an order and it doesn't go through. Very very frusterating and looking for someone to help me Thanks
Do you get any error messages or have you phoned sterling tech support to see if they have any record of your attempted orders?
this is most likely because every cancel must have a unique id (different from the order id you're canceling). if you don't do this your cancels will be dropped and there's not much errors for this. see line 555 to 570 here for working example : http://code.google.com/p/tradelink/source/browse/trunk/ServerSterling/ServerSterling.cs
Everysingle cancel has a unique ID I'm using this Private Function GetClOrdID() As String Dim theTime As SYSTEMTIME GetLocalTime(theTime) g_nCounter = g_nCounter + 1 GetClOrdID = theTime.wYear & theTime.wMonth & theTime.wDay & theTime.wHour & theTime.wMinute & theTime.wSecond & theTime.wMilliseconds & g_nCounter End Function So everyone is different
sidenote : you're probably better off using tradelink because not only would you have help for solving these problems.... you would not spend any time doing basic stuff like this since it already works for everybody in tradelink. as another user mentioned, you could also call sterling technical support and have watch your cancel as it's received and generally they can see the reason. but this is the slow route. in any event, cancel ids from my memory have to be unique over several days. so cancelid = cancelid +1 may be your cause see line 562 in our code above, we're using an IDtracker to generate a guaranteed unique cancel. there are a couple of other really picky things they do, feel free to use tradelink source code as a working example if you need one.