Changesets · Branches · Tags · Compare
| Changeset | a6207ff44ae7eac3c986920e667d006d0951091a5ba42df7206f8a2df4e647fb |
|---|---|
| Author | Matthias <xmatthias@outlook.com> · 2021-04-10 14:37 +02:00 |
| Committer | Matthias <xmatthias@outlook.com> · 2021-04-10 14:40 +02:00 |
| Parents | e045c6a8f6df |
2 files changed
modified freqtrade/freqtradebot.py +4 −7
| @@ -410,9 +410,7 @@ | ||
| 410 | 410 | |
| 411 | 411 | bid_strategy = self.config.get('bid_strategy', {}) |
| 412 | 412 | if 'use_order_book' in bid_strategy and bid_strategy.get('use_order_book', False): |
| 413 | - logger.info( | |
| 414 | - f"Getting price from order book {bid_strategy['price_side'].capitalize()} side." | |
| 415 | - ) | |
| 413 | + | |
| 416 | 414 | order_book_top = bid_strategy.get('order_book_top', 1) |
| 417 | 415 | order_book = self.exchange.fetch_l2_order_book(pair, order_book_top) |
| 418 | 416 | logger.debug('order_book %s', order_book) |
| @@ -425,7 +423,8 @@ | ||
| 425 | 423 | f"Orderbook: {order_book}" |
| 426 | 424 | ) |
| 427 | 425 | raise PricingError from e |
| 428 | - logger.info(f'...top {order_book_top} order book buy rate {rate_from_l2:.8f}') | |
| 426 | + logger.info(f"Buy price from orderbook {bid_strategy['price_side'].capitalize()} side " | |
| 427 | + f"- top {order_book_top} order book buy rate {rate_from_l2:.8f}") | |
| 429 | 428 | used_rate = rate_from_l2 |
| 430 | 429 | else: |
| 431 | 430 | logger.info(f"Using Last {bid_strategy['price_side'].capitalize()} / Last Price") |
| @@ -479,19 +478,17 @@ | ||
| 479 | 478 | logger.debug(f"Stake amount is 0, ignoring possible trade for {pair}.") |
| 480 | 479 | return False |
| 481 | 480 | |
| 482 | - logger.info(f"Buy signal found: about create a new trade with stake_amount: " | |
| 481 | + logger.info(f"Buy signal found: about create a new trade for {pair} with stake_amount: " | |
| 483 | 482 | f"{stake_amount} ...") |
| 484 | 483 | |
| 485 | 484 | bid_check_dom = self.config.get('bid_strategy', {}).get('check_depth_of_market', {}) |
| 486 | 485 | if ((bid_check_dom.get('enabled', False)) and |
| 487 | 486 | (bid_check_dom.get('bids_to_ask_delta', 0) > 0)): |
| 488 | 487 | if self._check_depth_of_market_buy(pair, bid_check_dom): |
| 489 | - logger.info(f'Executing Buy for {pair}.') | |
| 490 | 488 | return self.execute_buy(pair, stake_amount) |
| 491 | 489 | else: |
| 492 | 490 | return False |
| 493 | 491 | |
| 494 | - logger.info(f'Executing Buy for {pair}') | |
| 495 | 492 | return self.execute_buy(pair, stake_amount) |
| 496 | 493 | else: |
| 497 | 494 | return False |
modified tests/test_freqtradebot.py +1 −1
| @@ -685,7 +685,7 @@ | ||
| 685 | 685 | assert trade.amount == 91.07468123 |
| 686 | 686 | |
| 687 | 687 | assert log_has( |
| 688 | - 'Buy signal found: about create a new trade with stake_amount: 0.001 ...', caplog | |
| 688 | + 'Buy signal found: about create a new trade for ETH/BTC with stake_amount: 0.001 ...', caplog | |
| 689 | 689 | ) |
| 690 | 690 | |
| 691 | 691 |