Hi, I am trying to do a trade through the API (either Python or the API Companion). I can do a MARKET trade successfully but now I want to do a LIMIT trade, where the trade is executed when a specific price point is reached but I cannot get this to work. I can place the limit order with the level through the IG Trading Dashboard though. Through the API, the LEVEL seems to be completely ignored and so it bypasses the limit and goes straight to market. Here is my Python script for GBPUSD:
epic = "CS.D.GBPUSD.TODAY.IP"
direction = "BUY"
stopDistance = 15
limitDistance = 15
size = 0.5
level = 13130 #(current price is 13125)
expiry="DBF"
orderType="LIMIT"
guaranteedStop=False
stopLevel=None
trailingStopIncrement=None
trailingStop=False
forceOpen=True
limitLevel=None
quoteId=None
currencyCode="GBP"
response = ig_service.create_open_position(currencyCode, direction, epic,
expiry, forceOpen, guaranteedStop, level, limitDistance,
limitLevel, orderType, quoteId, size, stopDistance, stopLevel,
trailingStop, trailingStopIncrement, None)