tscreators 1 Report post Posted June 21, 2018 Hi I am trying to post to /tradingapi/order/updatetradeorder and i am receiving the following 500 error: json request in given url http://prntscr.com/jxnu1u {"HttpStatus":500,"ErrorMessage":"Exception of type 'InstructionProcessorGateway.ErrorResponse.IpException' was thrown.","ErrorCode":0} Any ideas? Thanks Share this post Link to post
Physicsman 30 Report post Posted June 21, 2018 Hi, Please post the JSON of your update order request and I'll take a look at it. Kind Regards, PM Share this post Link to post
tscreators 1 Report post Posted June 21, 2018 hi , i add in post with screenshot kindly check from this url http://prntscr.com/jxnu1u {"IfDone":[{"Stop":{"ExpiryDateTimeUTC":null,"Guaranteed":false,"Direction":"sell","Quantity":1000,"Applicability":null,"TriggerPrice":111.115,"OrderId":639236594},"Limit":null}],"Direction":"buy","ExpiryDateTimeUTCDate":null,"LastChangedDateTimeUTCDate":null,"Reference":null,"OcoOrder":null,"Type":null ,"ExpiryDateTimeUTC":null,"Applicability":null,"TriggerPrice":null,"BidPrice":110.144,"AuditId":null,"AutoRollover":false,"MarketId":401449254,"OfferPrice":110.157,"OrderId":639236594,"Currency":null,"Quantity":1000,"QuoteId":null,"LastChangedDateTimeUTC":null,"PositionMethodId":1,"TradingAccountId":401384419,"MarketName":"USD/JPY","Status":null} regards tscreators Share this post Link to post
Physicsman 30 Report post Posted June 22, 2018 Hello, The problem is that you have set a closing stop order price at 122, which is above the level that the buy trade was entered. The stop order trigger level must be below the price at which you entered the trade since it is a buy trade. I copy/pasted your code, making adjustments for OrderId, TradingAccountId etc. and set the stop level to 109.00, which is below the level at which I placed the trade. The amendment to the stop value was then accepted successfully. Kind Regards, PM Share this post Link to post
tscreators 1 Report post Posted June 22, 2018 hi , after changing the trigger value getting same result no change. http://prntscr.com/jy3h29 kindly post your JSON request then i will compare with it regards tscreators Share this post Link to post
Physicsman 30 Report post Posted June 22, 2018 Hi, Screenshot of my JSON code is below. There is a change to the response code you are receiving, it is no longer a HTTP 500 code. Your request is now going through to the servers and you are receiving API response codes. One thing I noticed in your latest screenshot is that you have PositionMethodId==2, which means Hedging is enabled. I see from your account you now have several active orders in this market now. Is this what you intended? See screenshot at the bottom. Active orders on your account. Share this post Link to post
tscreators 1 Report post Posted June 22, 2018 hi , i want to know which parameter i have to use for take profit http://prntscr.com/jy5bdi tscreators Share this post Link to post
Physicsman 30 Report post Posted June 25, 2018 Hi, Use the Limit sub-field within the IfDone section. The Stop sub-field controls the stop loss order and the Limit is for your take profit. Kind Regards, PM! Share this post Link to post
tscreators 1 Report post Posted June 25, 2018 hi there , this one is my json but limit still not working . { "IfDone":[ { "Stop":{ "ExpiryDateTimeUTC":null, "Guaranteed":false, "Direction":"sell", "Quantity":1000, "Applicability":null, "TriggerPrice":109, "OrderId":0 }, "Limit":110.89 } ], "Direction":"buy", "ExpiryDateTimeUTCDate":null, "LastChangedDateTimeUTCDate":null, "Reference":null, "OcoOrder":null, "Type":null, "ExpiryDateTimeUTC":null, "Applicability":null, "TriggerPrice":null, "BidPrice":109.613, "AuditId":null, "AutoRollover":false, "MarketId":401449254, "OfferPrice":109.626, "OrderId":639608826, "Currency":null, "Quantity":1000, "QuoteId":null, "LastChangedDateTimeUTC":null, "PositionMethodId":2, "TradingAccountId":401384419, "MarketName":"USD/JPY", "Status":null} regards tscreators Share this post Link to post
Physicsman 30 Report post Posted June 25, 2018 Hi, The Limit order sub-section should be specified in the same way as for the Stop order. The Quantity, Direction, TriggerPrice etc. fields are all required. Kind Regards, PM Share this post Link to post