Jump to content
  • 0

Rejected: invalid stop or limit


Guest Benjamin

Question

Guest Benjamin

When submitting /positions/otc version 2 POST requests, my positions are occasionally getting rejected with reason UNKNOWN. In the account past activity, I find that the result column lists "Rejected: invalid stop or limit". However, the requests I am submitting do not have a stop or limit. The parameters I provide (copied from my Python code) for my API request are as follows:

 

create_position(    epic=epic,    direction='SELL',    size=1,    currencyCode='GBP',    expiry=expiry,    forceOpen=True,    guaranteedStop=False,    dealReference=None,    level=bid,    limitDistance=None,    limitLevel=None,    orderType='LIMIT',    quoteId=None,    stopDistance=None,    stopLevel=None,    timeInForce='FILL_OR_KILL',    trailingStop=None,    trailingStopIncrement=None)

It would be extremely useful if someone would explain why some of the requests are being rejected, and how to avoid or deal with this.

 

Thank you.

Link to comment

2 answers to this question

Recommended Posts

Guest DanC

Hey Benjamin,


We can definitely look into these rejections for you. Would you be able to drop us a message at the following link, confirming the account you are using, an approximate time for the rejections and any deal reference or ID you may have.

 

http://labs.ig.com/contact

 

Thanks,
Dan

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • image.png

  • Posts

    • Hi KoketsoIG, Thank you for the clarification on that. Cheers
    • Dear @millennium_falcon, Hey there! Thank you for reaching out. Just a heads-up, you can only have one API key for each environment, either live or demo. No third API key can be created.  Thanks, KoketsoIG
    • To clarify my understanding. From my Usecase, I have three separate programs all operating interdependently from one another. A program to subscribe to tic data on a number of Epics via the LightStream API, another to grab historic on a number of Epics via the REST API, and finally another to manage positions via the REST API. I need to do this on my demo account initially to get API code stabilized. The IG website specifically says that I need separate API key for each distinct program connecting to IG over REST or LightStream. So in my understanding it looks like I need three API keys all for the demo account. Am I missing something or have I misunderstood how to use these API keys? I am aware of the API request limits and this is why I assumed you need a key per program. Currently I have one API key for the demo account and cannot seem to add more keys to the demo account? I have looked at the FAQ and cannot see an answer for my query.
×
×
  • Create New...
us