Jump to content


  • Content count

  • Joined

  • Last visited

  1. That worked, I did query for a list of market ids. Looks like I accidentally copied the wrong one over... I apologize for this being such a simple mistake. Thank you for your help.
  2. I guess I replied too soon. Didn't test it out earlier when reading your response, but just tried to issue the request and got back Status Code: 12 The Quantity, when divided by the market lot size, should be a whole number. Tried updating quantity to be decimal format (as that is mentioned in the docs), but still receive the same response body. Post Body { "MarketId":401166447, "Direction":"buy", "Quantity":1000, "OfferPrice": 1.17750, "BidPrice": 1.17764, "AuditId": "EF34926025", "TradingAccountId":trading_account_id, "PositionMethodId":1, "IfDone":[ { "Stop":{ "OrderId":null, "Direction":"sell", "Applicability":"gtc", "ExpiryDateTimeUTC":null, "Quantity":1000, "TriggerPrice":1.17640, "IfDone":[], "OcoOrder":null }, "Limit":null } ] }
  3. Jeez, such a simple mistake I made lol. I assumed that because the order was denoted as Stop in the ifDone array, that it wasn't necessary to denote the Direction in the Stop Order's JSON. There are buy stops and sell stops though, so it does make sense... Thank you for your help.
  4. I just made that change, and am receiving the same response body of: { "HttpStatus": 400, "ErrorMessage": "The direction of the request is invalid.", "ErrorCode": 60107 } With Guaranteed set to false. Also, the only reason why I added the true is due to the Status Code 75 message that I was initially receiving before I added any elements to the ifDone array 75 The total quantity of guaranteed stop orders must be equal to trade order quantity.
  5. Hello, I've been working on this for at least two hours now. I did a search of the forum for newtradeorder and the error code that was returned in the HTTP Response Body, which yielded no search results. Referencing this documentation: https://docs.labs.gaincapital.com/#HTTP Services/Trade.htm?TocPath=CIAPI%20Reference%7CHTTP%20Services%7CTrades%20and%20Orders%7C_____16 And when I started I was receiving these two StatusCodes fixing one, and then getting the next and resolving that as well before I got stuck. 45 A Guaranteed Order cannot be set to trigger against external price. and 75 The total quantity of guaranteed stop orders must be equal to trade order quantity. Post Body: { "Currency":"EUR/USD", "MarketId": 401166447, "Direction": "buy", "TradingAccountId": trading_account_id, "Quantity": 1000, "AuditId": "EL2131241", "OfferPrice": 1.1776, "BidPrice": 1.1774, "IfDone": [ { "Stop": { "Guaranteed": true, "TriggerPrice": 1.1762, "Applicability": "GTC", "Associated": true } } ] } HTTP Response Body: { "HttpStatus": 400, "ErrorMessage": "The direction of the request is invalid.", "ErrorCode": 60107 } I also tried entering the direction as "Buy", since the docs write it that way. However, I saw a few other forum posts regarding limit orders and saw that direction was specified as all lowercase.