Skip to content

Commit

Permalink
More consistency changes...
Browse files Browse the repository at this point in the history
  • Loading branch information
yazeed committed Feb 4, 2020
1 parent d457d43 commit 91b4c96
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,23 @@ def _check_depth_of_market_buy(self, pair: str, conf: Dict) -> bool:
Checks depth of market before executing a buy
"""
conf_bids_to_ask_delta = conf.get('bids_to_ask_delta', 0)
logger.info('checking depth of market for %s', pair)
logger.info(f"Checking depth of market for {pair} ...")
order_book = self.exchange.get_order_book(pair, 1000)
order_book_data_frame = order_book_to_dataframe(order_book['bids'], order_book['asks'])
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(
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]}",
f"Bids: {order_book_bids}, Asks: {order_book_asks}, Delta: {bids_ask_delta}, "
f"Bid Price: {order_book['bids'][0][0]}, Ask Price: {order_book['asks'][0][0]}, "
f"Immediate Bid Quantity: {order_book['bids'][0][1]}, "
f"Immediate Ask Quantity: {order_book['asks'][0][1]}."
)
if bids_ask_delta >= conf_bids_to_ask_delta:
logger.info('bids to ask delta DOES satisfy condition.')
logger.info(f"Bids to asks delta for {pair} DOES satisfy condition.")
return True
else:
logger.info(f"bids to ask delta for {pair} does not satisfy condition.")
logger.info(f"Bids to asks delta for {pair} does not satisfy condition.")
return False

def execute_buy(self, pair: str, stake_amount: float, price: Optional[float] = None) -> bool:
Expand Down

0 comments on commit 91b4c96

Please sign in to comment.