File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def __init__(self):
5454
5555 try :
5656 props = config ['config' ]
57- self .bot_version = '1.4.6 '
57+ self .bot_version = '1.4.7 '
5858 self .exchange = str (props ['exchange' ]).strip ('"' ).lower ()
5959 self .api_key = str (props ['api_key' ]).strip ('"' )
6060 self .api_secret = str (props ['api_secret' ]).strip ('"' )
@@ -1483,9 +1483,11 @@ def get_used_balance():
14831483 try :
14841484 if CONF .exchange == 'bitmex' :
14851485 position = EXCHANGE .private_get_position ()
1486- if not position :
1487- return None
1488- return float (position [0 ]['currentQty' ])
1486+ if position :
1487+ for po in position :
1488+ if po ['symbol' ] == CONF .symbol :
1489+ return float (po ['currentQty' ])
1490+ return None
14891491 if CONF .exchange == 'kraken' :
14901492 result = EXCHANGE .private_post_tradebalance ()['result' ]
14911493 return float (result ['e' ]) - float (result ['mf' ])
@@ -1541,7 +1543,9 @@ def get_position_info():
15411543 if CONF .exchange == 'bitmex' :
15421544 position = EXCHANGE .private_get_position ()
15431545 if position :
1544- return position [0 ]
1546+ for po in position :
1547+ if po ['symbol' ] == CONF .symbol :
1548+ return po
15451549 return None
15461550 LOG .warning (NOT_IMPLEMENTED_MESSAGE , 'get_postion_info()' , CONF .exchange )
15471551 return None
You can’t perform that action at this time.
0 commit comments