Jump to content
  • 0

Several issues with API



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
  • General Statistics

    • Total Topics
    • Total Posts
    • Total Members
    • Most Online
      10/06/21 10:53

    Newest Member
    Joined 29/09/23 19:22
  • Posts

    • The crypto market appears to be showing signs of recovery, with significant improvements in the Sharpe Ratios of Bitcoin, BGB, and Ethereum, according to an article published on Friday.  The Sharpe Ratio, a measure used to understand the return of an investment compared to its risk, has seen a notable increase for both cryptocurrencies. Bitcoin's Sharpe Ratio has risen from -2.4 to 0.68, while Ethereum and BGB have also experienced a similar uptrend. This change signifies higher returns at lower risk, which is expected to attract more investors to the crypto market. In addition to the improved Sharpe Ratios, increased network activity and trading volume as shown on CEXs like Bitget, Binance, and a few DEXs are suggesting a healthier market state. The current trading prices of Bitcoin, reflect this overall positive market sentiment. As of Friday, Bitcoin was trading at $27,069.73, BGB at $0.454 and Ethereum at $1,677.89. These developments are significant as they indicate reduced risk in the crypto market. The increase in the Sharpe Ratios for Bitcoin, BGB, and Ethereum suggests that these cryptocurrencies are becoming less risky investments, which could potentially lead to an influx of new investors into the market.  Could this rise in Sharpe Ratios coupled with increased network activity and trading volume point towards a recovering and less risky crypto market?
    • Hi, That's great, thank you very much. Very helpful! Many thanks.
    • Texas Instruments Inc., Elliott Wave Technical Analysis Texas Instruments Inc., (TXN:NASDAQ): Daily Chart, 29 September 23 TXN Stock Market Analysis: We have been moving lower as expected from the previous forecast. Looking for continuation lower as there is an incomplete bullish sequence. Looking for extension lower in wave {iii}. Downside target stands below wave (W). TXN Elliott Wave Count: Wave {iii} of C. TXN Technical Indicators: Below al averages.   TXN Trading Strategy: Looking for shorts on the way down.   TradingLounge Analyst: Alessio Barretta Source : Tradinglounge.com get trial here!       Texas Instruments Inc., TXN: 4-hour Chart, 29 September 23 Texas Instruments Inc., Elliott Wave Technical Analysis TXN Stock Market Analysis: As we are getting an overlapping structure in what could be a wave {iii} there is a high chance we will see an acceleration lower to then see a series of fours and fives.   TXN Elliott Wave count:  Wave (iii) of {iii}. TXN Technical Indicators: 20EMA as resistance. TXN Trading Strategy: Looking for shorts on the way down.
  • Create New...