Jump to content
Gez

decimal places exceed the maximum allowed for the market

Recommended Posts

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 Received
Status:              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

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

image.png

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×