Jump to content

Search the Community

Showing results for tags 'api'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Gain Capital API FAQ
    • General Questions and Discussion

Found 15 results

  1. So, apologies in advance if this has been asked previously, I did attempt to search the forum first. In pulling price bars by day and attempting to calculate SMA and EMA for myself, I noticed that there seems to be a slight discrepancy between what is showing as the open and close prices of the bars versus what shows when highlighting a candlestick for the same day in the trading view. As an example, for last Friday, July 17th, 2020, the API returns the following data: { BarDate: '/Date(1594944000000)/', Open: 1.13837, High: 1.14437, Low: 1.13776, Close: 1.14276 } However, in viewing the candlestick data, this is what is displayed: O 1.13824 H 1.14430 L 1.13755 C 1.14261 My guess would be that one or the other is factoring in the spread somehow, but I can't find any documentation to corroborate that. Plus, the diff between the various data points is not consistent across the board. Any help?
  2. I'm wondering if anyone knows of a "backtrader" (https://www.backtrader.com/) GCAPI integration implementation (i.e., broker, store and data python classes?) That is, one similar to Oanda (https://github.com/oanda/oandapy), Interactive Broker (https://github.com/blampe/IbPy) or Alpaca (https://github.com/alpacahq/alpaca-backtrader-api)
  3. Hi @Physicsman - I've got another question for you... it's been a while I've recently started getting "Error 429 - Too Many Requests" when submitting multiple newstoplimitorder requests at market opening times. Would you be able to shed any light on - what limits are typically in place on an account (do they differ between consumer / professional accounts?) - what counts towards a 'request' (e.g. is a historical bars request treated equally to a newstoplimitorder request?) - how to find out the current level remaining calls available at any point in time. I couldn't find any mention in the documentation.. - whether it's possible to increase that limit? thank you so much, as always Oliver
  4. Dear all, Every day i'm getting Statements and Contract Notes via Email. Unfortunately It's really uncomfortable to parse PDF because it has a different structure based on account activity. On another hand i'd like to have an api so i could get reports for specific date in a clear format. Api for this report will help me to get a lot of useful information like Account Summary, Open Trades, Financial Activity, Detailed Account Information which can be used in my analytics application. more then some information is not available from the api (like a financing for specific date) Please vote on my topic or leave a comment if you are also interested in this API call. Probably this will help development team to prioritize this a better way. Thank you!
  5. Hi, I am a basic developer, I have built my Forex application using Gain Capital services library, I've connected to efxnow.com, as I noticed that the API services are all updated, it does not work anymore. I was guessing that I just need to change the library which my application is using but I couldn't find that. I also tried posting directly to API and was returned an error, See attached image my post request. So my question is do I need to change now and use the new GCAPI libraries or do I just need to change some fields along with the API request. If I do need to change library, I am really confused how to get it done and I spent already so much time trying to figure this out, do I need to set up a Lightstreamer client and some connection with it, or do I just need to change the library? I'll appreciate your help and waiting for it.
  6. I am attempting to open a spreadbetting position via the API with the following request: { "MarketId": 400616113, "MarketName": "UK 100", "Direction": "sell", "Quantity": 1, "BidPrice": 6831, "OfferPrice": 6832, "TradingAccountId": "<TRADING ID>", "isTrade": true, "IfDone": [ ], "Reference": "CIAPI", "PriceTolerance": 0, "AutoRollover": false, "OrderId": 0, "ExpiryDateTimeUTCDate": null, "LastChangedDateTimeUTCDate": null, "OcoOrder": null, "Type": null, "ExpiryDateTimeUTC": null, "Applicability": null, "Currency": "USD", "QuoteId": null, "LastChangedDateTimeUTC": null, "Status": null, "AuditId": "45435468-3-0-0-R", "PositionMethodId": 1, "AllocationProfileId": 0 } Unfortunately I get the following response: { "Status": 2, "StatusReason": 75, "OrderId": 0, "Orders": [ { "OrderId": 0, "StatusReason": 43, "Status": 10, "OrderTypeId": 1, "Price": 0, "Quantity": 1, "TriggerPrice": 0, "CommissionCharge": 0, "IfDone": [ ], "GuaranteedPremium": 0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [ ], "ErrorMessage": null } The status message reads: "The Market must be of type: CFD" and the request fails. Is my request incorrect?
  7. Financing

    I notice that on the web interface, I can see the overnight holding charges and cost associated with guaranteed stops. I've looked in all the documentation on the API, and can see nothing that seems appropriate. Does this functionality exist through the API? If so, how do I access this? If not, will this feature be available in the near future?
  8. Now that I’m using the GetPriceTicks method from PriceHistory http service, I notice that it returns a PriceTickDTO that is only composed of mid price and tick date. If this is fine as such, I wonder whether this API could be extended to return a DTO similar to one returned by the Prices stream itself (ie. PriceDTO) in order to include additional values such as the Bid, Offer, High, Low, Change and Direction?
  9. Hi, I am not able to find the USD/JPY DFT market when I use the ListSpreadMarkets API passing “USD/JPY” as market name. I thought this could be linked to the “/” so I’ve tried to UrlEncode the “USD/JPY” string before adding it in the URL, but to no avail. I believe this used to work few weeks back but now some of my tests are broken as a result. You can repoduce the problen in the Ajax Test Harness page at :https://ciapipreprod.cityindextest9.co.uk/tradingapi With the following code: var userName = "DM631479"; doPost('/session',{ "UserName": userName, "Password": "password"}, function (data, textCode) { setRequestHeader("UserName", userName); setRequestHeader("Session", data.Session); // Authentication Test doGet('/smoketest/authenticated'); // Spread Markets Test doGet('/spread/markets?marketname=USD&maxresults=10&usemobileshortname=false'); doGet('/spread/markets?marketname=USD/JPY&maxresults=10&usemobileshortname=false'); doGet('/spread/markets?marketname=USD%2FJPY&maxresults=10&usemobileshortname=fasle'); //Logoff doPost('/session/deleteSession?userName='+userName+'&session='+data.Session); });
  10. Hi Guys, could someone tell me whether something has changed on the Markets API? I’m now getting the following deserialization error when I try to retrieve market information with “ListMarketInformation”: System.Runtime.Serialization.SerializationException : The data contract type 'System.Runtime.Serialization.DateTimeOffsetAdapter' cannot be deserialized because the required data member 'DateTime' was not found. This used to work up to yesterday evening Thanks
  11. I seem to be getting an error when I call the ListNewsHeadlinesWithSource API for the Market News International (mni) source with category set to “ALL”. Strangely the same API works for the 2 other sources available (dj / ci). The error is get back from the API is: {“ErrorCode”:10000,“ErrorMessage”:“An error has occurred.”,“HttpStatus”:500} Could you please confirm whether this API is working as expected? update (sky) This issue seems to have popped back up.. GET /tradingapi/news/MNI/ALL?MaxResults=2 HTTP/1.1 Accept: text/plain, text/json, application/json User-Agent: CIAPI.CS. UserName: XX658109 Session: 2974742f-03e7-4b8a-9cf3-b55eb07d4dde Host: ciapi.cityindex.com Accept-Encoding: gzip, deflate HTTP/1.1 500 Internal Server Error Cache-Control: no-cache Pragma: no-cache Content-Type: application/json; charset=utf-8 Expires: -1 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Fri, 04 Jan 2013 15:12:40 GMT Content-Length: 76 {"HttpStatus":500,"ErrorMessage":"An error has occurred.","ErrorCode":10000}
  12. What characters are valid in a MarketName? (specifically when searching) Is there a recommended minimum & maximum length? (I want to valid my users' input in my UI)
  13. Recently the C# Lightstreamer client library has been throwing the following errors: “requested adapter set not available” We think we have tracked down the issue to case sensitivity; specifically: When URL is like this: https://pushpreprod.cityindextest9.co.uk/CITYINDEXSTREAMING then it works ok. However, when URL is like this https://pushpreprod.cityindextest9.co.uk/cityindexstreaming then the error occurs. Is the API generally case sensitive; or is this just a restriction of (some of) the Lighstreamer end points?
  14. StoryId is int in NewsDTO object, but BeginGetNewsDetail/GetNewsDetail require it as a string.
  15. Possible solutions: When running the Phone7 emulator you cannot have Fiddler2 http debugger running. It is not compatible with Phone7 emulator and prevents the Phone 7 WebRequest from seeing the internet. (add more possibilities here)