Jump to content

Search the Community

Showing results for tags 'newstoplimitorder'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Gain Capital API FAQ
    • General Questions and Discussion

Found 4 results

  1. Hi Team, I am trying to place limit order, and the api is giving 'Status': 4, 'StatusReason': 15 in response, and limit order is not getting executed. I am able to place trade/market order though. Below are request rseponse details. Please suggest how to place new limit order, if below approach is not correct. url: https://ciapi.cityindex.com/TradingAPI/order/newstoplimitorder Request: {'isTrade': False, 'OcoOrder': None, 'Applicability': 'GTC', 'Direction': 'sell', 'MarketId': 401203113, 'BidPrice': 0.6572907, 'OfferPrice': 0.6705693, 'Quantity': 1000, 'Reference': None, 'QuoteId': None, 'AuditId': '', 'AutoRollover': False, 'TradingAccountId': 402855859, 'TriggerPrice': None, 'PositionMethodId': 1, 'IfDone': []} Response: {'sym': 'AUDCHF', 'transType': 'sell', 'rate': 0.66393, 'qty': 1000, 'resp': {'Status': 4, 'StatusReason': 15, 'OrderId': 0, 'Orders': [], 'Quote': None, 'Actions': [], 'ErrorMessage': None}} Note: I am based in Europe.
  2. Hello sir, when we pass parameter on demo account for below link POST https://ciapi.cityindex.com/TradingAPI/order/newstoplimitorder And got below response header with status code 200. StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Cache-Control: private Server: Microsoft-IIS/8.5 X-AspNetMvc-Version: 5.2 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Mon, 31 Aug 2020 05:52:21 GMT Connection: keep-alive Content-Type: text/html; charset=utf-8 Content-Length: 2953 } Now in content type it is text/html rather then JSON. we are making programming in C#. we are getting getting difficult to get retrieve the response body is the ApiTradeOrderResponseDTO in JSON format as suggest on gain capital "http://docs.labs.gaincapital.com/index.html#HTTP Services/Order.htm?Highlight=newstoplimitorder". So please give us solution for this issue.
  3. I am trying to use the order/newstoplimitorder endpoint of GCAPI and having trouble understanding what OfferPrice is used for in NewStopLimitOrderRequestDTO. It is hard to tell which fields are actually required from the docs, but after some testing, it seems as if I only need at a minimum MarketId, Direction, TriggerPrice, Quantity, and OfferPrice (assuming I am OK with defaults on other fields). Based on some testing, OfferPrice does not seem to matter much, but want to confirm before I use the endpoint with real money. I see no equivalent field in the Web/Desktop platform via the UI, so not really sure what it is needed/used for. Also, it is required for both "Buy" and "Sell" orders, which is confusing since I wouldn't care so much about the OfferPrice when I am buying. For example, the current ASK price of AUD/USD (marketId = 401484317) was 0.7135. All 3 of these request bodies seem to create the same order even though the OfferPrice in the request varies greatly: {"MarketId":401484317,"Direction":"Sell","TriggerPrice":0.7135,"OfferPrice":0.7135,"Quantity":1000} {"MarketId":401484317,"Direction":"Sell","TriggerPrice":0.7135,"OfferPrice":2.7135,"Quantity":1000} {"MarketId":401484317,"Direction":"Sell","TriggerPrice":0.7135,"OfferPrice":0.2135,"Quantity":1000} I can see no reference to the OfferPrice in the API success response, or through the active orders endpoint, or through the web platform UI. Am I missing something, or can I just supply any value for this field? Does the OfferPrice have any effect on the order? My intention is to watch prices via Lightstreamer, do some analysis, and place a limit order with a TriggerPrice within a couple of pips +/- of the price I did analysis on to make sure I am getting a "close" price to what I analyzed. Since the current OfferPrice may be different by the time my analysis is complete and the order is requested, It seems I would be best to just set my Direction/TriggerPrice to where I want in the request, then just make the OfferPrice the last OfferPrice I got, regardless of when I got that price or what the current OfferPrice on the pair actually is, but want to make sure I am supplying this field with an appropriate value.
  4. Hi, I am trying to place an order but not able to getting it to work. Here below is my json. Please let me know what's the issue. url : https://ciapi.cityindex.com/TradingAPI/order/newstoplimitorder { "OrderId":0, "MarketId":401484392, "MarketName":"GBP/USD", "AutoRollover":false, "isTrade":false, "Direction":"buy", "Quantity":10.0, "BidPrice":1.431, "OfferPrice":1.4312, "AuditId":"XXXX", "TradingAccountId":401651554, "PositionMethodId":1, "Applicability":"GTC", "Guaranteed":false, "TriggerPrice":1.4397 } the response I am getting is as below. {"Status":2,"StatusReason":75,"OrderId":0,"Orders":[{"OrderId":0,"StatusReason":8,"Status":10,"OrderTypeId":2,"Price":0.0,"Quantity":10.0,"TriggerPrice":1.4397,"CommissionCharge":0.0,"IfDone":[],"GuaranteedPremium":0.0,"OCO":null,"AssociatedOrders":{"Stop":null,"Limit":null},"Associated":false}],"Quote":null,"Actions":[],"ErrorMessage":null}
×