From 027ec4d98eda93679e929655ad3688e9dcde0cd2 Mon Sep 17 00:00:00 2001 From: misagh Date: Mon, 24 Sep 2018 15:47:07 +0200 Subject: [PATCH] test_sell_profit_only_enable_loss and test_create_trade_limit_reached fixed --- freqtrade/freqtradebot.py | 2 ++ freqtrade/tests/test_freqtradebot.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index e3cc669d9..60d286af1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -402,6 +402,8 @@ class FreqtradeBot(object): (buy, sell) = self.strategy.get_signal(_pair, interval, self.exchange.klines.get(_pair)) if buy and not sell: 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) bidstrat_check_depth_of_market = self.config.get('bid_strategy', {}).\ get('check_depth_of_market', {}) diff --git a/freqtrade/tests/test_freqtradebot.py b/freqtrade/tests/test_freqtradebot.py index 79a09fde3..b12ec1018 100644 --- a/freqtrade/tests/test_freqtradebot.py +++ b/freqtrade/tests/test_freqtradebot.py @@ -1423,7 +1423,7 @@ def test_sell_profit_only_enable_loss(default_conf, limit_buy_order, fee, market freqtrade = FreqtradeBot(default_conf) patch_get_signal(freqtrade) freqtrade.strategy.stop_loss_reached = \ - lambda current_rate, trade, current_time, current_profit: SellCheckTuple( + lambda current_rate, trade, current_time, force_stoploss, current_profit: SellCheckTuple( sell_flag=False, sell_type=SellType.NONE) freqtrade.create_trade()