respect stake_currency conf
This commit is contained in:
parent
ec72fff478
commit
775c2a1a9a
4
main.py
4
main.py
@ -185,8 +185,8 @@ def create_trade(stake_amount: float, exchange):
|
||||
logger.info('Creating new trade with stake_amount: {} ...'.format(stake_amount))
|
||||
whitelist = conf[exchange.name.lower()]['pair_whitelist']
|
||||
# Check if btc_amount is fulfilled
|
||||
if api_wrapper.get_balance('BTC') < stake_amount:
|
||||
raise ValueError('BTC amount is not fulfilled')
|
||||
if api_wrapper.get_balance(conf['stake_currency']) < stake_amount:
|
||||
raise ValueError('stake amount is not fulfilled (currency={}'.format(conf['stake_currency']))
|
||||
|
||||
# Remove currently opened and latest pairs from whitelist
|
||||
latest_trade = Trade.query.filter(Trade.is_open.is_(False)).order_by(Trade.id.desc()).first()
|
||||
|
2
utils.py
2
utils.py
@ -30,6 +30,8 @@ def validate_conf(conf):
|
||||
"""
|
||||
if not isinstance(conf.get('max_open_trades'), int):
|
||||
raise ValueError('max_open_trades must be a int')
|
||||
if not isinstance(conf.get('stake_currency'), str):
|
||||
raise ValueError('stake_currency must be a str')
|
||||
if not isinstance(conf.get('stake_amount'), float):
|
||||
raise ValueError('stake_amount must be a float')
|
||||
if not isinstance(conf.get('dry_run'), bool):
|
||||
|
Loading…
Reference in New Issue
Block a user