Skip to content

Commit

Permalink
Fix bug in ws_thread.py.
Browse files Browse the repository at this point in the history
Use future.utils.iteritems instead of iter(), add future to
requirements.
  • Loading branch information
forkcs committed May 8, 2020
1 parent 4d8148b commit 67d78e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a library-like application, which operates with orders and positions on your account.

*Current version:* **0.4**
*Current version:* **0.4.1**
#### Features:
* Creating an cancelling orders on your account. Stop-loss, Limit, passive, reduce-only, close-only, hidden orders supported.
* Preventing these orders for being lost, cancelled or rejected: Supervisor will place them anew.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ idna==2.9
requests==2.23.0
six==1.14.0
urllib3==1.25.9
websocket-client==0.56.0
websocket-client==0.56.0
future==0.18.2
2 changes: 1 addition & 1 deletion supervisor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from supervisor._supervisor import *

__version__ = '0.4'
__version__ = '0.4.1'
3 changes: 2 additions & 1 deletion supervisor/core/ws_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from supervisor.core.utils.log import setup_custom_logger
from supervisor.core.utils.math import toNearest
from urllib.parse import urlparse, urlunparse
from future.utils import iteritems


class BitMEXWebsocket:
Expand Down Expand Up @@ -98,7 +99,7 @@ def get_ticker(self, symbol):
}

# The instrument has a tickSize. Use it to round values.
return {k: toNearest(float(v or 0), instrument['tickSize']) for k, v in iter(ticker)}
return {k: toNearest(float(v or 0), instrument['tickSize']) for k, v in iteritems(ticker)}

def funds(self):
return self.data['margin'][0]
Expand Down

0 comments on commit 67d78e4

Please sign in to comment.