Jump to content

danilo

Members
  • Content count

    12
  • Joined

  • Last visited

About danilo

  • Rank
    Member

Recent Profile Visitors

33 profile views
  1. Thank you so much for your kind words and feedback. I tried the suggestion and still end up getting same error. Please confirm the order Id to pass in Step 3 will be order Id of trade order OR stop loss order. Also as you mentioned "Some markets have a minimum distance for stop/limit orders away from the the current price" so is this a forex API restrictions or a market restrictions? Also as per forex person this is only applicable for UK accounts but I am not able to set even if my test account is not UK based. Also I see two document links so which one is correct? http://docs.labs.gaincapital.com/ http://docs.labs.cityindex.com/ Thanks
  2. Thank you for your reply. My use case is 1) execute a postion 2) then set the stop loss 3) update the stop loss Pls find below request response. I corrected the Quantity issue but still end up same error. Per my understanding the issue is with the value of stop loss I am trying to update. It was set to 1.9922 in step 2 and I tried to update it to 1.99380. I am using /updatetradeorder API. When I tried to set the value 1.99380 from forex web application , they have also not allowed me with some validations that max value is so and so. Requesting you to please have a look and let me know what is the mistake that I am doing. I tried contacting support guys and they said that this stop loss price restrictions is applicable to UK accounts and they confirmed that mine account is not UK. Not sure what is wrong here. // Execute buy order { "MarketName": "XYZ", "TradingAccountId": XXXXX, "MarketId": 401484388, "Quantity": 1000, "OrderId": 0, "Direction": "buy", "OfferPrice": 1.9939, "BidPrice": 1.99315, "PriceTolerance": 10, "PositionMethodId": 1, "AuditId": "ed6c6c6f-a368-4d54-8b87-59c564f991dc", "AutoRollover": false, "isTrade": true } // success response { "Status": 1, // OK "StatusReason": 1, // OK "OrderId": 711777646, // Order ID "Orders": [ { "OrderId": 711777646, "StatusReason": 1, // OK "Status": 3, // OPen "OrderTypeId": 1, // Trade "Price": 1.9939, // Open Price "Quantity": 1000.0, // Qty "TriggerPrice": 0.0, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [ { "ActionedOrderId": 0, "ActioningOrderId": 0, "Quantity": 1000.0, "ProfitAndLoss": 0.0, "ProfitAndLossCurrency": null, "OrderActionTypeId": 1 } ], "ErrorMessage": null } // Set Stop Loss { "IfDone": [ { "Stop": { // Set Stop "ExpiryDateTimeUTC": null, "Guaranteed": false, "Direction": "sell", "Quantity": 1000, // Qty "Applicability": "GTC", "TriggerPrice": 1.9922, // price to set stop loss "OrderId": 0 } } ], "Direction": "buy", "ExpiryDateTimeUTCDate": null, "LastChangedDateTimeUTCDate": null, "OcoOrder": null, "Type": null, "ExpiryDateTimeUTC": null, "Applicability": "GTC", "TriggerPrice": 1.9939, // open price of parent order "BidPrice": 2.43708, // dummy "AutoRollover": false, "MarketId": 401484388, "OfferPrice": 2.43708, // dummy "AuditId": "a8aaec68-2957-45d8-b89f-bd1ffc58d67a", "OrderId": 711777646, "Currency": null, "Quantity": 1000, "QuoteId": null, "LastChangedDateTimeUTC": null, "PositionMethodId": 1, "TradingAccountId": XXXX, "Status": null, "isTrade": true } // Response { "Status": 1, // OK "StatusReason": 1, // OK "OrderId": 711777646, // Parent Order Id "Orders": [ // parent order details { "OrderId": 711777646, // order id "StatusReason": 1, // ok "Status": 3, // open "OrderTypeId": 1, // trade "Price": 1.9939, // order price "Quantity": 1000.0, // qty "TriggerPrice": 0.0, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false }, // stop { "OrderId": 711777649, // stop order id "StatusReason": 1, // ok "Status": 2, // accepted "OrderTypeId": 2, // stop "Price": 0.0, "Quantity": 1000.0, "TriggerPrice": 1.9922, // stop price "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [], "ErrorMessage": null } // update stop loss { "IfDone": [ { "Stop": { "ExpiryDateTimeUTC": null, "Guaranteed": false, "Direction": "sell", "Quantity": 1000, "Applicability": "GTC", "TriggerPrice": 1.99380, // updating price to 1.99380 from 1.99220 "OrderId": 0 } } ], "Direction": "buy", "ExpiryDateTimeUTCDate": null, "LastChangedDateTimeUTCDate": null, "OcoOrder": null, "Type": null, "ExpiryDateTimeUTC": null, "Applicability": "GTC", "TriggerPrice": 1.9939, "BidPrice": 2.43708, "AutoRollover": false, "MarketId": 401484388, "OfferPrice": 2.43708, "AuditId": "462d21b4-5ec9-4ab9-a32e-0545c299bda2", "OrderId": 711777646, "Currency": null, "Quantity": 1000, "QuoteId": null, "LastChangedDateTimeUTC": null, "PositionMethodId": 1, "TradingAccountId": XXXXX, "Status": null, "isTrade": true } // response FAIL { "Status": 2, // Red Card "StatusReason": 75, // Check the values "OrderId": 711777646, "Orders": [ { "OrderId": 711777646, "StatusReason": 1, "Status": 3, "OrderTypeId": 1, "Price": 1.9939, "Quantity": 1000.0, "TriggerPrice": 0.0, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [], "ErrorMessage": null }
  3. Thanks for your reply. But I see another request with same diff is worked fine { "IfDone": [ { "Stop": { "ExpiryDateTimeUTC": null, "Guaranteed": false, "Direction": "buy", "Quantity": 1000, "Applicability": "GTC", "TriggerPrice": 1.99467, "OrderId": 0 } } ], "Direction": "sell", "ExpiryDateTimeUTCDate": null, "LastChangedDateTimeUTCDate": null, "OcoOrder": null, "Type": null, "ExpiryDateTimeUTC": null, "Applicability": "GTC", "TriggerPrice": 1.99237, "BidPrice": 2.43708, "AutoRollover": false, "MarketId": 401484388, "OfferPrice": 2.43708, "AuditId": "a60a608e-5641-4a3d-9a50-a8bbf85ec9c0", "OrderId": 711005695, "Currency": null, "Quantity": 2, "QuoteId": null, "LastChangedDateTimeUTC": null, "PositionMethodId": 1, "TradingAccountId": 402373909, "Status": null, "isTrade": true } { "Status": 1, "StatusReason": 1, "OrderId": 711005695, "Orders": [ { "OrderId": 711005695, "StatusReason": 1, "Status": 3, "OrderTypeId": 1, "Price": 1.99237, "Quantity": 1000.0, "TriggerPrice": 0.0, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false }, { "OrderId": 711005696, "StatusReason": 1, "Status": 2, "OrderTypeId": 2, "Price": 0.0, "Quantity": 1000.0, "TriggerPrice": 1.99467, "CommissionCharge": 0.0, "IfDone": [], "GuaranteedPremium": 0.0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } ], "Quote": null, "Actions": [], "ErrorMessage": null }
  4. Hello , Please find request and response . Please have a look and let me know if what is wrong in it. Request - {"IfDone":[{"Stop":{"ExpiryDateTimeUTC":null,"Guaranteed":false,"Direction":"buy","Quantity":1000,"Applicability":"GTC","TriggerPrice":1.9621,"OrderId":0}}],"Direction":"sell","ExpiryDateTimeUTCDate":null,"LastChangedDateTimeUTCDate":null,"OcoOrder":null,"Type":null,"ExpiryDateTimeUTC":null,"Applicability":"GTC","TriggerPrice":1.9629,"BidPrice":2.43708,"AutoRollover":false,"MarketId":401484388,"OfferPrice":2.43708,"AuditId":"bb2ad99c-354e-4acc-a9aa-429bafd2057c","OrderId":709910755,"Currency":null,"Quantity":2,"QuoteId":null,"LastChangedDateTimeUTC":null,"PositionMethodId":1,"TradingAccountId":402373909,"Status":null,"isTrade":true} Response {"Status":2,"StatusReason":75,"OrderId":709910755,"Orders":[{"OrderId":709910755,"StatusReason":1,"Status":3,"OrderTypeId":1,"Price":1.9629,"Quantity":1000.0,"TriggerPrice":0.0,"CommissionCharge":0.0,"IfDone":[],"GuaranteedPremium":0.0,"OCO":null,"AssociatedOrders":{"Stop":null,"Limit":null},"Associated":false}],"Quote":null,"Actions":[],"ErrorMessage":null}
  5. Hello Setting of stop loss limit starts failing with reason code 75. tried contacting support and they informed that this restriction is applied to account registered for UK and non UK accounts does not have this restrictions. They created a new practice account for us to solve this issue and it worked for some days but all of sudden I start getting status code 75 again. Any lead on this behavior or solution to the problem? Thanks
  6. One Cancel Other order

    Hi. I have placed a trade and can see the open position. Now I am using updateStopLossLimit API to update order to set stop loss and limit. I want to to do it in similar manner the way we can do it via website like oco (if any of stop loss or limit executes, it cancels others). Can you share sample request of ocoOrder as I do not find any. Thanks in advance.
  7. Thanks for your reply. I did set price tolerance to 0 but got same behavior (one open position and one trade order entry under "trade history" section)
  8. What I mean by order stays there is that I can see one open position and on trade order in (Opening) state. Setting price tolerance to 0 will not open position?
  9. Okay but even if it places trade, I want to know when actually it gets execute. It always stays in there for me. Also what is the purpose of price tolerance. Does it work in both (+ 0-) direction. Any plans to support kill or fill feature? Thanks
  10. Hi do we need both bid and offer price? I think we should be needed only once based on the direction. Also With my call also I am able to see a open position in Advantage Web platform but it never executes. I saw that even if it the price matches it doesn't execute. My requirement is that if it finds the value (+- price tolerance) at the time of trade order placed, it executes else it cancels. Thanks
  11. Thanks for your answer but I am using same (/newtradseorder) and the bid/offer price was taken from lightstreamer only. It just lands up in Trade section and never executes. Can you please help me understansd what I am doing wrong I am using /order/newtradeorder API Sample Request/Response below - {"IfDone":[],"Direction":"sell","ExpiryDateTimeUTCDate":null,"LastChangedDateTimeUTCDate":null,"OcoOrder":null,"Type":null,"ExpiryDateTimeUTC":null,"Applicability":null,"AuditId":"e5b8b0f3-633b-480d-8744-0d9798b55257","AutoRollover":false,"MarketId":154290,"OrderId":0,"Currency":null,"Quantity":10,"QuoteId":null,"LastChangedDateTimeUTC":null,"PositionMethodId":1,"TradingAccountId":1234,"MarketName":"XYZ","Status":null,"isTrade":true,"OfferPrice":1.1077,"BidPrice":null,"PriceTolerance":5} {"Status":1,"StatusReason":1,"OrderId":570670750,"Orders":[{"OrderId":570670750,"StatusReason":1,"Status":3,"OrderTypeId":1,"Price":1.10756,"Quantity":10,"TriggerPrice":0,"CommissionCharge":0,"IfDone":[],"GuaranteedPremium":0,"OCO":null,"AssociatedOrders":{"Stop":null,"Limit":null},"Associated":false}],"Quote":null,"Actions":[{"ActionedOrderId":570670750,"ActioningOrderId":570670750,"Quantity":10,"ProfitAndLoss":0,"ProfitAndLossCurrency":null,"OrderActionTypeId":1}],"ErrorMessage":null}
  12. Hi All My requirement is to place an trade which gets executed at current price. I do not see such api and have to specify some values along with price tolerance. On running I can see an open position but it do not execute. Can you help me with a) is there any API which places market order (trade) at current price. If not available then how to place a trade with specified values. If value matches trade executes else cancels it. I am using /order/newtradeorder API Sample Request/Response below - {"IfDone":[],"Direction":"sell","ExpiryDateTimeUTCDate":null,"LastChangedDateTimeUTCDate":null,"OcoOrder":null,"Type":null,"ExpiryDateTimeUTC":null,"Applicability":null,"AuditId":"e5b8b0f3-633b-480d-8744-0d9798b55257","AutoRollover":false,"MarketId":154290,"OrderId":0,"Currency":null,"Quantity":10,"QuoteId":null,"LastChangedDateTimeUTC":null,"PositionMethodId":1,"TradingAccountId":1234,"MarketName":"XYZ","Status":null,"isTrade":true,"OfferPrice":1.1077,"BidPrice":null,"PriceTolerance":5} {"Status":1,"StatusReason":1,"OrderId":570670750,"Orders":[{"OrderId":570670750,"StatusReason":1,"Status":3,"OrderTypeId":1,"Price":1.10756,"Quantity":10,"TriggerPrice":0,"CommissionCharge":0,"IfDone":[],"GuaranteedPremium":0,"OCO":null,"AssociatedOrders":{"Stop":null,"Limit":null},"Associated":false}],"Quote":null,"Actions":[{"ActionedOrderId":570670750,"ActioningOrderId":570670750,"Quantity":10,"ProfitAndLoss":0,"ProfitAndLossCurrency":null,"OrderActionTypeId":1}],"ErrorMessage":null} In response I can see "OrderActionTypeId":1 which means order is in opening state and that I can see on web interface too. Thanks
×