Jump to content
  • 0

Position REJECTED, Reason : REJECT_SPREADBET_ORDER_ON_CFD_ACCOUNT


Eragonnm

Question

Hello,

I am trying to use IG API with the python Github (ig-markets-api-python-library). I can connect my DEMO session and have market information but I haven't been able to open a position. This is the code sent to open a position :

 

resp = ig_service.create_open_position(
        currency_code='USD',
        direction='BUY',
        epic='CS.D.LTCUSD.CFD.IP',
        order_type='MARKET',
        expiry='DFB',
        force_open='false',
        guaranteed_stop='false',
        size=10, level=None,
        limit_distance=None,
        limit_level=None,
        quote_id=None,
        stop_level=None,
        stop_distance=None,
        trailing_stop=None,
        trailing_stop_increment=None)
resp
 
And this is the respond of IG API :
 
{'affectedDeals': [],
'date': '2021-07-11T19:13:11.505',
'dealId': 'DIAAAAFY3HKNWAP',
'dealReference': 'FY5RRQQHA8TYM9',
'dealStatus': 'REJECTED',
'direction': 'BUY',
'epic': 'CS.D.LTCUSD.CFD.IP',
'expiry': None,
'guaranteedStop': False,
'level': None,
'limitDistance': None, 'limitLevel':
None, 'profit': None,
'profitCurrency': None,
'reason': 'REJECT_SPREADBET_ORDER_ON_CFD_ACCOUNT',
'size': None,
'status': None,
'stopDistance': None,
'stopLevel': None,
'trailingStop': False}

I do not understand the reason : 'REJECT_SPREADBET_ORDER_ON_CFD_ACCOUNT',

Would anyone help me on this? Is there any issue related to my account?

Thank you

  • Like 1
Link to comment

4 answers to this question

Recommended Posts

  • 0

Got the same issue. What did you use instead of 'DFB'?

 

currency_code = "GBP"
direction = "BUY"
epic = "IX.D.FTSE.CFD.IP"
expiry = "DFB"
guaranteed_stop = False
# entering price
level = 7402.0
# Pound per point size
size = 1
time_in_force = "GOOD_TILL_CANCELLED"
# limit orders are now called STOP
order_type = "STOP"
limit_distance = None
stop_distance = level*0.99

 

----------------------------

'direction': 'BUY',
 'epic': 'IX.D.FTSE.CFD.IP',
 'expiry': None,
 'guaranteedStop': False,
 'level': None,
 'limitDistance': None,
 'limitLevel': None,
 'profit': None,
 'profitCurrency': None,
 'reason': 'REJECT_SPREADBET_ORDER_ON_CFD_ACCOUNT',
 'size': None,
 'status': None,
 'stopDistance': None,
 'stopLevel': None,
 'trailingStop': False}

 

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