From 2b099a89e430f3e78ad5b7fa6f7cc0f2bbf9d40c Mon Sep 17 00:00:00 2001 From: xmatthias Date: Sun, 17 Jun 2018 22:42:28 +0200 Subject: [PATCH] fix styling issues --- freqtrade/freqtradebot.py | 6 +++--- freqtrade/rpc/rpc.py | 1 - freqtrade/tests/optimize/test_hyperopt.py | 2 -- freqtrade/tests/rpc/test_rpc_telegram.py | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index e708ba57f..dd35700a4 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -54,7 +54,7 @@ class FreqtradeBot(object): self.fiat_converter = CryptoToFiatConverter() self.rpc: RPCManager = RPCManager(self) self.persistence = None - self.exchange = None + self.exchange = Exchange(self.config) self._init_modules() @@ -66,7 +66,6 @@ class FreqtradeBot(object): # Initialize all modules persistence.init(self.config) - self.exchange = Exchange(self.config) # Set initial application state initial_state = self.config.get('initial_state') @@ -426,7 +425,8 @@ with limit `{buy_limit:.8f} ({stake_amount:.6f} \ (buy, sell) = (False, False) if self.config.get('experimental', {}).get('use_sell_signal'): - (buy, sell) = self.analyze.get_signal(self.exchange, trade.pair, self.analyze.get_ticker_interval()) + (buy, sell) = self.analyze.get_signal(self.exchange, + trade.pair, self.analyze.get_ticker_interval()) if self.analyze.should_sell(trade, current_rate, datetime.utcnow(), buy, sell): self.execute_sell(trade, current_rate) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index d58c265a7..ee6ecb770 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -12,7 +12,6 @@ import sqlalchemy as sql from numpy import mean, nan_to_num from pandas import DataFrame -from freqtrade.exchange import Exchange from freqtrade.misc import shorten_date from freqtrade.persistence import Trade from freqtrade.state import State diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index 7de6bcb7c..8ad1932af 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -67,7 +67,6 @@ def test_start(mocker, default_conf, caplog) -> None: mocker.patch('freqtrade.optimize.hyperopt.Hyperopt.start', start_mock) patch_exchange(mocker) - args = [ '--config', 'config.json', '--strategy', 'DefaultStrategy', @@ -184,7 +183,6 @@ def test_fmin_best_results(mocker, init_hyperopt, default_conf, caplog) -> None: mocker.patch('freqtrade.optimize.hyperopt.fmin', return_value=fmin_result) patch_exchange(mocker) - StrategyResolver({'strategy': 'DefaultStrategy'}) hyperopt = Hyperopt(conf) hyperopt.trials = create_trials(mocker) diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index 1b07a2143..0a7d9690f 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -20,7 +20,7 @@ from freqtrade.persistence import Trade from freqtrade.rpc.telegram import Telegram from freqtrade.rpc.telegram import authorized_only from freqtrade.state import State -from freqtrade.tests.conftest import get_patched_freqtradebot,patch_exchange, log_has +from freqtrade.tests.conftest import get_patched_freqtradebot, patch_exchange, log_has from freqtrade.tests.test_freqtradebot import patch_get_signal, patch_coinmarketcap