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 24/03/23 16:01
  • Posts

    • Charting the Markets: 24 March The FTSE 100, DAX 40 and Nasdaq 100 slide on renewed banking woes while EUR/USD, EUR/GBP and GBP/USD drop as the US dollar, gold appreciate due to flight-to-quality flows. Crude oil and copper tumble on recession fears.  Axel Rudolph FSTA | Senior Financial Analyst, London | Publication date: Friday 24 March 2023         This is here for you to catch up but if you have any ideas on markets or events you want us to relay to the TV team we’re more than happy to.  
    • Market Breakdown | WTI Oil, EURUSD, GBPNZD, EURAUDHere are the updates & outlook for multiple instruments in my watchlist.1️⃣ WTI Oil daily time frame️The market is trading in a long term bearish trend .After the last sharp bearish movement, the market is steadily recovering.Ahead, I see a major horizontal supply area.Probabilities are high, that the next bearish wave will initiate from there.2️⃣ EURUSD daily time frameAfter a breakout of a solid daily resistance, the market is preparing for its retest.Watch carefully the underlined zone and look for buying opportunities from there.3️⃣ EURAUD weekly time frameThe pair is currently approaching a weekly horizontal resistance cluster.Taking into consideration, that the pair is quite overbought, probabilities will be high to see a pullback from that4️⃣ GBPNZD daily time frameThe pair is currently retesting a broken neckline of an ascending triangle . As we discussed earlier, the trend line of a triangle and its neckline compose a contracting buy zone now.Chances will be high that the next bullish wave will initiate quite soon.For Additional confirmation use: Divergence Indicators
    • #CHFJPY: Classic Bearish Setup 🇨🇭🇯🇵   🔻CHFJPY has nicely respected a confluence zone based on a horizontal 4H resistance and a 0.5 retracement of the last bearish impulse.   The price formed a double top pattern on that and broke its neckline.   Probabilities will be high that the pair will drop lower soon. Goals: 141.172 / 140.363  
  • Create New...