Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating limit order gives error. #349

Open
gonza1207 opened this issue Apr 2, 2025 · 0 comments
Open

Creating limit order gives error. #349

gonza1207 opened this issue Apr 2, 2025 · 0 comments

Comments

@gonza1207
Copy link

I'm able to create market orders. I'm able to even create limit orders if the price I put as level is above the current price (if im going long) which means that the order gets executed immediately.

However for the normal use case of putting a lwoer price for my limit, I get an exception from IG.

Let's say SPX is at 5800, and I want to buy at 5300. Therefore I put a buy limit order at 5300:

I get the following error:

{'date': '2025-04-02T19:13:19.134', 'status': None, 'reason': 'LIMIT_ORDER_WRONG_SIDE_OF_MARKET', 'dealStatus': 'REJECTED', 'epic': 'IX.D.SPTRD.DAILY.IP', 'expiry': None, 'dealReference': 'D8VEMD26FGQTYPH', 'dealId': 'DIAAAATAM38RJA2', 'affectedDeals': [], 'level': None, 'size': None, 'direction': 'BUY', 'stopLevel': None, 'limitLevel': None, 'stopDistance': None, 'limitDistance': None, 'guaranteedStop': False, 'trailingStop': False, 'profit': None, 'profitCurrency': None}

This is the request my library made to IG:

{"currencyCode": "GBP", "direction": "BUY", "epic": "IX.D.SPTRD.DAILY.IP", "expiry": "DFB", "forceOpen": "true", "guaranteedStop": "false", "level": 5100, "limitDistance": null, "limitLevel": null, "orderType": "LIMIT", "quoteId": null, "size": 1, "stopDistance": null, "trailingStop": false, "trailingStopIncrement": null}

Does this only happen to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant