Skip to content

Commit

Permalink
added ask price, bid price, immediate ask quantity, and immediate bid…
Browse files Browse the repository at this point in the history
… quantity to check_depth_of_market_buy. also added a line that mentions if delta condition was satisfied or not.
  • Loading branch information
yazeed committed Jan 25, 2020
1 parent 82797e7 commit f8db7f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,14 @@ def _check_depth_of_market_buy(self, pair: str, conf: Dict) -> bool:
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('bids: %s, asks: %s, delta: %s, askprice: %s, bidprice: %s, immediate askquantity: %s, immediate bidquantity: %s',
order_book_bids, order_book_asks, bids_ask_delta, order_book['asks'][0][0], order_book['bids'][0][0], order_book['asks'][0][1], 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('bids to ask delta 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 f8db7f1

Please sign in to comment.