api = TqApi(TqSim(500000),backtest=TqBacktest(start_dt=start_date, end_dt=end_date), auth=TqAuth("*****", "******"))
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 169, in _new_conn
conn = connection.create_connection(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\connection.py”, line 96, in create_connection
raise err
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\connection.py”, line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 699, in urlopen
httplib_response = self._make_request(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 382, in _make_request
self._validate_conn(conn)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 1010, in _validate_conn
conn.connect()
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 353, in connect
conn = self._new_conn()
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x00000155B3569040>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\adapters.py”, line 439, in send
resp = conn.urlopen(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 755, in urlopen
retries = retries.increment(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\retry.py”, line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=’api.shinnytech.com’, port=443): Max retries exceeded with url: /ns?stock=true (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x00000155B3569040>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\PycharmProjects\trading\tianqin_simulation.py”, line 16, in <module>
api = TqApi(acc,backtest=TqBacktest(start_dt=start_date, end_dt=end_date), auth=TqAuth(“天黑我怕谁”, “Eg4996949”))
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py”, line 282, in __init__
self._setup_connection() # 初始化通讯连接
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py”, line 2489, in _setup_connection
self._md_url = self._auth._get_md_url(self._stock) # 如果用户未指定行情地址,则使用名称服务获取行情地址
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\auth.py”, line 123, in _get_md_url
response = requests.get(url=url, params=params, headers=self._base_headers, timeout=30)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\api.py”, line 76, in get
return request(‘get’, url, params=params, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\sessions.py”, line 542, in request
resp = self.send(prep, **send_kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\sessions.py”, line 655, in send
r = adapter.send(request, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=’api.shinnytech.com’, port=443): Max retries exceeded with url: /ns?stock=true (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x00000155B3569040>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))
Task was destroyed but it is pending!
task: <Task pending name=’Task-2′ coro=<TqApi._notify_watcher() running at C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py:2976> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-1′ coro=<TqApi._windows_patch() running at C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py:2971> cb=[TqApi._on_task_done()]>
sys:1: RuntimeWarning: coroutine ‘TqApi._notify_watcher’ was never awaited
sys:1: RuntimeWarning: coroutine ‘TqApi._windows_patch’ was never awaited
(scientificProject) PS C:\Users\huanyu\PycharmProjects\trading> python .\tianqin_simulation.py > test1.out
在使用天勤量化之前,默认您已经知晓并同意以下免责条款,如果不同意请立即停止使用:https://www.shinnytech.com/blog/disclaimer/
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 169, in _new_conn
conn = connection.create_connection(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\connection.py”, line 96, in create_connection
raise err
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\connection.py”, line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 699, in urlopen
httplib_response = self._make_request(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 382, in _make_request
self._validate_conn(conn)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 1010, in _validate_conn
conn.connect()
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 353, in connect
conn = self._new_conn()
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connection.py”, line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000026542EA9070>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\adapters.py”, line 439, in send
resp = conn.urlopen(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\connectionpool.py”, line 755, in urlopen
retries = retries.increment(
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\urllib3\util\retry.py”, line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=’api.shinnytech.com’, port=443): Max retries exceeded with url: /ns?stock=true (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x0000026542EA9070>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\huanyu\PycharmProjects\trading\tianqin_simulation.py”, line 16, in <module>
api = TqApi(acc,backtest=TqBacktest(start_dt=start_date, end_dt=end_date), auth=TqAuth(“天黑我怕谁”, “Eg4996949”))
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py”, line 282, in __init__
self._setup_connection() # 初始化通讯连接
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py”, line 2489, in _setup_connection
self._md_url = self._auth._get_md_url(self._stock) # 如果用户未指定行情地址,则使用名称服务获取行情地址
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\auth.py”, line 123, in _get_md_url
response = requests.get(url=url, params=params, headers=self._base_headers, timeout=30)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\api.py”, line 76, in get
return request(‘get’, url, params=params, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\sessions.py”, line 542, in request
resp = self.send(prep, **send_kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\sessions.py”, line 655, in send
r = adapter.send(request, **kwargs)
File “C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\requests\adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=’api.shinnytech.com’, port=443): Max retries exceeded with url: /ns?stock=true (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x0000026542EA9070>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))
Task was destroyed but it is pending!
task: <Task pending name=’Task-2′ coro=<TqApi._notify_watcher() running at C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py:2976> cb=[TqApi._on_task_done()]>
Task was destroyed but it is pending!
task: <Task pending name=’Task-1′ coro=<TqApi._windows_patch() running at C:\Users\huanyu\Anaconda3\envs\scientificProject\lib\site-packages\tqsdk\api.py:2971> cb=[TqApi._on_task_done()]>
sys:1: RuntimeWarning: coroutine ‘TqApi._notify_watcher’ was never awaited
sys:1: RuntimeWarning: coroutine ‘TqApi._windows_patch’ was never awaited
即使不是backtest 正常的创建api也会有同样的error
api = TqApi(TqKq(),auth=TqAuth(“******”, “********”))