Jump to content
  • 0

Several issues with API


GepotTrader

Question

Hi there,

I tried contacting the email address for help but haven't received a response in two weeks. I am building a very simple trading app and can successfully get prices for different epics, however, I have several problems:

  1. I cannot seem to get a list of open positions. The result is successful (200) but empty. I made sure that I specified the correct account and I manually create positions so that there must be data available.
  2. I have the same problem with working orders. I manually created orders in my demo account, but the result from the API is empty.
  3. When trying to create a working order, I get an error message that is not described in the documentation. Here is an example payload:
    {
    "currencyCode": "USD",
    "direction": "SELL",
    "epic": "CS.D.GBPUSD.MINI.IP",
    "expiry": "DFB",
    "forceOpen": true,
    "goodTillDate": "2023/03/03 17:00:00",
    "guaranteedStop": false,
    "level": 1.1946,
    "limitDistance": 1,
    "size": 1,
    "timeInForce": "GOOD_TILL_DATE",
    "type": "STOP"
    }
     
    And here is the error:
    {
    "errorCode": "error.service.instrumentdata-invalid"
    }

    Any help would be greatly appreciated.

Link to comment

1 answer to this question

Recommended Posts

  • 0

For future users:

  1. Despite indicating the correct account in the header, you actually need to switch to the account first using  the session endpoint (PUT) before you will be able to interact with the account
  2. Instead of trying to decipher what you need to add to your payload to place orders, rather use the API companion to figure it out. In my case, the payload was incorrectly configured.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • As more users embrace Dapp, it gets easier to trade crypto, engage in DeFi lending/borrowing and trade NFTs. With the growing need to trade NFT comes the introduction of Love Power Movement, a transparent and accessible marketplace with the best conditions for successful NFT sales. Although the NFT sector has recorded significant growth, it's still impeded by challenges like low protection of artists' and buyers' data, absence of organised policy protecting sellers and buyers amongst others. Love Power aims to tackle those by offering fixed commissions and royalties to creators, ensuring proper profit for sales. LPM token forming a crucial part of the ecosystem has been launched with no presale and VC investment, with intent to direct proceeds from token sales to NFT artists. As $LPM prepares to list on Bitget, the vast community of Love Power Movement would surely be watching keenly.
    • I missed out on NOTCOIN airdrop though i took advantage to buy it at $0.05 when it dipped and in a short while it rose back to $0.2. Made some decent gains there and I'm still holding. I will explore the giveaway to boost my NOTCOIN portfolio on the cex. Right now, my focus on the pre-market trading for hamster on Bitget, I want to make the best use of the Hamster airdrop I'm anticipating.
    • Dear @br864626, Please note that you can transfer shares from your employer's Share Incentive Plan (SIP) or Save As You Earn Scheme (SAYE) to an IG ISA, you will have to ask the provider to initiate the transfer. Thanks, KoketsoIG
×
×
  • Create New...
us