Jump to content
  • 0

Issue opening a betspread position on the API


MerlinR

Question

This could be a user error but cant find anything, Im trying to open a bet spread position using the API companion and watching it via a lightstreamer. I can create the position correctly on the API companion however the position is REJECTED instantly with "REJECT_CFD_ORDER_ON_SPREADBET_ACCOUNT". This is on a DEMO account.

I have double checked, using a bet spread account and as far as i can tell this is a bet spread epic, i can make the exact same trade on the exact same epic on the IG dashboard, checked by making the trade on the browser and using the API to check position which showed same epic. Any help would be greatly appreciated.

Endpoint: /positions/otc

Request:

{
    "epic": "IX.D.DAX.DAILY.IP",
    "expiry": "-",
    "direction": "BUY",
    "size": "3.0",
    "orderType": "MARKET",
    "timeInForce": null,
    "level": null,
    "guaranteedStop": "false",
    "stopLevel": null,
    "stopDistance": "4",
    "trailingStop": "true",
    "trailingStopIncrement": "1",
    "forceOpen": "true",
    "limitLevel": null,
    "limitDistance": null,
    "quoteId": null,
    "currencyCode": "GBP"
}

Response:

HTTP 200

status: success

{

    "dealReference": "TRX24QSK778TYPH"
}

 

Lightstreamer:

2021-08-17 14:24:47,525 | INFO | service:lightStream_callback | {'pos': 1, 'sub_id': 1, 'name': 'TRADE:XXXXX', 'values': {'CONFIRMS': '{"direction":"BUY","epic":"IX.D.DAX.DAILY.IP","stopLevel":null,"limitLevel":null,"dealReference":"TRX24QSK778TYPH","dealId":"DIAAAAF9EVKEHAT","limitDistance":null,"stopDistance":null,"expiry":null,"affectedDeals":[],"dealStatus":"REJECTED","guaranteedStop":false,"trailingStop":false,"level":null,"reason":"REJECT_CFD_ORDER_ON_SPREADBET_ACCOUNT","status":null,"size":null,"profit":null,"profitCurrency":null,"date":"2021-08-17T14:24:47.476","channel":"PublicRestOTC"}', 'OPU': None, 'WOU': None}}

Link to comment

1 answer to this question

Recommended Posts

  • 0

Resolved, Unsure why but my first search for this error showed me nada.

Issue is Expiry date.

CFDs: -

spreads: DFB

 

Request:

{
    "epic": "IX.D.DAX.DAILY.IP",
    "expiry": "DFB",
    "direction": "BUY",
    "size": "3.0",
    "orderType": "MARKET",
    "timeInForce": null,
    "level": null,
    "guaranteedStop": "false",
    "stopLevel": null,
    "stopDistance": "4",
    "trailingStop": "true",
    "trailingStopIncrement": "1",
    "forceOpen": "true",
    "limitLevel": null,
    "limitDistance": null,
    "quoteId": null,
    "currencyCode": "GBP"
}

  • Like 2
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
×
×
  • Create New...