get_rate checks if side is buy for some console output

This commit is contained in:
Sam Germain 2021-07-24 17:07:06 -06:00
parent b84a1d0c92
commit b42afb9dae

View File

@ -1038,9 +1038,12 @@ class Exchange:
) )
raise PricingError from e raise PricingError from e
logger.info(f"{name} price from orderbook {conf_strategy['price_side'].capitalize()}" if side == "buy":
price_side = {conf_strategy['price_side'].capitalize()}
logger.info(f"{name} price from orderbook {price_side}"
f"side - top {order_book_top} order book {side} rate {rate:.8f}") f"side - top {order_book_top} order book {side} rate {rate:.8f}")
else: else:
if side == "buy":
logger.info(f"Using Last {conf_strategy['price_side'].capitalize()} / Last Price") logger.info(f"Using Last {conf_strategy['price_side'].capitalize()} / Last Price")
ticker = self.fetch_ticker(pair) ticker = self.fetch_ticker(pair)
ticker_rate = ticker[conf_strategy['price_side']] ticker_rate = ticker[conf_strategy['price_side']]