tg12/FAIG

bug report

Closed this issue · 1 comments

wondering if the project still open? I get following error running the code

CS.D.AUDUSD.TODAY.IPTraceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1007, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 947, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1421, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matt/Desktop/FAIG/faig.py", line 47, in <module>
    d = api.find_next_trade()
  File "/home/matt/Desktop/FAIG/ig.py", line 185, in find_next_trade
    res = self.fetch_current_price(epic_id)
  File "/home/matt/Desktop/FAIG/ig.py", line 120, in fetch_current_price
    res = self.igstreamclient.fetch_one(subscription)
  File "/home/matt/Desktop/FAIG/igstream.py", line 497, in fetch_one
    self.unsubscribe(sub_key)
  File "/home/matt/Desktop/FAIG/igstream.py", line 512, in unsubscribe
    self.lightstreamer_client.unsubscribe(sub_key)
  File "/home/matt/Desktop/FAIG/igstream.py", line 351, in unsubscribe
    server_response = self._control({
  File "/home/matt/Desktop/FAIG/igstream.py", line 223, in _control
    response = self._call(self._control_url, CONTROL_URL_PATH, params)
  File "/home/matt/Desktop/FAIG/igstream.py", line 205, in _call
    return _urlopen(url, data=self._encode_params(body))
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1131)>
tg12 commented

Hi, The project hasn't had any updates in a while but I have an active Github Profile. That sounds to me like you have not got the right API Key/Username and Password combination. Please see here for more details.

https://labs.ig.com/gettingstarted

https://www.ig.com/uk/trading-platforms/trading-apis/how-to-use-ig-api