Jump to content

Search the Community

Showing results for tags 'trade'.

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. Hello Physicsman, have a question using Close key value pair to close an existing trade. See: https://docs.labs.gaincapital.com/#Data Types/NewTradeOrderRequestDTO.htm Close integer[] List of existing open trade order IDs that require part or full closure. I tied it out on Postman with below JSON object: { "MarketId": 401484406, "Currency": null, "AutoRollover": false, "Direction": "sell", "Quantity": 1000, "QuoteId": 0, "PositionMethodId": 0, "BidPrice": 1.0001, "OfferPrice": 1.5001, "AuditId": "939239####", "TradingAccountId": ##########, "IfDone": null, "Close": ["779386607"], "Reference": null, "AllocationProfileId": 0, "OrderReference": null, "Source": null, "PriceTolerance": 0, "isTrade":true } And the response I get: { "Status": 4, "StatusReason": 112, "OrderId": 0, "Orders": [], "Quote": null, "Actions": [], "ErrorMessage": null } I looked up 112 StatusReason and according the documentation: https://docs.labs.gaincapital.com/#APICodesList.htm?Highlight=API Code Lookup Values I see it say, "NFA FIFO Account - Target closure restricted." What am I doing wrong here? How do I use Close with API NewTradeOrderRequest to close an existing trade? Thank you.
  2. Can we trade as soon as real-time streaming data of pair begins on Sunday (for my location), or is there a delay? I noticed that the streaming data stopped at 23:59 GMT on Friday, will that always be the case? What GMT time does trading start on Monday? 0:00 GMT? How about the start time for the streaming data? The historical data covers 0:00 to 23:59 GMT of that day, correct? Is the complete historical data of that day available 0:00 GMT of the next day or is there a delay? Do we make up the AuditID ourselves or is it provided? If we are provided, please explain from where? If we make it up, can it be anything or do we need to follow a specific pattern for the template? Would you suggest to change the AuditID per trade? Should it be different for each pair type and/or direction? Is there a minimum or maximum API trade quantity? Does the below JSON object look valid for a trade? Also, am I missing any key/value pairs? Subsequently, can I omit any key/value pairs? TradeJson = { "MarketId": str(marketID), "Currency": None, "AutoRollover": False, "Direction": str(direction), "Quantity": str(qty), "QuoteId": 0, "PositionMethodId": 0, "BidPrice": str(bidPrice), "OfferPrice": str(sellPrice), "AuditId": "str(auditID)", "TradingAccountId": str(tradingAccountID]), "IfDone": None, "Close": None, "Reference": None, "AllocationProfileId": 0, "OrderReference": None, "Source": None, "MarketName": str(pair), "PriceTolerance": 0 } Please note: "None" in Python is the similar to a "null" in other languages.