Merge pull request #2800 from yazeed/enhanced_check_depth_of_market_logging

better logging on check_depth_of_market_buy()
This commit is contained in:
hroff-1902 2020-01-29 10:56:14 +03:00 committed by GitHub
commit e1356fb80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -433,11 +433,18 @@ class FreqtradeBot:
order_book_bids = order_book_data_frame['b_size'].sum()
order_book_asks = order_book_data_frame['a_size'].sum()
bids_ask_delta = order_book_bids / order_book_asks
logger.info('bids: %s, asks: %s, delta: %s', order_book_bids,
order_book_asks, bids_ask_delta)
logger.info(
f"bids: {order_book_bids}, asks: {order_book_asks}, delta: {bids_ask_delta}, "
f"askprice: {order_book['asks'][0][0]}, bidprice: {order_book['bids'][0][0]}, "
f"immediate ask quantity: {order_book['asks'][0][1]}, "
f"immediate bid quantity: {order_book['bids'][0][1]}",
)
if bids_ask_delta >= conf_bids_to_ask_delta:
logger.info('bids to ask delta DOES satisfy condition.')
return True
return False
else:
logger.info(f"bids to ask delta for {pair} does not satisfy condition.")
return False
def execute_buy(self, pair: str, stake_amount: float, price: Optional[float] = None) -> bool:
"""