Move warning to create_trades()

This commit is contained in:
hroff-1902 2019-12-28 03:22:50 +03:00
parent ed9cb4219d
commit 8eeabd2372

View File

@ -231,7 +231,6 @@ class FreqtradeBot:
""" """
open_trades = len(Trade.get_open_trades()) open_trades = len(Trade.get_open_trades())
if open_trades >= self.config['max_open_trades']: if open_trades >= self.config['max_open_trades']:
logger.warning("Can't open a new trade: max number of trades is reached")
return None return None
available_amount = self.wallets.get_free(self.config['stake_currency']) available_amount = self.wallets.get_free(self.config['stake_currency'])
return available_amount / (self.config['max_open_trades'] - open_trades) return available_amount / (self.config['max_open_trades'] - open_trades)
@ -324,7 +323,8 @@ class FreqtradeBot:
if buy and not sell and len(Trade.get_open_trades()) < self.config['max_open_trades']: if buy and not sell and len(Trade.get_open_trades()) < self.config['max_open_trades']:
stake_amount = self.get_trade_stake_amount(pair) stake_amount = self.get_trade_stake_amount(pair)
if not stake_amount: if stake_amount is None:
logger.warning("Can't open a new trade: max number of trades is reached")
continue continue
logger.info(f"Buy signal found: about create a new trade with stake_amount: " logger.info(f"Buy signal found: about create a new trade with stake_amount: "