Jump to content

Search the Community

Showing results for tags 'new'.

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 1 result

  1. Hello, I have a service that opens new trades using the /newtradeorder endpoint. This is my request Json: { "Id":0, "IfDone":[ { "Id":0, "Stop":{ "Id":0, "Guaranteed":false, "TriggerPrice":null, "ExpiryDateTimeUTC":null, "Applicability":"gtc", "ParentOrderId":0, "TrailingDistance":10.0, "Associated":false, "Direction":"sell", "Quantity":1000 }, "Limit":{ "Id":0, "Guaranteed":false, "TriggerPrice":106.31527, "ExpiryDateTimeUTC":null, "Applicability":"gtc", "ParentOrderId":0, "TrailingDistance":null, "Associated":false, "Direction":"sell", "Quantity":1000 } } ], "Direction":"buy", "ExpiryDateTimeUTCDate":null, "LastChangedDateTimeUTCDate":null, "OcoOrder":null, "Type":null, "ExpiryDateTimeUTC":null, "Applicability":"gtc", "TriggerPrice":106.31527, "BidPrice":106.251, "AuditId":"LJ40690714", "AutoRollover":false, "MarketId":401484414, "OfferPrice":106.262, "OrderId":0, "Currency":null, "Quantity":1000, "QuoteId":null, "LastChangedDateTimeUTC":null, "PositionMethodId":1, "TradingAccountId":"<removed id>", "MarketName":null, "Status":null, "isTrade":false, "Json":null } Here's my response: { "Status":1, "StatusReason":1, "OrderId":754499310, "Orders":[ { "OrderId":754499310, "StatusReason":1, "Status":3, "OrderTypeId":1, "Price":106.262, "Quantity":1000.0, "TriggerPrice":0.0, "CommissionCharge":0.0, "IfDone":[ ], "GuaranteedPremium":0.0, "OCO":null, "AssociatedOrders":{ "Stop":{ "OrderId":754497194, "StatusReason":1, "Status":2, "OrderTypeId":2, "Price":0.0, "Quantity":9000.0, "TriggerPrice":106.151000, "CommissionCharge":0.0, "IfDone":[ ], "GuaranteedPremium":0.0, "OCO":{ "OrderId":754497195, "StatusReason":1, "Status":2, "OrderTypeId":3, "Price":0.0, "Quantity":9000.0, "TriggerPrice":106.31527, "CommissionCharge":0.0, "IfDone":[ ], "GuaranteedPremium":0.0, "OCO":null, "AssociatedOrders":{ "Stop":null, "Limit":null }, "Associated":true }, "AssociatedOrders":{ "Stop":null, "Limit":null }, "Associated":true }, "Limit":{ "OrderId":754497195, "StatusReason":1, "Status":2, "OrderTypeId":3, "Price":0.0, "Quantity":9000.0, "TriggerPrice":106.31527, "CommissionCharge":0.0, "IfDone":[ ], "GuaranteedPremium":0.0, "OCO":null, "AssociatedOrders":{ "Stop":null, "Limit":null }, "Associated":true } }, "Associated":false } ], "Quote":null, "Actions":[ { "ActionedOrderId":0, "ActioningOrderId":0, "Quantity":1000.0, "ProfitAndLoss":0.0, "ProfitAndLossCurrency":null, "OrderActionTypeId":1 } ], "ErrorMessage":null } The issue: I am trying to open multiple positions (long and short) on the same market. Each of these new positions should have its own unique Stop/Limit with different trigger prices. What is happening now is that any position I open on the same market seems to get overridden by each other. For example: if I open multiple short and long positions in the same Market-- they all seem to default to one position with the same limit and stop: I am wondering what I am doing wrong with my request? Regards, Rony