Jump to content

All Activity

This stream auto-updates     

  1. Earlier
  2. Close all positions

    Hello, You can close multiple open positions in the same market with one call, but you should use separate close trade calls for each different market. Kind Regards, PM
  3. Is there any way we can close all positions using a single API call?
  4. Hi Amit, No, the DA or other text string in the account number is fine. You mentioned you had the same problem on your Demo account as well as your Live account. Please send me a PM with the account credentials for your DEMO account. I'll login with that account and attempt to place some test trades and see what happens. Also, do you have a screenshot of the exact error messages you receive when attempting to place trades/orders? Kind Regards, PM
  5. Absolutely certain that there are no typos as getting credentials, and including in header for api calls is fully automated. Is it possible that there is an issue with the account number? The demo account number starts with a "DA" followed by 6 digits but the api requires integer for account number. How can I resolve this?
  6. Hi Amit, No. If you can login and request historical data and market information with your account then you shoul dbe able to trade. I recall a previous client had a similar issue and the root cause is that they mis-typed their login crednetials in the trade/order calls. Every call through the API must contain the authentication information. Have you double checked the login credentials yo uare sending for th etrade/order calls to see if there is a typing error? Kind Regards, PM
  7. I am able to access historical data and market information using the credentials as per the api. When I try to place a trade, I get an error that the credentials are invalid. This is true for both the live account and the demo account. Do I need any further privileges to place a trade?
  8. Issues with barhistory

    Hello, Based on the session, we checked the logs and narrowed down the calls made from that evening at the time in question.We see five calls made and those were serviced by both of our data centres. Specifically, 4 calls were serviced from DC1 and 1 call was serviced by DC2. Do you recall if the 5 bar result was the more frequent event or was the 200 bar response more frequent? Unfortunately we neither capture responses sent to clients nor any metadata regarding the response so we cannot determine that from our end. If you saw 5 results only once, that could be a problem with the data in DC2, and vice versa. If we can establish some of these additional facts, we can investigate further. Kind Regards, PM
  9. Issues with barhistory

    Thank you for the additional information. Passing it to the team for tuerh investigation. Will update here when I have more information. Kind Regards, PM
  10. Issues with barhistory

    Yes. that is correct. Sometimes, I received only 5 and sometimes 200. I tried and I cannot reproduce this issue right now. So, most probably it's related to just after markets have opened at 5-6 PM EST. I can try it next Sunday around 8-9 PM EST. There was no pattern. It was just random. My Session was 83f23268-939a-473a-a19f-b5ad31a1b439 (destroyed it now) if it helps figuring out the issue. Time was 11-12 PM EST Sunday (Nov 22, 2020). I can provide more SessionIds if required. Thanks, Ken
  11. Issues with barhistory

    Hi Ken, I just want to follow up on what you wrote here: Do you mean that in your testing on Sunday night, you sometimes received the full 200 bars and sometimes you only received 5? I've tried repeatedly sending the call about 20 times, and every time I receive the full lot as expected. I've not been able to reproduce the error you observed even once. Did you notice any pattern as to when you received the full data and when you did not? As a side note, the following probably is not the cause but I did notice that in the Postman screenshot you are adding your authentication information in the call Parameters. They should be in the call Headers and not in the Parameters. Kind Regards, PM
  12. When I execute the below URL, https://ciapi.cityindex.com/TradingAPI/market/401437607/barhistory?interval=HOUR&span=1&PriceBars=200&UserName=XXXXX&Session=XXXXXXXXXX I get only 5 results when I have requested 200. I observed this request doesn't always honor the PriceBars query param. It sometimes gives me all 200. I was testing this around 11.53 PM EST Sunday and markets have opened at 6 PM EST for US Tech 100 CFD (the Market in the above case). My assumption is it's only providing me price bars after the market has opened. Is this a known issue? { "PriceBars": [ { "BarDate": "/Date(1606086000000)/", "Open": 11912.1, "High": 11937.8, "Low": 11903.0, "Close": 11934.5 }, { "BarDate": "/Date(1606089600000)/", "Open": 11934.1, "High": 11950.8, "Low": 11928.7, "Close": 11949.6 }, { "BarDate": "/Date(1606093200000)/", "Open": 11949.5, "High": 11954.0, "Low": 11937.0, "Close": 11941.8 }, { "BarDate": "/Date(1606096800000)/", "Open": 11941.7, "High": 11951.1, "Low": 11939.0, "Close": 11944.5 }, { "BarDate": "/Date(1606100400000)/", "Open": 11944.6, "High": 11957.6, "Low": 11942.5, "Close": 11953.5 } ], "PartialPriceBar": { "BarDate": "/Date(1606104000000)/", "Open": 11953.3, "High": 11955.8, "Low": 11949.6, "Close": 11954.3 } } Thanks, Ken
  13. How to get PIP value for every market as per market rate change using GAIN API.
  14. Hi there, I have been trading for more than a year in both my Live and Demo Accounts simultaneously through the API. Suddenly, the connection with the Demo was denied in both the API and the platform, although the connection to my Live account works perfectly in both API and Platform. I reported the problem to Forex, and they created a new demo account form me. The problem is that I can't connect with the new Demo account, neither through the API nor through the platform. I was referred to this site to post my question What should I do here?
  15. I set up Lightstreamer's QuickStart and it worked fine. I then made the changes needed to connect to push.cityindex.com, including getting a session ID from https://ciapi.cityindex.com/TradingAPI. . I get a client listener onServerError with errorCode = 60 errorMessage = “License not valid for this Client version”. The explanation from LightStreamer is "That message means that the client in use is newer than the license installed on the server.To use that client with that server, assuming them are compatible, you need to change the server license." I am using c# using Dotnet Standard Client version 5.0.5. So, appears to be a licensing problem between Gain Capital Labs and Lightstreamer. Another user posted at http://faq.labs.gaincapital.com/topic/2039-lightstreamer/?tab=comments#comment-3692 suggest using V 4.0.0. Unfortunately, Lightstreamer documentation is not helpful because they have upgraded all their sample code to v 5.0.5. Can you provide some sample c# code to start a price stream under 4.0.0? Regards, Chuck
  16. Hello, I am trying to aggregate my historical trades to calculate my average position price and size. To do this I need to know which trades are buy/sell to open (buy/sell to close can be calculated by tracking when size becomes zero). The only other alternative I can think of would be to request ALL history since the account was created and funded to ensure starting from a flat position. Of course, this is highly impractical when we only want to analyze the last month of historical trades. Below is an example simplification of a ApiTradeHistoryDTO[ ] array filtered by a single symbol. As an example: Sell 1 at 99 (closing a previous position) Buy 1 at 100 (opening new position, we need a bit to know to start here rather than the prior order) Buy 1 at 101 Buy 1 at 102 Sell 1 at 103 Sell 1 at 104 Sell 1 at 105 (net position closed) The average position is Long 3 at 101. The only way to calculate this is by knowing that the second order in the array was a buy to open order. Otherwise, we would mistake the first order for an opening order when it is actually a closing order. What is the recommended way to get this result with my historical trades?
  1. Load more activity