Jump to content
Sign in to follow this  

Place multiple trades

Recommended Posts

When attempting to place more than 1 trade, only the first trade is allowed to process. On all the rest, I get status 75 (The total quantity of guaranteed stop orders must be equal to trade order quantity)

I'm not specifying any stop orders, just simple buy or sell identical to the first accepted trade but with a different marketid.

I spread the timing out just to see if maybe I was being throttled but the subsequent trades failed. I did notice that if I close the first trade before the second is attempted then the second trade works. So is there some kind of rule preventing users from entering more than one position? I send MarketId, TradingAccountID Direction, Quantity, BidPrice and OfferPrice when making the trade API call.

Accepted trade


Rejected trade (only fails if currently in a position)

Share this post

Link to post

Ok This was a "bad" question. Found out the error on subsequent trades attempts was related to the amount of units on the trade. There was a flaw in my programming (caused by strange simulateTrade API call results) which threw off the quantity.

For anyone one calculating their quantity programatically you will have to use the simulateTrade API call with a set number of units and then use that number along with the what was returned from the call to calculate the amount of units necessary when attempting to invest a certain percentage of you available margin. ***NOTE*** IF YOU ENTER A TRADE, THEN SUBSEQUENT CALLS TO THE simulateTrade api WILL GIVE ERRONEOUS   "SimulatedTotalMarginRequirement" amounts. This is how my calculations failed. YOU MUST FIRST CALCULATE YOUR UNITS FOR ALL PAIRS (make all your simulateTrade api calls) BEFORE YOU ENTER ANY POSITIONS IN ORDER TO GET THE RIGHT VALUE FROM the "SimulatedTotalMarginRequirement" field. 


simulateTrade api example result - This was when supplying 100 quantity to the call. Obviously it doesn't take $ 8947.5 margin to make a purchase of 100 units on USD/CAD. (This weird result only happens if you are currently in a position). The real value is like 2.

    "Status": 1,
    "StatusReason": 1,
    "SimulatedCash": 43741.48,
    "ActualCash": 43741.48,
    "SimulatedTotalMarginRequirement": 8947.5,
    "ActualTotalMarginRequirement": 8747.48,
    "CurrencyId": 11,
    "Orders": [
            "StatusReason": 1,
            "Status": 3


Sorry if this question threw anyone off.

Share this post

Link to post

Hi Alb,

Glad to see you managed to sort out the problem and many thanks for the update with additional information. That is very much appreciated. 

Kind Regards, PM

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
Sign in to follow this