This project is an example to demonstrate calling the IG US WebSocket API using the Python programming language.
It has been developed using Python 3.7.
It is not production quality code.
The example negotiates and establishes a FIXP session and then requests a SecurityList and a stream of Quote messages.
It stops and disconnects after a configured number of Quote messages are received.
To run the example an IG US Demo environment Username and Password are required. Open an account here.
Introduction to the IG US WebSocket API
See below for how to activate the environment if you are using conda.
python WebSocketClient.py --userName=a_username --password=a_password --quoteLimit=10
By default the example will connect to the Demo environment.
Anaconda is a commonly used Python environment.
You may choose to download the Indidual Edition.
Refer to the documents on the above site.
conda env create -f environment.yml
conda env export > environment.yml