Jump to content
  • 0

Issue opening a betspread position on the API


MerlinR

Question

Posted

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}}

1 answer to this question

Recommended Posts

  • 0
Posted

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

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

    • With Bitcoin aiming for a new ATH, this staking might be the best option to maximum holding
    • Tbh, trading can be frustrating, I keep trying different strategy to perfect my trading skill but all seems to be in vain. Recently, I learnt we can use AI to predict the market to trade, so I decide to start asking AI to analyze when btc is overbought so I can look for short entry but this seems not to work against as most trade I enter end up hitting my SL. I know this is part of the learning process so I don’t risk too much but it hurt to lose fund especially when you are trying your best to make your first positive trade. Sometime, I just feel the market is totally against me and that further discourages me from futures trading. Recently, I got introduced to BTC staking on some platforms like BGBTC on bitget, Babylon chain, Solv protocol, Coredao etc but that doesn’t quench my hunger to understand BTC volatility since I will just stake my btc and earn apr. I want to understand how this volatility works so I can start making something from futures trading rather than just staking to earn apr. Also, I feel staking is for spot traders that intend to hold for a longer period and that doesn’t expose you to the market. I am not like most trader that prioritize profit over knowledge even when that is the final goal.
    • $ETH will surpass ATH this month and hit $7-8k next year
×
×
  • Create New...
us