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


Forums

  • Gain Capital API FAQ
    • General Questions and Discussion

Found 4 results

  1. I am executing NewTrade API and passing IfDone parameter with Stop and Limit values. If I am executing Trade for AUD/USD for 1000 qty and if I have already 6000 qty in my account then Stoploss and limit values are updated for all 7000 qty not for current trade. please help, I want put different Stop and Limit for each order for same symbol.
  2. Why do I receive error: "The Quantity decimal places exceed the maximum allowed for the market." on my demo account for the below new market order attempt? Is the Quantity of 0.35 too low? Error Codes Received Status: 10 (Red Card) StatusReason: 20 The Quantity decimal places exceed the maximum allowed for the market. When I execute ... URL: /order/newtradeorder Body: { "BidPrice": 0.69041, "Direction": "Buy", "MarketId": "400617199", "OfferPrice": 0.69064, "PositionMethodId": 2, "Quantity": 0.35, "TradingAccountId": 403******, "isTrade": true } Response: { "Status": 2, "StatusReason": 75, "OrderId": 0, "Orders": [ { "OrderId": 0, "StatusReason": 20, "Status": 10, "OrderTypeId": 1, "Price": 0.0, "Quantity": 0.35, "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. 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.
  4. 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.
×