Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Physicsman last won the day on April 22

Physicsman had the most liked content!


About Physicsman

  • Rank

Profile Information

  • Gender
  • Location
    London, Great Britain

Recent Profile Visitors

1,499 profile views
  1. Is there a Stop-Limit order?

    Hello Ken, Sadly no, as we don't have that order type in our system there is no API endpoint for it either. Kind Regards, PM
  2. null ref on trade response

    Very nice to hear you have managed to fix the problem! Thank you for the update. Kind Regards, PM
  3. null ref on trade response

    Hi David, Your 2nd post didn't show the JSON market order request body so I'm not able to see if there is a problem there. What I've done is show below a successful JSON market order request I just sent now so you can compare to one that we know works. That way you can check/eliminate that as a possible cause. Market Order request POSTed to: https://ciapi.cityindex.com/TradingAPI/order/newtradeorder POST body: { "MarketId": 401484347, "Direction": "buy", "Quantity": 1000, "BidPrice": 1.15995, "OfferPrice": 1.1601, "AuditId": "EF30932739", "TradingAccountId": 401637645, "PositionMethodId": 1, "IfDone": [], "PriceTolerance": 10 } Your password when using the API is the same password you use when logging in with your account using one of our trading platforms. You can use a GetClientAndTradingAccount call to check our TradingAccountId, but it should not have changed from last month. If and only if you are using a demo or test account, you can send me a PM with the account credentials. I can then try sending a market order with your test/demo account to make sure everything is working as expected. Kind Regards, PM
  4. null ref on trade response

    Hello, The API endpoints have not changed in a way that would invalidate your previously working code - at least it should not have done! I'll take a closer look at your 2nd post and write another reply once I have done so. Kind Regards, PM
  5. Hi Ashish, Judging by the query, you are a Forex.com US client? Due to the US regulations from the NFA, the behaviour you describe is exactly how it should work for US clients. As it is due to regulations, we cannot make any changes to this behaviour. Stops/Limits are always for the Net total position and cannot be attached to individual trades/positions. Sorry it isn't better news. Kind Regards, PM
  6. Great to hear you found and fixed the problem Gez! Appreciate the update. Kind Regards, PM
  7. Hi Ashish, The system is designed with the expectation that you subscribe to live streaming market prices using Lighstreamer. You then feed the current live bid/offer prices into your market order calls. By using historical tick data, you run the risk of attempting to trade on stale prices, which judging from the error message is exactly what is happening. Price Tolerance has a default value of 2 for all markets, although you can modify it on a per market basis. It defines the amount of slippage you are willing to accept in order to execute your market order. By using historical price ticks, when you send your market order the current live market price has moved by more than 2 pips/points from the price you supplied as the offer price in your call. That is why you are receiving a Price Tolerance exceeded error message. You would normally only encounter this occasionally, usually when trying to trade during a volatile market moment with fast moving prices. Kind Regards, PM
  8. Hello, Yes, the documentation will be updated - don't have an ETA for that at this time. It's been awhile since the change - didn't find a specific date. Kind Regards, PM
  9. Hi Gez, The trade size you are using is fine for the market you are trying to trade. I made an API call that is edited from your call for the current prices etc. using my test account and the trade placed fine. Your call should have worked. Are you using a test or demo account? If, and only if you are using a test/demo account, please send me a private message with the account login credentials. I'll try the trade call again using your test account. Kind Regards, PM
  10. Hi, That could probably work in most cases. Something to bear in mind is that it may have some problems if the market price is moving very fast, say over a big news event such as non-farm payrolls or some other large market moving shock event. AuditID is used if we need to investigate if a client/user has a query on the execution/price etc. If you send a dummy AuditID, that would allow the trade to process but it does mean that should you ever have any query or dispute on execution price, the investigation result will be a bit more coarse since we cannot identify the exact price you were trying to trade on. The delay in GetLatestPriceTicks would generally be sum of time for database servers to read the latest price tick/save into database + internet latency from your request to response. If I recall corrctly you are using a test/demo acocunt? In which case, you can experiment and try with the methodology you queried above. Then see if the results are acceptable for your purposes. Kind Regards, PM
  11. Hello Forexsqs, There are endpoints to retrieve historical price data such as tick history. As an example: GetLatestPriceTicks. However, they only contain data current up to the point in time at which you make the call, they do not update astime passes automatically. Live pricing is only available by stream via Lightstreamer unfortunately. We don't have an alternative trade endpoint that does not require the fields you mention. Sorry it isn't better news. Kind Regards, PM
  12. 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
  13. 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
  14. 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.
  15. /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