Jump to content

Search the Community

Showing results for tags 'stop'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Gain Capital API FAQ
    • General Questions and Discussion

Found 2 results

  1. Hi, After reading this good education material on order types (https://www.forex.com/en/education/education-themes/managing-risk/introduction-to-order-types/), I wanted to try out creating a "stop entry buy order" to see how that would look using the API. I tried out the /order/newstoplimitorder end point (assuming that was the correct one in this case), using this JSON: { "Direction": "buy", "MarketId": EUR-USD-market-id-here, "Quantity": 1000, "TradingAccountId": trading-account-id-here, "TriggerPrice": 1.1829, "BidPrice": 1.184, "OfferPrice": 1.185 } where at the time I did the testing all the three prices were above the current spread. On all my attempts it failed with: {'Status': 2, 'StatusReason': 75, 'OrderId': 0, 'Orders': [{'OrderId': 0, 'StatusReason': 49, 'Status': 10, 'OrderTypeId': 3, 'Price': 0.0, 'Quantity': 1000.0, 'TriggerPrice': 1.1829, 'CommissionCharge': 0.0, 'IfDone': [], 'GuaranteedPremium': 0.0, 'OCO': null, 'AssociatedOrders': {'Stop': null, 'Limit': null}, 'Associated': false}], 'Quote': null, 'Actions': [], 'ErrorMessage': null} Apparently I'm doing it wrong. How should a stop entry order (i.e. "an order that triggers a market order when a predefined rate is reached") be created using the API? Thanks for all input. 🙏
  2. I am trying to place a stop or limit entry with an attached OCO and associate them. When the stop or limit order comes back, it is correctly showing the OCO, but when the order fills, the stop and limit OCO order that was attached to the stop or limit no longer has an "Associated" or "AssociatedOrders" object attached to it like other OCO orders that come back. Can I please get some guidance as to how to handle these orders and get the OCO to come back with the filled position? We are currently placing a /order/newstoplimitorder with an IfDone order with the "Associated" property set to true. Again, they come back fine associated, but once the order fills, the stop and limit no longer have an associated object with it.