trading-ig
A lightweight Python wrapper for the IG Markets API. Simplifies access to the IG REST and Streaming APIs.
What is it?
IG Markets provides financial spread betting and CFD platforms for trading equities, forex, commodities, indices, cryptocurrencies, bonds, rates, options and more.
IG provide APIs so that developers can access their platforms programmatically. Using the APIs you can get live and historical data, automate your trades, or create apps. For details about the IG APIs please see their site:
NOTE: this is not an IG project. Use it at your own risk
Dependencies
A number of dependencies in this project are marked as ‘optional’, this is by design. There is a brief explanation in this FAQ item.
For full details, see pyproject.toml
Support
This is an open source project, maintained by busy volunteers in their spare time. It should make it easier and quicker for you to use the IG APIs. However, it is not a support resource for users of the IG APIs. IG have their own support site, and an API support team.
If you have a problem when using this library, please think carefully about the likely cause. If it is:
a bug in this library
a request for a feature
missing or confusing documentation
then please create an issue. See the guidance notes here.
For anything else, please use the documentation and tools provided by IG
Contributing
Contributions are welcome. We use automated formatting, linting and testing so please make your code passes the tests, see here. And ideally, write some tests for the new code or feature.
License
BSD (See LICENSE)
See also
- Quickstart
- FAQs
- Why are there multiple versions of some API endpoints?
- Are there any code samples?
- How do I run the code samples?
- How to see log messages from
ig_trading
? - Why did I get a
KeyError: CST
? - Why do I get a error like
error.public-api.exceeded-*-allowance
? - How to avoid hitting the rate limits?
- Why do see an error like
REJECT_CFD_ORDER_ON_SPREADBET_ACCOUNT
? - Why does my Lightstreamer connection fail after 2 hours / every day?
- Why do see an error like
public-api.failure.stockbroking-not-supported
? - How do I check my PR will pass CI checks?
- Should I use v2 or v3 sessions?
- How do I connect with a v3 session?
- What if I have a problem?
- What happened to
setup.py
andrequirements.txt
? - Why are some dependencies marked as optional in
pyproject.toml
? - How do I find the epic for market ‘X’?
- Why do see an error like
unauthorised.access.to.equity.exception
?
- REST API
- Streaming API
Credits
Created by Femto Trader, Lewis Barber, Sudipta Basak, Andy Geach
Maintained by Andy Geach