Jump to content
Sign in to follow this  
szcxdave1988

Reson Code 75

Recommended Posts

when i make a new trade https://ciapi.cityindex.com/TradingAPI/order/newtradeorder with IfDone value i got reson code 75: 

The total quantity of guaranteed stop orders must be equal to trade order quantity.

but all the stop and limit order's quantity are the same as order's, how to do with it?

this is my post data for swift :

TradeData(IfDone: [exchange.IfDone(Stop: Optional(exchange.StopLimit(ExpiryDateTimeUTC: nil, Guaranteed: Optional(false), Direction: Optional("buy"), Quantity: Optional(1000), Applicability: "gtc", TriggerPrice: 110.42855, ParentOrderId: nil, Associated: false)), Limit: Optional(exchange.StopLimit(ExpiryDateTimeUTC: nil, Guaranteed: Optional(false), Direction: Optional("buy"), Quantity: Optional(1000), Applicability: "gtc", TriggerPrice: 110.42236, ParentOrderId: nil, Associated: false)))], Direction: exchange.Direction.sell, BidPrice: 110.425, OfferPrice: 110.437, AuditId: "EG12346253", MarketId: 401484414, Quantity: 1000, TradingAccountId: 401819215, PriceTolerance: 1000, Close: [])

the response is:

 

{

  "OrderId" : 0,

  "Quote" : null,

  "StatusReason" : 75,

  "Orders" : [

    {

      "IfDone" : [

 

      ],

      "Status" : 1,

      "TriggerPrice" : 0,

      "AssociatedOrders" : {

        "Limit" : {

          "OrderId" : 0,

          "Status" : 10,

          "Quantity" : 1000,

          "OrderTypeId" : 3,

          "AssociatedOrders" : {

            "Limit" : null,

            "Stop" : null

          },

          "GuaranteedPremium" : 0,

          "StatusReason" : 49,

          "Associated" : true,

          "Price" : 0,

          "OCO" : null,

          "TriggerPrice" : 113.468,

          "CommissionCharge" : 0,

          "IfDone" : [

 

          ]

        },

        "Stop" : {

          "OrderId" : 0,

          "Status" : 10,

          "Quantity" : 1000,

          "OrderTypeId" : 2,

          "AssociatedOrders" : {

            "Limit" : null,

            "Stop" : null

          },

          "GuaranteedPremium" : 0,

          "StatusReason" : 49,

          "Associated" : true,

          "Price" : 0,

          "OCO" : {

            "OrderId" : 0,

            "AssociatedOrders" : {

              "Limit" : null,

              "Stop" : null

            },

            "GuaranteedPremium" : 0,

            "Associated" : true,

            "Price" : 0,

            "TriggerPrice" : 113.468,

            "StatusReason" : 49,

            "Quantity" : 1000,

            "OCO" : null,

            "CommissionCharge" : 0,

            "OrderTypeId" : 3,

            "Status" : 10,

            "IfDone" : [

 

            ]

          },

          "TriggerPrice" : 105.592,

          "CommissionCharge" : 0,

          "IfDone" : [

 

          ]

        }

      },

      "Quantity" : 1000,

      "CommissionCharge" : 0,

      "Price" : 0,

      "OCO" : null,

      "OrderId" : 0,

      "OrderTypeId" : 1,

      "StatusReason" : 1,

      "Associated" : false,

      "GuaranteedPremium" : 0

    }

  ],

  "Status" : 2,

  "Actions" : [

 

  ],

  "ErrorMessage" : null

}

 

Share this post


Link to post

Hi Dave,

The code 75 you are seeing is the InstructionStatusReason code, and 75 means "Instruction processing has resulted in a Red Card. Please check details."

If you look further into the body of your response you will see there are StatusReason 49 codes as well. It is these that are the OrderStatusReason code, and 49 means "Trigger level does not conform to minimum distance requirements specified for the market."

Is the entry price of your order to close to the current Buy/Sell price?

Kind Regards, PM

 

Share this post


Link to post

Hi Dave,

Probably most efficient to show you the API body of a call that successfully places a trade at market with stop losses and take profit limits. You can then re-use this POST body editing for the current BId/Ask prices, the stop/limit levels and Trading Account ID etc. 

Since we know this POST body works, if it does NOT work for you we can start narrowing down to see where the problem is.

{
    "MarketId": 401484414,
    "Direction": "sell",
    "Quantity": 1000,
    "BidPrice": 110.279,
    "OfferPrice": 110.29,
    "AuditId": "EF70508008",
    "TradingAccountId": 401637645,
    "PositionMethodId": 1,
    "IfDone": [
        {
            "Stop": {
                "OrderId": null,
                "Direction": "buy",
                "Applicability": "gtc",
                "ExpiryDateTimeUTC": null,
                "Guaranteed": false,
                "Quantity": 1000,
                "TriggerPrice": 121.308,
                "IfDone": [],
                "OcoOrder": null,
                "TriggerLevelCalculationTypeId": null,
                "TriggerLevelCalculationValue": null
            },
            "Limit": {
                "OrderId": null,
                "Direction": "buy",
                "Applicability": "gtc",
                "ExpiryDateTimeUTC": null,
                "Quantity": 1000,
                "TriggerPrice": 99.249,
                "IfDone": [],
                "OcoOrder": null,
                "TriggerLevelCalculationTypeId": null,
                "TriggerLevelCalculationValue": null
            }
        }
    ],
    "PriceTolerance": 1000
}

Kind Regards, PM

Share this post


Link to post

Hi Dave,

Are you using a demo/test account or a real money Live account?

If, and only if you are using a demo/test account, please send me a private message with your account login crednetials. I can then use your account to do some testing directly with API calls and see what happens.

Many thanks, 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  
×