Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by Physicsman

  1. List Market Information

    Hi Matrix, From reading your above posts, you were able to solve the problem by using the IDs for markets that your account has access to, is that correct? Kind Regards, PM
  2. List Market Information

    I forgot to ask earlier, how did you find the MarketId? Did you follow the process as described in: https://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm?TocPath=How%20Do%20I...%3F%7C_____1 If you are using a MarketId from one of the examples in the documentation, then the likely reason is that your account does not have access to that market. Try getting a MarketId using the process describe din the link so we know ti is one you can access with yoru account. I'll take a closer look at your POST details to see if I can spot anything,
  3. List Market Information

    Hi, A test account should also work. The call I sent above is also using a test account on the Live/Production environment. If you can cut and paste the full copy of the call you are sending I can check it and see if I spot anything there. Kind Regards, PM
  4. List Market Information

    Hi Matrix, Without seeing the call you are sending I cannot say where the error lies. However, the service is working normally as expected. Below is a screenshot showing the call I am sending that is retuning the market information as exepcted. Hopefully, you can use this to guide you into formatting your call correctly. The Headers of the call are should contain the login Session Id and the account login username. Kind Regards, PM
  5. Hi Stav, The timestamp has to be supplied in seconds, rather than milliseconds. I have tried a test call and it works when supplied in seconds. Kind Regards, PM
  6. Hi Govols, We do not provide volume data for markets and so they are not available via API, or from any other platform such as NinjaTrader if we are the data source. Kind Regards, PM
  7. Hello Stav, We're looking into this for you and will reply once I have results of the investigation. Kind Regards, PM
  8. Best way to know if Market is closed

    Hi Wintermonth, If the bug is fixed before the 20th of May, I can notify you here about it. Kind Regards, PM
  9. Hello Everyone, This forum will no longer be monitored by staff, and no support will be provided here after the 20th May 2022. After that date, when you have any API related queries please contact your account manager (if you have one), or your local client services.
  10. Best way to know if Market is closed

    Hi Superee, Theoretically it could be possible at some point in the future, but not likely or probable at the moment. Kind Regards, PM
  11. Best way to know if Market is closed

    Hi Winter, I've heard back from the team that there is a technical debt item / bug that is causing this to happen. It is currently in the queue to be prioritised and scheduled. Kind Regards, PM
  12. Best way to know if Market is closed

    Hi Winter, I'm checking with the team on the report above and will reply again when I have further information. Kind Regards, PM
  13. StatusReason 74

    Hello Ashish, Definitions for OrderStatusReason codes can be found at: https://docs.labs.gaincapital.com/#APICodesList.htm?TocPath=Getting%20Started%7CLookup%20Values%7C_____1. OrderStatusReason 74 means "The total quantity of linked limit orders must not exceed opening order quantity." Without seeing the order call you are sending, the most likely reason for this reponse code is because the sum of the your closing limit order quantities is greater than the initial opening trade size. Please check that the sum of hte closing order quantities is less than or equal to your opening trade size. Kind Regards, PM
  14. Best way to know if Market is closed

    Hello, Sorry, I didn't read your previous question correctly. An end of day (EoD) process is run late evening time (London) that prepares our backend for the next available trading day. Should a MarketInfo call be made after the EoD is finished, our backend will supply via the API the start and end date/time for the next trading day. It accounts for holidays and weekends. So in your example of holidays from 2022-04-01 to 2022-04-05, and 2022-04-06 is the next available trading day then it will return that information. All of our trading platforms use the API and the vast majority of our clients trade on our platforms. You can have confidence that the system handles holidays/weekends robustly! Kind Regards, PM
  15. Best way to know if Market is closed

    Hi, The screenshot in my previous post is the returned data from the MarketInformation call using the example market id of 99571. The Start and End times convert to the expected times. Are you sending a HTTP GET call to https://ciapi.cityindex.com/TradingApi/market/99571/information What is the returned data that you are receiving? Kind Regards, PM
  16. Best way to know if Market is closed

    Hello Wintermonth, After some investigation, for equities (stocks and shares), the market open/close time uses the "TradingStartTimeUtc" and "TradingEndtimeUtc" fields. Ignore the MarketPricingTimes information. FX Markets do continue to use the MarketPricingTimes fields. Looking at Proctor and Gamble open/close times on the API, it returns the correct time when using the right fields. Quick note: close time is 20:00 UTC (8pm) rather than 08:00 (8am), in the post above. Kind Regards, PM
  17. Hi Tez, Thanks for the link to that post. It's also given me a clue as to why PositionMethodId of zero could be used in that case, and I'll get to that in just a moment. I'll start by addressing your question first. If you are attempting to close 0.4 of a Wall Street DFT position, you should be receiving an error message. This is because the minimum trade size for this particular market is 0.5. Try using 0.5 as the trade size for the close and you should be able to do that. Additionally, you need to target the OrderId of the position that you wish to reduce in size. Back to PositionMethodId = 0. I think our US clients (such as Superee in the quoted example) are able to use PositionMethodId = 0 because that parameter is ignored / not used for US clients. By regulation, all US clients are FIFO only and cannot choose to hedge. That is, PositionMethodId = 2 is forced upon them and cannot be changed. In your case, you can opti to switch between FIFO and non-FIFO so you should use the correct setting depending upon the type of trade you are trying to do. Kind Regards, PM
  18. Hi Tez, Please paste both the full order request you sent and the order response you received. I can investigate further and check your order call etc. Kind Regards, PM
  19. news streaming

    Hello Tez, A few years ago we changed from using streaming news to setting up an automated polling service using the REST API news calls instead. The news stream no longer functions. We suggest you use the GetNewsHeadlines call to retrieve the latest news headlines from Reuters. You can then use GetStory to read any stories of interest. You may want to periodically poll say every five minutes GetNewsHeadlines to retreive the latest news. Kind Regards, PM
  20. news streaming

    Hi, I'll check on this query with the team and reply here once i have more information. Thank you for your patience. Kind Regards, PM
  21. Hi Tez, I've checked with the team and 0 should not be valid for PositionMethodId. This is because a trade order request is either FIFO or it is non-FIFO. There is no 3rd category. Can you point me to some of the code examples from other users who have used a value of 0? Many thanks, PM
  22. Hi, That parameter is used by non- first in first out (FIFO) accounts to control whether an order/trade is being placed to hedge a position or not. If for example, you are a US customer where the regulator has mandated all accounts must be FIFO, then you would have to use value = 1. 1 == LongOrShortOnly, 2 == LongAndShort. If your account is non-FIFO and you are able to hedge, then you can use value = 2 to place a hedging trade should you wish. Kind Regards, PM
  23. newtradeorder.Source

    Hi Tez, Source was a parameter used to identify the origination of the order request. For example, FIX if it came via the FIX API etc. It is now obsolete so you should not need to include this in your order call. Kind Regards, PM
  24. Hello, Yes, both are used depending upon whenther you have a buy position (long) or sell position (short) the market. Technically, how it should work is that users subscribe via Liughtstreamer to the live streaming prices for the market. When sending a trade request the latest received bid and offer prices should be sent in the request. Kind Regards, PM
  25. Hi Tacano, The StatusReason =45 code you are looking at there is the InstructionStatusReason code, rather than the OrderStatusReason. InstructionStatusReason = 45 means: Offer price must be greater than zero. You've already discovered this since you fixed the problem by supplying the Offer price. On the followup question, please look in the "Actions" section of the order response for the quantity you have closed. Kind Regards, PM