Gez 0 Report post Posted October 19, 2021 Why do I receive error: "The Quantity decimal places exceed the maximum allowed for the market." on my demo account for the below new market order attempt? Is the Quantity of 0.35 too low? Error Codes ReceivedStatus: 10 (Red Card) StatusReason: 20 The Quantity decimal places exceed the maximum allowed for the market. When I execute ... URL: /order/newtradeorder Body: { "BidPrice": 0.69041, "Direction": "Buy", "MarketId": "400617199", "OfferPrice": 0.69064, "PositionMethodId": 2, "Quantity": 0.35, "TradingAccountId": 403******, "isTrade": true } Response: { "Status": 2, "StatusReason": 75, "OrderId": 0, "Orders": [ { "OrderId": 0, "StatusReason": 20, "Status": 10, "OrderTypeId": 1, "Price": 0.0, "Quantity": 0.35, "TriggerPrice": 0.0, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [], "ErrorMessage": null } Share this post Link to post
Physicsman 30 Report post Posted October 20, 2021 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 Share this post Link to post
Gez 0 Report post Posted October 28, 2021 Thanks for the confirmation of the order behaviour from your testing. I have however found the issue. The StatusReason states that the following error ... Status: 10 (Red Card) StatusReason: 20 The Quantity decimal places exceed the maximum allowed for the market. This occurs because I am assigning a double precision number in the Quantity field of my JSON request which is not rounded to 2 decimal places. "Quantity" = 3.500000000000001 When I round the Quantity to 2 decimal places and format as a string in the JSON request the issue is resolved. "Quantity" = "3.50" Thanks for your help on this. Share this post Link to post
Physicsman 30 Report post Posted October 28, 2021 Great to hear you found and fixed the problem Gez! Appreciate the update. Kind Regards, PM Share this post Link to post