Jump to content

Physicsman

Administrators
  • Content count

    800
  • Joined

  • Last visited

  • Days Won

    20

Physicsman last won the day on April 22

Physicsman had the most liked content!

2 Followers

About Physicsman

  • Rank
    Staff

Profile Information

  • Gender
    Male
  • Location
    London, Great Britain

Recent Profile Visitors

1,448 profile views
  1. Hello! Thank you for sending your demo account credentials. I have managed to successfully place a trade with attached stop loss order. It looks as though there were a series of issues with the call, which lead us on this chain of error messages. The most recent, and hopefully final problem is that the wrong market ID was used in your call. The MarketID for EUR/USD to use in your calls is 401484347, instead of what you actually used. For future reference, you can follow the directions in https://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm?TocPath=How%20Do%20I...%3F%7C_____1 to search/find the Market IDs you need in your trading. The post body that finally worked is: { "MarketId":401484347, "Direction":"buy", "Quantity":1000, "BidPrice": 1.1762, "OfferPrice": 1.1764, "TradingAccountId":<redacted>, "PositionMethodId":1, "IfDone":[{"Stop":{"OrderId":null,"Direction":"Sell","Applicability":"gtc","ExpiryDateTimeUTC":null,"Quantity":1000,"TriggerPrice":1.1710,"IfDone":[],"OcoOrder":null}, "Limit":null}] } Kind Regards, PM
  2. Hello, Our backend execution venue uses the supplied bid/offer in the following way: Kind Regards, PM
  3. Hello, Are you a Forex.com US client or from some other region? The error message mentioning Lot sizes makes me think your account is not a US account. Presumably you are using a test/demo account and it is NOT a live, real money account? Only if it is a test/demo account, please send me a private message with the account credentials. I'll then log on and try some trade calls to investigate further. Kind Regards, PM
  4. Hello, I've sent your question to the API team and will reply again when I have an answer. Kind Regards, PM
  5. Hello, You cannot use zero values for bid or offer as they would result in error messages being returned. Theoretically, you could use some inaccurate non-zero value of the bid/offer and it would work, but there could be unforeseen problems or errors that could occur doing this. It is safest and best to follow the specified calls as intended, but it is your choice. Kind Regards, PM
  6. Hello, I've spotted it. There is a missing direction field in the Stop order part of the request. I've used the following code to successfully place a trade with attached stop. If you edit your code to be in the same format with appropriate field values it should now also work for you. { "MarketId":401484347, "Direction":"buy", "Quantity":1000, "BidPrice": 1.17952, "OfferPrice": 1.17968, "AuditId": "EF34926023", "TradingAccountId":401637645, "PositionMethodId":1, "IfDone":[ { "Stop":{ "OrderId":null, "Direction":"Sell", "Applicability":"gtc", "ExpiryDateTimeUTC":null, "Quantity":1000, "TriggerPrice":1.17848, "IfDone":[], "OcoOrder":null }, "Limit":null } ] } Kind Regards, PM
  7. Hi, By setting "Guaranteed: true", you are attempting to place a guaranteed stop loss order on EUR/USD. Guaranteed orders are not supported/possible for spot FX markets. Please use "Guaranteed: false" in this case. Kind Regards, PM
  8. Hi, The query is missing the search term so is returning the first 50 results. If you want to search for USD currency pairs then try the following: https://ciapi.cityindex.com/TradingApi/market/search?SearchByMarketName=TRUE&Query=USD&MaxResults=50 Kind Regards, PM
  9. Hello, It would be safest to send calls with all the parameters as specified, in this case specifically the Bid, Offer and AuditId. It is possible to drop a few of the parameters in some calls, but you could only find that out by experimentation. Hence it is easier and safer to simply send calls with the specified parameters. For the close trade call, the Bid and Offer prices are required and must be supplied with your close trade call. The call being used is to place a trade at market, which is to say you are trading on the current market price. Hence, you would need a connection through the streaming API call to receive live streaming prices so you know what price you are trading on. Were you to use historical data, then depending on how much time has elapsed since you retrieved the historical prices, the current price on which you are trading could be quite different. Kind Regards, PM
  10. Hi, A valid close request would look like the following: { "MarketId": 401166801, "Direction": "sell", "Close": [ 799731166 ], "Quantity": 1000, "BidPrice": 149.063, "AuditId": "EL35455671", "OfferPrice": 149.109, "TradingAccountId": 401843563 } Presumably you sent to the following endpoint? POST https://ciapi.cityindex.com/TradingAPI/order/newtradeorder Kind Regards, PM
  11. Hi, What was the market search term you used? Please paste in the query you sent and we can investigste further. Kind Regards, PM
  12. Hello, There are 2 ways you can obtain the P&L for each open position. 1) As you already guessed, the first way is to manually calculate it by subtracting the opening price from the current live market price for long positions, or vice versa for short positions. Alternatively. 2) You can subscribe to the TradeMargin stream, which provides the streaming live P&L value for each open position (amongst other information). https://docs.labs.gaincapital.com/#Streaming Data/TradeMargin.htm?TocPath=CIAPI%20Reference%7CStreaming%20Data%7C_____8 Kind Regards, PM
  13. Builder documentation

    Hi Kevin, Happy to help. The direct URL is: http://www.filesandimages.com/Brand/AT Pro Help/index.htm. Kind Regards, PM
  14. 520 Origin Error

    Hello Superee, There was a service interruption yesterday/overnight due to frontdoor issues with Azure affecting access. This should be resolved now so when you next use the API there should be no further problems. Apologies for any inconvenience caused. Kind Regards, PM
  15. Builder documentation

    Hi Kevin, It looks as though you are enquiring about the downloadable desktop trading platform. You can access the documentation from the Help menu and then selecting Help. This opens the documentation within the platform. The programming reference is contained within the "All About AutoTrading" help book as shown in the screenshot below. Kind Regards, PM
×