Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Order Status Reason 81

    Hi Wertmandu, It's absolutley fine to take things at your own pace - there's no rush and no need to apologise! The JSON for your closing call is correctly setup so the Java implementation should work if there are no errors in the Java. We're leaning towards there being something in the Java code causing the problems for the following reasons: When you send the API call natively via Postman there are no problems. No other clients have encountered this pronblem. (All our clients are using the API, whether directly, or from our trading platforms that uses the API). Might be worth checking through the Java code to see if you can spot something there. One quick question: are you attempting to full close your open position or only partially close it? In answer to your question, closing a position does not split it up. Kind Regards, PM
  3. Last week
  4. Order Status Reason 81

    I do apologize for this tardious response, a lot has happened in the past few months. I am now able to get back to this project and try to pick up back from where I left off. In terms of a json request it should look like this example: POST: https://ciapi.cityindex.com/TradingAPI/order/newtradeorder/?UserName=* clientusernamehere *&Session=* sessionidhere * json{ "MarketID": 401449250, "Direction": "sell", "BidPrice": 1.17425, "OfferPrice": 1.17441, "Quantity": 1225, "OrderID": 806527395, "positionMethod": 1, "TradingAccountId": *tradingacountidhere*, "MarketName": "EUR/USD", "Close": [806527395], "isTrade": true } We generate the body in java like so: String jsonBody = "{" + "\"MarketID\": " + marketID + ", " + "\"Direction\": \""+direction+"\", " + "\"BidPrice\": " + bidPrice + ", " + "\"OfferPrice\": " + offerPrice + ", " + "\"Quantity\": " + quantity + ", " + "\"OrderID\": "+openingID+", " + "\"positionMethodId\": 1, " + "\"TradingAccountId\": " + tradingAccountID + ", " + "\"MarketName\": \"" + marketName + "\", " + "\"Close\": ["+openingID+"], "+ "\"isTrade\": true" + "}"; It has changed from always giving an 81 error to sometimes actually going through. I am unsure if it is Java or something else in my call. When I use postman to simulate a call I can get through fine. If I make a speculative question, does closing a position sometimes split the order to different buyers? If not sorry for asking dumb questions. I do also apologize again for taking such an extended hiatus.
  5. Earlier
  6. Williams %R

    Hi Tom, Chart indicators are not carried on the API. They must be calculated manually using the appropriate input data from the API in the indicator formula. Kind Regards, PM
  7. API Limits

    Hi Mike, Apologies for the late reply. For some reason the forum automated software did not notify me about this post (or I somehow missed it), and did not spot this post until now. There is no wieght to the endpoints, each single request counts as 1 out of the 500. It's puzzling that your account is throttled when ther eis no/little activity from it. Presumably you are not doing either of the 2 things listed below? Should it still occur frequently, please take a note of the date/time and activity when throttling occurs. You can contact client services about it with your account details and then can pass that onto the appropriate team to investigage further. Two common cases that can trigger the throttling threshold are: requesting market information requesting price history Market Information Requests When requesting market information, the ListMarketInformation method can accept a list of market IDs. This enables you to retrieve multiple markets in one request, as opposed to making multiple repeated ListMarketInformation calls with one market ID in each request. Price History Requests Client UI applications should not calculate higher time frame prices from lower time frame data. For example, requesting 60x 1-minute price data and then calculating a 1-hour data point. Instead, the client UI should request the 1-hour price history data from the server directly.
  8. /session api error

    Hi Tom, Please use the Live API URL: https://ciapi.cityindex.com/tradingapi. The pre-production URL is no longer available for external use. Kind Regards, PM
  9. Hi Buzz, Apologies for the late reply - you seem to have figured it out. Just in case, it is 7.0.3, which at the time the quoted line was written was the latest version. Clearly this has since been superseded. Kind Regards, PM
  10. How to get/calculate Williams% R from REST api? How to calculate overbought and oversold condition? Gurus please help.
  11. giving error API call to Error posting https://ciapipreprod.cityindextest9.co.uk/TradingApi/session giving error: { "AdditionalInfo": null, "StatusCode": 2, "HttpStatus": 401, "ErrorMessage": "Sorry, your login has failed|This is because your login credentials do not match our records.", "ErrorCode": 4010 } who should I contact?
  12. I just noticed the main page of the API documentation says keyword being latest. The latest is 7.2.0? Should I use 7.2.0, or 7.0.3 as you mention here? Thanks in advance. Normally I'd just try one and if it doesn't work use the other but I'm way out of my depth so please forgive my naivete. edit: you can disregard this thread is helping me understand
  13. API Limits

    Thanks - does each endpoint have a certain “weigh” or is each API request worth 1 point out of the 500? Basically my account is throttle sometimes when there is little to know activity coming from my user session
  14. API Limits

    Hello, It is tracked by the login session in use. Each user can have 5 concurrent sessions. Across those sessions, within a 5 second window, we allow 500 requests. Kind Regards, PM
  15. API Limits

    Hi, I'll check with the dev team and reply when I have an answer. Cordially, PM
  16. API Limits

    Hi @Physicsman, Are the API limits (throttles) based on the IP the requests are coming from or is the 500 per second metric based on the API keys used for the transactions?
  17. Session Id error return code

    Hi Kevin, Should the Session token expire then it is a 401 error code returned. Kind Regards, PM
  18. In the GCAPI Basics section it states "The UI application must be able to handle the Session token expiring, indicated by the return of a 401 HTTP status code." However, in the documentation under the heading "ErrorCode" it states "4011 InvalidSession The session credentials supplied are invalid." There is no 401 error listed. The question then is, which is it 401 or 4011? Or something else completely. Thanks
  19. Reson Code 75

    Hi Dave, Very happy to hear you managed to sort out the problem. Kind Regards, PM
  20. Reson Code 75

    I got the problem, i pass the limit price to the stop price.... Thanks for your help, my mistake
  21. Reson Code 75

    I am using demo account and sent the login info to you. thanks
  22. Hi Kevin, The AuditId is there to help the user in case of any dispute as it exactly tracks what market price the user had received at the time they placed the trade or entry order. I omitted it in my example for expediency, but users should continue to include it in their calls. Kind Regards, PM
  23. Reson Code 75

    Hi Dave, Are you using a demo/test account or a real money Live account? If, and only if you are using a demo/test account, please send me a private message with your account login crednetials. I can then use your account to do some testing directly with API calls and see what happens. Many thanks, PM
  24. Reson Code 75

    I have tested with the same data, but still got error code 49
  25. Hi Physicsman, In the example above, I see that you have omitted the AuditId, possibly because you are an Admin? I would assume that the rest of us need it just as for a regular trade order. Is that correct?
  26. Reson Code 75

    thanks, is there any way i can test on weekend, as all the markets closed
  27. Reson Code 75

    Hi Dave, Probably most efficient to show you the API body of a call that successfully places a trade at market with stop losses and take profit limits. You can then re-use this POST body editing for the current BId/Ask prices, the stop/limit levels and Trading Account ID etc. Since we know this POST body works, if it does NOT work for you we can start narrowing down to see where the problem is. { "MarketId": 401484414, "Direction": "sell", "Quantity": 1000, "BidPrice": 110.279, "OfferPrice": 110.29, "AuditId": "EF70508008", "TradingAccountId": 401637645, "PositionMethodId": 1, "IfDone": [ { "Stop": { "OrderId": null, "Direction": "buy", "Applicability": "gtc", "ExpiryDateTimeUTC": null, "Guaranteed": false, "Quantity": 1000, "TriggerPrice": 121.308, "IfDone": [], "OcoOrder": null, "TriggerLevelCalculationTypeId": null, "TriggerLevelCalculationValue": null }, "Limit": { "OrderId": null, "Direction": "buy", "Applicability": "gtc", "ExpiryDateTimeUTC": null, "Quantity": 1000, "TriggerPrice": 99.249, "IfDone": [], "OcoOrder": null, "TriggerLevelCalculationTypeId": null, "TriggerLevelCalculationValue": null } } ], "PriceTolerance": 1000 } Kind Regards, PM
  28. Reson Code 75

    No i donot think it's the distance problem. please see the attached image, i used the same data on your website platform works with no problem , but on my app return the 49 error code
  1. Load more activity