Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by Physicsman

  1. Lightstreamer Access?

    Hi Tom, Since Lightstreamer do not have a specific Ruby on Rails client development kit, presumably you are using the one named "Genric Client SDK"? Did you download the version of the SDK for the version of LS we are running on the server, which is 7.0.3? Possibly some sort of incompatibility happening if you are using the latest client SDK. The client SDKs for the LS server version we run can be downloaded at: https://lightstreamer.com/download/#ls70 Kind Regards, PM
  2. This forum will be unmonitored over the period from Monday 14th September through to Monday 28th September 2020. Should you have an urgent API query please contact your account manager or client services.
  3. Lightstreamer Access?

    Hi TomG, A quick check, for LS authentication are you sending the password as the SessionID you receive back from the REST API? For authenticating wiht LS, the username is your username as used in REST API, but the password is not your account password, it is the REST API Session ID. That could explain the issue you are seeing? Kind Regards, PM
  4. Hi Rony, For US clients that use what are called "associated" stops/limits, the values of stops/limits cannot be different for each of your trades in the same market. When you place the 2nd or subsequent trade with stop/limits, these will replace/overwrite the previous stops/limits you have set. Again, this is unfortunately due to specific US NFA regulations. Kind Regards, PM
  5. Reset DEMO account via API

    Hi Motown, No, that functoinality is not available at this time. Please contact client services and request they reset the account balance of the demo account. Kind Regards, PM
  6. Hi, It is described in the list of fields at the link I posted previously. The "Reference" field is a code to identify the source origin of the trade order request. I would suggest using your API Key as the reference string, or you could tag your request as "GCAPI" to show it is an API request. Origin601 is an internal reference. Kind Regards, PM
  7. Hi Rony, Yes, mainly removing the TriggerPrice field. The list of permissable fields for a market order (trade) request is detailed at http://docs.labs.gaincapital.com/#Data Types/NewTradeOrderRequestDTO.htm. I've pasted an example below. Yes, US clients can send a market order (trade) request with attached stops and limits as I have done in the example below. Kind Regards, PM { "MarketId": 400723798, "Direction": "buy", "Quantity": 1000, "BidPrice": 106.174, "OfferPrice": 106.204, "AuditId": "ELU17236432", "TradingAccountId": 401843563, "PositionMethodId": 1, "IfDone": [ { "Stop": { "OrderId": null, "Direction": "sell", "Applicability": "gtc", "ExpiryDateTimeUTC": null, "Guaranteed": false, "TrailingDistance": 10, "Quantity": 1000, "TriggerPrice": null, "IfDone": [], "OcoOrder": null }, "Limit": { "OrderId": null, "Direction": "sell", "Applicability": "gtc", "ExpiryDateTimeUTC": null, "Quantity": 1000, "TriggerPrice": 106.704, "IfDone": [], "OcoOrder": null } } ], "Reference": "Origin601" }
  8. Hi Rony, I have a couple of questions to help clarify the situation. 1) Do you have a US based account? This is because US accounts cannot have simultaneous long and short open positions in the same market. This is a rule from the US regulator so is not something we can change. 2) Are you trying to place an entry order to enter the market should it reach a certain trigger price, or are you trying to place a market order to trade immediately on whatever the current buy/sell price is? You wrote you are sending to the /newtradeorder endpoint, which is for placing a market order trade to buy/sell immediately at market price. However, your request is structured as an entry order to buy when the market reaches a certain trigger price. Entry orders should be sent to the /newstoplimitorder endpoint instead. NOTE: US accounts also cannot attach If/Done Stop or Limit orders to an entry order. Again this is a rule from the US regulator. Kind Regards, PM
  9. New order on options

    Hi Magda, Yes, the streaming API only streams the latest current live market price - it does not provide historical price ticks. We don't store much/any Option price data so it's a bit more problematic since you are looking into these markets than our standard non-option markets. It's still worth looking to see if you can pull any historical price data for option markets using the Price History service endpoints. You can find those calls in the documentation at: http://docs.labs.gaincapital.com/
  10. .Net C# Lightstreamer Demo

    Hi Rony, Many thanks for the reference notes. I'm sure they will be appreciated by other users in future. Kind Regards, PM
  11. New order on options

    Hi Magda, To receive the current live market prices, subscribe via the Lightstreamer API to the PRICES stream. The application can then read in the latest Bid / Offer prices and supply them in the trade request. The Help page file at: http://docs.labs.gaincapital.com/#Getting Started/CIAPI Arky.htm%3FTocPath%3DGetting%20Started|_____1 explains that there are actually 2 APIs. The REST API for stattic data, which you are already using, and the Streaming API (via the third party Lightstreamer) for streamed data such as live market prices. Kind Regard, PM
  12. Orders Not Processing

    Hi, No, as mentioned in my previous post the SimulateTrade call is used to calculate the potential margin requirement for the proposed trade details submitted. It is used in the deal ticket of our trading platforms. The API reponse to the SimulatedTrade call provides the following information. { "Status": 1, "StatusReason": 1, "SimulatedCash": 19002.12, "ActualCash": 19002.12, "SimulatedTotalMarginRequirement": 444.65, "ActualTotalMarginRequirement": 0, "CurrencyId": 6, "Orders": [ { "StatusReason": 1, "Status": 3 } ] } Kind Regards, PM
  13. New order on options

    Hello Magda, Entry orders cannot be placed on option markets. Kind Regards, PM
  14. Hi Suchin, The response for an entry order call is coming back as JSON from the server. I'm not sure what your initial call looks like that would return test/html, however the server is returning responses correctly. Kind Regards, PM
  15. Hi @chriss, A quick question from the team. In your ListTradeHistory call, did you supply your TradingAccountId in the call parameters? If no account ID is supplied in the parameters the call defaults to using ClientAccountId. The From date is supported with the TradingAaccountID but not the ClientAaccountID version of the call. That might be why it is nor working for you, although we'll still invetigate whether there is a bug as well. Kind Regards, PM
  16. Update: the team have created an internal ticket to track this investigation. Since I have the ticket number I can keep an eye on its progress and update here when I see a status change.
  17. Hi Chris, Thanks for the clarification. I'll check with the team and respond once I hear back. Kind Regards, PM
  18. .Net C# Lightstreamer Demo

    That might be the root of all the problems encountered so far. Looking at the Lightstreamer site at https://lightstreamer.com/download/#ls70, they have .NET client v4.0.0 build 19 as the version to use with Lightstreamer 7.0.1. Try downgrading to that version of the client - it will definitely help. Kind Regards, PM
  19. Hello, The system is set up so that it moves the PartialBar into the previous full bar upon receipt of the next new start of bar. Since the bar in questoin is a Friday bar, and the query made on a Saturday, no new bar is yet available. Therefore, the Friday bar stays as a PartialBar until the first price tick on Sunday night is received starting the next bar. Kind Regards, PM
  20. List of Currency IDs

    Hello, There is no list of MarketIDs as that changes depending upon which brand you are papered under. Additionally, market IDs change for markets that expire such as those based on Futures or Options. Therefore the best thing to do is follow the directions at: http://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm%3FTocPath%3DHow%20Do%20I...%3F|_____1 to find the MarketId for the market you are interested in trading. Kind Regards, PM
  21. AuditId?

    Hello, When you subscribe to a realtime live price stream of market prices, each incoming price tick has an AuditID. This is a unique identifier for each price tick. Kind Regards, PM
  22. Orders Not Processing

    Hi, The order request is being sent to the simulate trade endpoint, rather the the actual trade endpoint. The simulate trade endpoint as its name suggets, only simulates a trade (to calculate the potantial margin required) without actually placing the trade. Send the request to the .../TradingAPI/order/newtradeorder endpoint to actually place the trade. Kind Regards, PM
  23. Sent you a message, hopefully you can reply to that! :-)
  24. Hi, Yes, the stop loss and profit limit in the If/Done fields should work as described. Are you using a test/demo account or is a real money Live account? If, and only if it is a demo/test account, please send me a private message with the account credentials. I want to send some test calls through the account and observe what happens. Kind Regards, PM
  25. Hi chriss, I have received a response from the API team. The Order Gateway that is used by the API to retrieve trade/order history has a technical limitation in its implementation that restricts the maximum number of results you can get through it. That is why you were not able to retrieve all your history since you have more trades/orders than can be returned through this gateway. The first time you ran the query when you did receive your entire history, is likely to have been when your trades/orders were less than the maximum number that could be returned through the gateway. The team are working on a new Reporting Gateway that will NOT have this limitation, but that is some way off at this time. Currently, the only way to see a full trade/order history of your account is to request a statement through client services. Statements use a different (non-API) service that directly queries the database. It it not possible to receive a full history through the API at this time. Kind Regards, PM