Jump to content

AlgoTrader

Community Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by AlgoTrader

  1. Hi,

     

    Trying to place MARKET open order with TrailingStop without luck.

    Market order works but when changing Trailing_stop = True and increment to 50* or any other number I get error:

    trading_ig.rest.IGException: {"errorCode":"validation.null-conditional-set-value.request»}

    Trading on DEMO CFD account

    Really appreciate the help :)

     

    exapmle:

     

    response = ig_service.create_open_position(
        currency_code='USD',
        direction='BUY',
        epic='CS.D.ETHUSD.CFD.IP',
        expiry='-',
        force_open=True,
        guaranteed_stop=False,
        level=None,
        limit_distance=None,
        limit_level=None,
        order_type='MARKET',
        quote_id=None,
        size=0.1,
        stop_distance=None,
        stop_level=None,
        trailing_stop=True,
        trailing_stop_increment=50,
    )
  2. Is there any way to place market order using API?

    I get this error when I follow IG-documentation on placing market order:

     

    currency_code = "USD"
    direction = "BUY"
    epic = "CS.D.BITCOIN.CFD.IP"
    order_type = "MARKET"
    expiry = "-"
    guaranteed_stop = False

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

    error message:

        raise IGException(response.text)
    trading_ig.rest.IGException: {"errorCode":"invalid.request.type"}

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

    Is there something I'm missing here?

    For me the only thing working is order_type = 'BUY'

     

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

     

×
×
  • Create New...
us