From 75ba6578a31e65bc25ba780fd826e2d55cd9785d Mon Sep 17 00:00:00 2001 From: misagh Date: Wed, 26 Sep 2018 16:36:41 +0200 Subject: [PATCH] unused library + trailing whitespaces removed. --- freqtrade/freqtradebot.py | 17 ++++++++++++----- freqtrade/optimize/__init__.py | 1 - freqtrade/strategy/interface.py | 6 ++++-- freqtrade/tests/conftest.py | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 60d286af1..be02db9a8 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -404,7 +404,12 @@ class FreqtradeBot(object): stake_amount = self._get_trade_stake_amount(_pair) if not stake_amount: return False - logger.info('Buy signal found: about create a new trade with stake_amount: %f ...', stake_amount) + + logger.info( + 'Buy signal found: about create a new trade with stake_amount: %f ...', + stake_amount + ) + bidstrat_check_depth_of_market = self.config.get('bid_strategy', {}).\ get('check_depth_of_market', {}) if (bidstrat_check_depth_of_market.get('enabled', False)) and\ @@ -444,10 +449,10 @@ class FreqtradeBot(object): pair_url = self.exchange.get_pair_detail_url(pair) stake_currency = self.config['stake_currency'] fiat_currency = self.config.get('fiat_display_currency', None) - + # Calculate amount buy_limit = self.get_target_bid(pair, self.exchange.get_ticker(pair)) - + min_stake_amount = self._get_min_pair_stake_amount(pair_s, buy_limit) if min_stake_amount is not None and min_stake_amount > stake_amount: logger.warning( @@ -630,9 +635,11 @@ class FreqtradeBot(object): def check_sell(self, trade: Trade, sell_rate: float, buy: bool, sell: bool) -> bool: if (self.config['edge']['enabled']): stoploss = self.edge.stoploss(trade.pair) - should_sell = self.strategy.should_sell(trade, sell_rate, datetime.utcnow(), buy, sell, stoploss) + should_sell = \ + self.strategy.should_sell(trade, sell_rate, datetime.utcnow(), buy, sell, stoploss) else: - should_sell = self.strategy.should_sell(trade, sell_rate, datetime.utcnow(), buy, sell) + should_sell = \ + self.strategy.should_sell(trade, sell_rate, datetime.utcnow(), buy, sell) if should_sell.sell_flag: self.execute_sell(trade, sell_rate, should_sell.sell_type) diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index 967227805..74c842427 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -16,7 +16,6 @@ import arrow from freqtrade import misc, constants, OperationalException from freqtrade.exchange import Exchange from freqtrade.arguments import TimeRange -import importlib logger = logging.getLogger(__name__) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 13fe01a70..73bf2313d 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -210,8 +210,10 @@ class IStrategy(ABC): :return: True if trade should be sold, False otherwise """ current_profit = trade.calc_profit_percent(rate) - stoplossflag = self.stop_loss_reached(current_rate=rate, trade=trade, current_time=date, - current_profit=current_profit, force_stoploss=force_stoploss) + stoplossflag = \ + self.stop_loss_reached(current_rate=rate, trade=trade, current_time=date, + current_profit=current_profit, force_stoploss=force_stoploss) + if stoplossflag.sell_flag: return stoplossflag diff --git a/freqtrade/tests/conftest.py b/freqtrade/tests/conftest.py index f8f7729eb..99c90d00a 100644 --- a/freqtrade/tests/conftest.py +++ b/freqtrade/tests/conftest.py @@ -137,7 +137,7 @@ def default_conf(): "stoploss_range_min": -0.01, "stoploss_range_max": -0.1, "stoploss_range_step": -0.001, - "maximum_winrate": 0.80, + "maximum_winrate": 0.80, "min_trade_number": 15, "max_trade_duration_minute": 1440, "remove_pumps": True,