Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors after running #4

Closed
caressgents opened this issue Aug 31, 2020 · 4 comments
Closed

errors after running #4

caressgents opened this issue Aug 31, 2020 · 4 comments

Comments

@caressgents
Copy link

Receiving the following errors from mongo it appears. See below:

:~/ThorCryptocurrencyQuant$ python Strategy_main.py on open 11729.0 2020-08-31 12:00:05 0.04635084 2020-08-31 12:00:05 Traceback (most recent call last): File "Strategy_main.py", line 43, in <module> start_.start_transaction() File "/home/nateflanders/ThorCryptocurrencyQuant/GriddingStrategy/Quant.py", line 131, in start_transaction self.col.insert_one(dict) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/collection.py", line 701, in insert_one session=session), File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/collection.py", line 615, in _insert bypass_doc_val, session) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/collection.py", line 603, in _insert_one acknowledged, _insert_command, session) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1497, in _retryable_write with self._tmp_session(session) as s: File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__ return next(self.gen) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1829, in _tmp_session s = self._ensure_session(session) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1816, in _ensure_session return self.__start_session(True, causal_consistency=False) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1766, in __start_session server_session = self._get_server_session() File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1802, in _get_server_session return self._topology.get_server_session() File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/topology.py", line 488, in get_server_session None) File "/home/nateflanders/kola/lib/python3.6/site-packages/pymongo/topology.py", line 217, in _select_servers_loop (self._error_message(selector), timeout, self.description)) pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 5f4d48b3c591e57f6f0e4c93, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 111] Connection refused',)>]>

Any advice?

@caressgents
Copy link
Author

Also, once the orders are filled on both sides, it does not resubmit the grid for new orders. It only says 'on open' in the terminal, but never places new order sets. @fengok

@LagomCoder
Copy link
Owner

你好,策略运行需要设置Mongodb数据库,在Quant.py 的31行开始是相关代码,在_websocket.py 的195行是相关代码,okex_websocket的218行是相关代码,你可以查看一下,websocket改变数据库的订单状态,Quant.py检测数据库的订单状态是否发生变化去进行相关操作

@caressgents
Copy link
Author

@fengok Thank you, I got it working now.

However, noticing when orders are filled on either side, the algo does not update the orders to maintain the spread. Is this correct? If so, it will get orders stuck in positions often when market goes against your grid.

@LagomCoder
Copy link
Owner

@caressgents 别客气!现在价格超出了网的范围,就不会运行了,没有附加价格跟随功能,没有止损功能,你可以尝试添加,以后我可能会更新

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants