行情订阅我这边怎么弄都没方案,看了文档,执行了如下的命令成功了
发布于 1 个月前 作者 lizhi2013 127 次浏览 来自 问答

订阅消息:

股票订阅请求

curl -X POST "http://127.0.0.1:8011?action=new_handler&market_type=stock_cn&code=000001" curl -X POST "http://127.0.0.1:8011?action=new_handler&market_type=stock_cn&code=601789" curl -X POST “http://127.0.0.1:8011?action=new_handler&market_type=stock_cn&code=600995

然后就不知道怎么处理了

这个不知道怎么用 import QAPUBSUB 在代码里面执行如下的也没反应

import requests

这是用于开启订阅品种

requests.post(“http://127.0.0.1:8011?action=new_handler&market_type=future_cn&code=rb2001”)

这是用于开启采样行情bar

requests.post(“http://127.0.0.1:8011?action=new_resampler&market_type=future_cn&code=rb2001&frequence=1min”).text 然后出一堆错,

ConnectionRefusedError Traceback (most recent call last) /usr/local/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self) 159 conn = connection.create_connection( –> 160 (self._dns_host, self.port), self.timeout, **extra_kw 161 )

/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options) 83 if err is not None: —> 84 raise err 85

/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options) 73 sock.bind(source_address) —> 74 sock.connect(sa) 75 return sock

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

NewConnectionError Traceback (most recent call last) /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 676 headers=headers, –> 677 chunked=chunked, 678 )

回到顶部