Jump to content

Eragonnm

Community Member
  • Posts

    3
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Eragonnm

  1. 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
×
×
  • Create New...
us