bug fix: book order limit for binance
This commit is contained in:
parent
65ce10a124
commit
97a621325b
@ -83,7 +83,7 @@ CONF_SCHEMA = {
|
||||
'properties': {
|
||||
'use_book_order': {'type': 'boolean'},
|
||||
'book_order_min': {'type': 'number', 'minimum': 1},
|
||||
'book_order_max': {'type': 'number', 'minimum': 1}
|
||||
'book_order_max': {'type': 'number', 'minimum': 1, 'maximum': 50}
|
||||
},
|
||||
'required': ['use_book_order']
|
||||
},
|
||||
|
@ -243,6 +243,16 @@ def get_balances() -> dict:
|
||||
@retrier
|
||||
def get_order_book(pair: str, limit: Optional[int] = 100) -> dict:
|
||||
try:
|
||||
params = {}
|
||||
# 20180619: bittrex doesnt support limits -.-
|
||||
# 20180619: binance limit fix.. binance currently has valid range
|
||||
if _API.name == 'Binance':
|
||||
limit_range = [5, 10, 20, 50, 100, 500, 1000]
|
||||
for limitx in limit_range:
|
||||
if limit < limitx:
|
||||
limit = limitx
|
||||
break
|
||||
|
||||
return _API.fetch_order_book(pair, limit)
|
||||
except ccxt.NotSupported as e:
|
||||
raise OperationalException(
|
||||
|
Loading…
Reference in New Issue
Block a user