remove markets changes

This commit is contained in:
iuvbio
2019-03-02 18:53:42 +01:00
parent c36fa0c7e2
commit e1ae0d7e90
6 changed files with 117 additions and 15 deletions

View File

@@ -206,7 +206,7 @@ class FreqtradeBot(object):
self.state = State.STOPPED
return state_changed
def get_target_bid(self, pair: str, ticker: Dict = None) -> float:
def get_target_bid(self, pair: str, tick: Dict = None) -> float:
"""
Calculates bid target between current ask price and last price
:return: float: Price
@@ -223,9 +223,11 @@ class FreqtradeBot(object):
logger.info('...top %s order book buy rate %0.8f', order_book_top, order_book_rate)
used_rate = order_book_rate
else:
if not ticker:
if not tick:
logger.info('Using Last Ask / Last Price')
ticker = self.exchange.get_ticker(pair)
else:
ticker = tick
if ticker['ask'] < ticker['last']:
ticker_rate = ticker['ask']
else:
@@ -270,10 +272,12 @@ class FreqtradeBot(object):
return stake_amount
def _get_min_pair_stake_amount(self, pair: str, price: float) -> Optional[float]:
try:
market = self.exchange.markets[pair]
except KeyError:
raise ValueError(f"Can't get market information for symbol {pair}")
markets = self.exchange.get_markets()
markets = [m for m in markets if m['symbol'] == pair]
if not markets:
raise ValueError(f'Can\'t get market information for symbol {pair}')
market = markets[0]
if 'limits' not in market:
return None