Jump to content

Error placing Live API trade with Commission account, statusReason 160

Recommended Posts

My brother and I are both receiving an error message (status reason 160) when trying to placing a trade with our Live Commission accounts. Below is the call and the response of the error. Note that we are able to successfully place an order using a Standard account.


Time    03/17/21 01:00:22 PM
Message    Market Sell
API Request Headers    {:"Content-Type"=>"application/json", :Session=>"d2852be3-b4c3-4f2d-9947-cb3679ad314d", :UserName=>"d*************"}
API Request Body    {"Direction":"Sell","BidPrice":1.19021,"OfferPrice":1.19021,"Reference":"GCAPI","AutoRollover":false,"MarketId":401484347,"Currency":null,"Quantity":21004,"PositionMethodId":1,"TradingAccountId":"d*************","isTrade":true}

API Response
Status    2
StatusReason    75
OrderId    0
Orders    [{"OrderId"=>0, "StatusReason"=>160, "Status"=>10, "OrderTypeId"=>1, "Price"=>0.0, "Quantity"=>21004.0, "TriggerPrice"=>0.0, "CommissionCharge"=>0.0, "IfDone"=>[], "GuaranteedPremium"=>0.0, "OCO"=>nil, "AssociatedOrders"=>{"Stop"=>nil, "Limit"=>nil}, "Associated"=>false}]
Actions    []


Share this post

Link to post

Hello ChaosRunner,

The error code 160 means that market is not available to the account - in this case the commission accounts, but is available to your standard accounts.

If it is EUR/USD you are interested in trading, we suggest performing a ListMarketSearch https://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm%3FTocPath%3DHow%20Do%20I...%3F|_____1 using your commission account to find the EUR/USD MarketId that you can trade with that account.

Kind Regards, PM 

Share this post

Link to post

Thank you so much Physicsman!!! That solved it, i successfully placed a live trade with the Commission account :)

Our problem was that we were hard-coding the market id (using the same as the Standard account), while the market id should be different between Standard and Commission accounts, as you suggested).

Extremely grateful for your help, words cannot thank you enough for this reply - this ticket can be closed

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