Merge pull request #25 from alangvand/whitelist-on-sale

add whitelist to execute_sell and append sold pair to it
This commit is contained in:
Janne Sinivirta 2017-09-28 11:02:23 +03:00 committed by GitHub
commit 9a64522f45

View File

@ -94,8 +94,10 @@ def execute_sell(trade: Trade, current_rate: float) -> None:
# Get available balance # Get available balance
currency = trade.pair.split('_')[1] currency = trade.pair.split('_')[1]
balance = exchange.get_balance(currency) balance = exchange.get_balance(currency)
whitelist = _CONF[trade.exchange.name.lower()]['pair_whitelist']
profit = trade.exec_sell_order(current_rate, balance) profit = trade.exec_sell_order(current_rate, balance)
whitelist.append(trade.pair)
message = '*{}:* Selling [{}]({}) at rate `{:f} (profit: {}%)`'.format( message = '*{}:* Selling [{}]({}) at rate `{:f} (profit: {}%)`'.format(
trade.exchange.name, trade.exchange.name,
trade.pair.replace('_', '/'), trade.pair.replace('_', '/'),