-
September 7th, 2023, 06:27 PM
#1
Struggling to connect via Python using a demo IG account
Hello all,
As per the title suggests, I am trying to use the IG API to stream some data, and am struggling with it.
The topic came up before, but some of the posts are quite old. I have tried some github sharing python code samples found online, but I have not been able to successfully connect with any of them.
I also tried to post directly in my browser with "https://demo-apd.marketdatasystems.com/lightstreamer/create_session.txt?LS_user=XXXXXX&LS_password=CST-YYYYYYYYYYY|XST-ZZZZZZZZZZ&LS_adapter_set=DEFAULT" (with my details now removed)
I am getting:
OK
SessionId:XXXXXXXXXXXXXXXXXXXXXXX
ControlAddress:apd144f.marketdatasystems.com
KeepaliveMillis:5000
MaxBandwidth:0.0
Preamble: preparing push
Preamble: preparing push
Preamble: preparing push
PROBE
PROBE
Are you able to please assist?
Many thanks
M
-
September 8th, 2023, 08:53 AM
#2
Hi,
Please could you share some more information about the problem you got with the Python client you have tested?
I.e. whether you are able to open a client session or not or only the data streaming is not working.
Could you enable library logging (https://sdk.lightstreamer.com/ls-pyt...o.html#logging)?
Additionally, please keep in mind any potential constraints related to the versions supported by IG, which you can check here: https://lightstreamer.com/share/ig/index.html
Regards,
Giuseppe
-
September 9th, 2023, 04:23 AM
#3
Hello Giuseppe. Thanks for the response. I just came across https://trading-ig.readthedocs.io/en/latest/ which solved my issue. Take care. M
-
September 11th, 2023, 08:48 AM
#4
Thanks for the feedback.
Regards,
Giuseppe
-
January 3rd, 2024, 03:39 PM
#5
Dear M / 33isgreat,
would you mind sharing how the trading-ig library helped?
I am running into the same issue: Connecting to the IG lightstreamer server works via http (tested via curl), but not when using the lightstreamer python package. For both, connecting via the trading_ig wrapper or using the `from lightstreamer.client import LightstreamerClient` directly, I always end up with this:
```
2024-01-03 16:25:05.179955|ERROR|lightstreamer.session|Thread-3 (_hx_local_2)|Retrying c
onnection in 3878.010208005435ms. Cause: HTTP error
```
@Guiseppe: Is there a way to increase the verbosity of the logging for the python client in order to debug what is causing this HTTP error?
Many thanks and best regards,
Matthias
-
January 5th, 2024, 08:28 AM
#6
Hi Matthias,
Which version of the Python client lib are you using?
With latest version the instructions to activate the debug logging are these: https://sdk.lightstreamer.com/ls-pyt...o.html#logging
Regards,
Giuseppe
Similar Threads
-
By avdev in forum Client SDKs
Replies: 1
Last Post: September 25th, 2020, 02:12 PM
-
By PBLopez in forum Client SDKs
Replies: 1
Last Post: April 16th, 2018, 09:04 AM
-
By vpurohit in forum Client SDKs
Replies: 1
Last Post: April 29th, 2013, 08:56 AM
-
By krohnjw in forum Client SDKs
Replies: 23
Last Post: February 8th, 2011, 01:47 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 04:22 PM.
Bookmarks