Jump to content

garrettkolson

Members
  • Content count

    10
  • Joined

  • Last visited

  1. Lightstreamer

    Hi chriss, It looks like you're using the interface implementations (Subscription, SubscriptionListener, etc) from the Lightstreamer .NET Standard Client Library v.5.0.*, which appears to be solely compatible with Lightstreamer 7.1.0+. Since GCAPI is using Lightstreamer 7.0.3 (at least it was the last I checked), you'll want to use the .NET Client Library v. 4.0.0. I only know this because my app is also written in C#, and I spent a while banging my head on the proverbial wall trying to get my live streaming sorted out properly. It's available in NuGet - you just have to specify Version 4.0.0 when installing. And the documentation is here: https://lightstreamer.com/api/ls-dotnetstandard-client/4.0.0/frames.html?frmname=topic&frmfile=index.html Garrett
  2. DMA API?

    Hi PM, Is a DMA trading via the API something that will be offered at some point? Thanks, Garrett
  3. GetMarketInformation - MinDistance

    Hi PM, After some more testing today, I suspect you are correct - I have placed a few successful orders with wider TriggerPrice targets. I actually do have this process automated. My code that places orders receives the latest prices from Lightstreamer just before calling /order/newstoplimitorder. However, when dealing with distances that small, it seems likely that the market will occasionally move within your target distance. I've built in a few other checks for this eventuality, as well as some TriggerPrice modifications and retries, should the first order attempt fail for that reason. Thank you again for all your help! Garrett
  4. GetMarketInformation - MinDistance

    Thanks for your answers, PM. 1. Awesome, I was hoping that was the case. 2. However, that leads me to a follow-up question related to #2. In my case, since I'm a US client, I'm trying to place orders to buy or sell at a worse price than current (so, stop order), with no attached IfDone. I attach the related stop loss and take profit orders once the first order has become an open position (if it does). However, I'm getting the "Minimum Distance to Target" red card upon trying to place the initial non-attached stop order, even though I've specified my trigger as more than the MinDistance from the Offer/Bid. So, for example, I tried to place a sell stop on USD/JPY. The Bid Price I received from Lightstreamer was 107.413, so my TriggerPrice was set to 107.398 (distance of .015). The MinDistance for USD/JPY is listed as .014, but I still got red carded for being below minimum distance to target. Do you know what I'm doing wrong? Thanks, Garrett
  5. Hi there, Right now, I'm calling /market/{marketId}/information only once at the beginning of my session for different market info, particularly the MinDistance property for the market. However, I'm still getting a lot of Red Cards due to being under the minimum distance to the target. So, I guess I have two questions: 1. Is that something I should be calling periodically to get the latest MinDistance? Does the MinDistance for a market change throughout the day, or is that pretty static? 2. Which price is the MinDistance relevant to? I would assume, for a buy stop order, that the MinDistance would be from the Offer Price, and for a sell stop, it would be from the Bid Price. Is that correct? Thanks!
  6. UpdateTrade

    EDIT: Forgive me - it looks like this issue has already been addressed here: I need to be more diligent in looking through past threads before posting! Lol. Anyway, I didn't even think to check the JSON formatting, as I'm using probably the most popular of serializer libraries for the language I'm writing in (Newtonsoft.Json for C#). When in doubt, double check your syntax! I can't test this right now, as markets are closed, but if this doesn't solve it come Monday (which would be very surprising), I'm sure I'll be back.
  7. Cancel Order

    Hi PM, Thank you for digging in to all this. I tried replicating your calls, and still was unsuccessful in calling /order/cancel and /order/updatestoplimitorder, even with identical parameter and header signatures. This made me really dig through my application, and I finally figured out what the issue was. As it turned out, while the headers were "correct", due to a quirk in how I had written the wrapper methods to call those endpoints, the Session token was being appended to the Session header twice just before the call took place. So, it looked like this: "Session: {token}{token}". Obviously, incorrect. Lol. Once I fixed that, the calls worked as intended. I feel a bit silly. Thank you for taking the time to dig through it. Garrett
  8. Cancel Order

    Hi PM, Thanks for your reply. I was actually already including the authentication information in the headers, as well as in the POST body. I've removed it from the body, so it's solely being sent in the headers now, but I'm still having the same issue. Strangely, my call to /order/newstoplimitorder is working fine, but /order/updatestoplimitorder and /order/cancel are returning Unauthorized, even though I'm using the same username and session token. Any ideas as to what could be causing the issue? Thanks!
  9. Cancel Order

    Unfortunately, I seem to be having the same problem with calling /order/updatestoplimitorder now as well. :/ Please help!
  10. Cancel Order

    Hi there, I have a series of unit tests that run against the methods I've written to call various GCAPI methods. One part of this series tests my methods to call the various Trade/Order endpoints. First, I call /order/newstoplimitorder and successfully place a new resting entry order. After a few other things, I call /order/cancel on the entry order (only if the order hasn't already been triggered). This is where I'm getting a little stuck. I'm using all the properties described in the documentation, including the Username and Session token I received on authorization (included both in the POST JSON data, and as separate headers). My OrderId property is the order id I received from opening the entry order, and the TradingAccountId was received from calling /UserAccount/ClientAndTradingAccount. This Account id was also successfully used to place the entry order. Despite all this, I'm still receiving 401 response codes when calling /order/cancel. Here is the POST packet: "{\"OrderId\":724499552,\"Reference\":\"Trade #724499552 setup invalidated\",\"UserName\":\"********\",\"Session\":\"a52f7a51-c01d-4a81-a6db-82eb37c70d06\",\"TradingAccountId\":*********}" Can you tell me what I'm doing wrong? Thanks! Garrett
×